migration to the open-GL orientation for the display ==> this force to thing from the bottum (step 1)
This commit is contained in:
parent
8305cde419
commit
b8dcbd57a7
@ -53,27 +53,27 @@ namespace ewol
|
||||
int32_t GetWidth(int32_t fontID, const etk::UString& unicodeString);
|
||||
int32_t GetHeight(int32_t fontID);
|
||||
int32_t DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
Vector2D<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const etk::UString & unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex);
|
||||
int32_t DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
Vector2D<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex);
|
||||
int32_t DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
Vector2D<float> textPos,
|
||||
const etk::UString & unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex);
|
||||
int32_t DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
Vector2D<float> textPos,
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
|
@ -590,6 +590,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
|
||||
fontTextureId = m_listLoadedFont[fontID]->GetOglId();
|
||||
int32_t fontSize = m_listLoadedFont[fontID]->GetSize();
|
||||
int32_t fontHeight = m_listLoadedFont[fontID]->GetHeight();
|
||||
|
||||
float posDrawX = textPos.x;
|
||||
|
||||
@ -620,8 +621,8 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
*/
|
||||
float dxA = posDrawX + listOfElement[charIndex].bearing.x;
|
||||
float dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x;
|
||||
float dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y;
|
||||
float dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y;
|
||||
float dyC = textPos.y + listOfElement[charIndex].bearing.y + fontHeight - fontSize;
|
||||
float dyD = dyC - listOfElement[charIndex].size.y;
|
||||
|
||||
float tuA = listOfElement[charIndex].posStart.u;
|
||||
float tuB = listOfElement[charIndex].posStop.u;
|
||||
@ -636,6 +637,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
{
|
||||
// Nothing to diplay ...
|
||||
} else {
|
||||
/*
|
||||
// generata positions...
|
||||
float TexSizeX = tuB - tuA;
|
||||
if (dxA < drawClipping.x) {
|
||||
@ -657,26 +659,27 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
tuB -= addElement;
|
||||
}
|
||||
float TexSizeY = tvD - tvC;
|
||||
if (dyC < drawClipping.y) {
|
||||
if (dyD < drawClipping.y) {
|
||||
// clip display
|
||||
float drawSize = drawClipping.y - dyC;
|
||||
float drawSize = drawClipping.y - dyD;
|
||||
// Update element start display
|
||||
dyC = drawClipping.y;
|
||||
dyD = drawClipping.y;
|
||||
float addElement = TexSizeY * drawSize / listOfElement[charIndex].size.y;
|
||||
// update texture start X Pos
|
||||
tvC += addElement;
|
||||
tvD += addElement;
|
||||
}
|
||||
if (dyD > drawClipping.y + drawClipping.h) {
|
||||
if (dyC > drawClipping.y + drawClipping.h) {
|
||||
// clip display
|
||||
float drawSize = dyD - (drawClipping.y + drawClipping.h);
|
||||
float drawSize = dyC - (drawClipping.y + drawClipping.h);
|
||||
// Update element start display
|
||||
dyD = drawClipping.y + drawClipping.h;
|
||||
dyC = drawClipping.y + drawClipping.h;
|
||||
float addElement = TexSizeX * drawSize / listOfElement[charIndex].size.y;
|
||||
// update texture start X Pos
|
||||
tvD -= addElement;
|
||||
tvC -= addElement;
|
||||
}
|
||||
*/
|
||||
if( dxB <= dxA
|
||||
|| dyD <= dyC) {
|
||||
/*|| dyD >= dyC*/) {
|
||||
// nothing to do ...
|
||||
} else {
|
||||
/* Bitmap position
|
||||
@ -685,7 +688,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
* | |
|
||||
* 3------2
|
||||
*/
|
||||
Vector2D<float> bitmapDrawPos[4];
|
||||
Vector2D<int32_t> bitmapDrawPos[4];
|
||||
bitmapDrawPos[0].x = (int32_t)dxA;
|
||||
bitmapDrawPos[1].x = (int32_t)dxB;
|
||||
bitmapDrawPos[2].x = (int32_t)dxB;
|
||||
@ -763,6 +766,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex)
|
||||
{
|
||||
#if 0
|
||||
if(fontID>=m_listLoadedFont.Size() || fontID < 0) {
|
||||
EWOL_WARNING("try to display text with an fontID that does not existed " << fontID);
|
||||
return 0;
|
||||
@ -799,8 +803,8 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
*/
|
||||
float dxA = posDrawX + listOfElement[charIndex].bearing.x;
|
||||
float dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x;
|
||||
float dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y;
|
||||
float dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y;
|
||||
float dyC = textPos.y + listOfElement[charIndex].bearing.y - fontSize;
|
||||
float dyD = dyC + listOfElement[charIndex].size.y;
|
||||
|
||||
float tuA = listOfElement[charIndex].posStart.u;
|
||||
float tuB = listOfElement[charIndex].posStop.u;
|
||||
@ -841,7 +845,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
* | |
|
||||
* 3------2
|
||||
*/
|
||||
Vector2D<float> bitmapDrawPos[4];
|
||||
Vector2D<int32_t> bitmapDrawPos[4];
|
||||
bitmapDrawPos[0].x = (int32_t)dxA;
|
||||
bitmapDrawPos[1].x = (int32_t)dxB;
|
||||
bitmapDrawPos[2].x = (int32_t)dxB;
|
||||
@ -906,6 +910,9 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
int32_t sizeOut = posDrawX - textPos.x;
|
||||
textPos.x = posDrawX;
|
||||
return sizeOut;
|
||||
#else
|
||||
return 10;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -924,6 +931,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
|
||||
fontTextureId = m_listLoadedFont[fontID]->GetOglId();
|
||||
int32_t fontSize = m_listLoadedFont[fontID]->GetSize();
|
||||
int32_t fontHeight = m_listLoadedFont[fontID]->GetHeight();
|
||||
|
||||
float posDrawX = textPos.x;
|
||||
|
||||
@ -954,8 +962,8 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
*/
|
||||
float dxA = posDrawX + listOfElement[charIndex].bearing.x;
|
||||
float dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x;
|
||||
float dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y;
|
||||
float dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y;
|
||||
float dyC = textPos.y + listOfElement[charIndex].bearing.y + fontHeight - fontSize;
|
||||
float dyD = dyC - listOfElement[charIndex].size.y;
|
||||
|
||||
float tuA = listOfElement[charIndex].posStart.u;
|
||||
float tuB = listOfElement[charIndex].posStop.u;
|
||||
@ -965,7 +973,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
|
||||
// Clipping and drawing area
|
||||
if( dxB <= dxA
|
||||
|| dyD <= dyC) {
|
||||
|| dyD >= dyC) {
|
||||
// nothing to do ...
|
||||
} else {
|
||||
/* Bitmap position
|
||||
@ -974,7 +982,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
* | |
|
||||
* 3------2
|
||||
*/
|
||||
Vector2D<float> bitmapDrawPos[4];
|
||||
Vector2D<int32_t> bitmapDrawPos[4];
|
||||
bitmapDrawPos[0].x = (int32_t)dxA;
|
||||
bitmapDrawPos[1].x = (int32_t)dxB;
|
||||
bitmapDrawPos[2].x = (int32_t)dxB;
|
||||
@ -1033,6 +1041,7 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
coord.PushBack(bitmapDrawPos[0]);
|
||||
coord.PushBack(bitmapDrawPos[2]);
|
||||
coord.PushBack(bitmapDrawPos[3]);
|
||||
|
||||
}
|
||||
}
|
||||
posDrawX += listOfElement[charIndex].advance;
|
||||
|
@ -311,13 +311,13 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
|
||||
tmppp2 = m_origin.y + m_size.y;
|
||||
int32_t tmpclipY = etk_min(tmppp1, tmppp2) - tmpOriginX;
|
||||
|
||||
glViewport( tmpOriginX,
|
||||
displayProp.m_windowsSize.y - m_size.y - tmpOriginY,
|
||||
glViewport( tmpOriginX,
|
||||
tmpOriginY,
|
||||
tmpclipX,
|
||||
m_size.y);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthoEwol(-tmpclipX/2, tmpclipX/2, m_size.y/2, -m_size.y/2, -1, 1);
|
||||
glOrthoEwol(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||
//glOrthoEwol(0., m_size.x, 0., -m_size.y, 1., 20.);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
@ -330,14 +330,13 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
|
||||
displayProp.m_size.y = m_size.y;
|
||||
OnDraw(displayProp);
|
||||
} else {
|
||||
int32_t tmpOriginY = m_origin.y;
|
||||
glViewport( m_origin.x,
|
||||
displayProp.m_windowsSize.y - m_size.y - m_origin.y,
|
||||
glViewport( m_origin.x,
|
||||
m_origin.y,
|
||||
m_size.x,
|
||||
m_size.y);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthoEwol(-m_size.x/2, m_size.x/2, m_size.y/2, -m_size.y/2, -1, 1);
|
||||
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
@ -160,23 +160,6 @@ void ewol::Windows::SysDraw(void)
|
||||
//EWOL_DEBUG("Drow on (" << m_size.x << "," << m_size.y << ")");
|
||||
// set the size of the open GL system
|
||||
glViewport(0,0,m_size.x,m_size.y);
|
||||
/*
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthoEwol(-m_size.x/2, m_size.x/2, m_size.y/2, -m_size.y/2, -1, 1);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(-m_size.x/2, -m_size.y/2, -1.0);
|
||||
|
||||
#else
|
||||
glOrtho(0., m_size.x, 0., -m_size.y, 1., 20.);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0, -m_size.y, -5);
|
||||
#endif
|
||||
*/
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
@ -192,6 +192,9 @@ extern int32_t offsetMoveClickedDouble;
|
||||
// note if id<0 ==> the it was finger event ...
|
||||
void ewol::eventInput::Motion(ewol::inputType_te type, int pointerID, Vector2D<float> pos)
|
||||
{
|
||||
// convert position in Open-GL coordonates ...
|
||||
pos.y = ewol::GetCurrentHeight() - pos.y;
|
||||
|
||||
InputPoperty_ts *eventTable = NULL;
|
||||
if (type == ewol::INPUT_TYPE_MOUSE) {
|
||||
eventTable = eventMouseSaved;
|
||||
@ -270,6 +273,8 @@ void ewol::eventInput::Motion(ewol::inputType_te type, int pointerID, Vector2D<f
|
||||
|
||||
void ewol::eventInput::State(ewol::inputType_te type, int pointerID, bool isDown, Vector2D<float> pos)
|
||||
{
|
||||
// convert position in Open-GL coordonates ...
|
||||
pos.y = ewol::GetCurrentHeight() - pos.y;
|
||||
InputPoperty_ts *eventTable = NULL;
|
||||
if (type == ewol::INPUT_TYPE_MOUSE) {
|
||||
eventTable = eventMouseSaved;
|
||||
|
@ -226,9 +226,7 @@ void ewol::Button::OnRegenerateDisplay(void)
|
||||
int32_t fontHeight = ewol::GetHeight(fontId);
|
||||
int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str());
|
||||
*/
|
||||
Vector2D<float> textPos;
|
||||
textPos.x = tmpTextOriginX;
|
||||
textPos.y = tmpTextOriginY;
|
||||
Vector2D<float> textPos(tmpTextOriginX, tmpTextOriginY);
|
||||
|
||||
ewol::OObject2DTextured * tmpImage = NULL;
|
||||
if (true == m_hasAnImage) {
|
||||
@ -244,6 +242,7 @@ void ewol::Button::OnRegenerateDisplay(void)
|
||||
drawClipping.y = m_padding.y;
|
||||
drawClipping.w = m_size.x - 2*m_padding.x;
|
||||
drawClipping.h = m_size.y - 2*m_padding.y;
|
||||
EWOL_DEBUG("draw tex at pos : " <<textPos << "in element size:" << m_size);
|
||||
tmpText->Text(textPos, drawClipping, m_label);
|
||||
|
||||
ewol::OObject2DColored * tmpOObjects = new ewol::OObject2DColored;
|
||||
|
@ -141,9 +141,7 @@ void ewol::Label::OnRegenerateDisplay(void)
|
||||
|
||||
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg);
|
||||
|
||||
Vector2D<float> textPos;
|
||||
textPos.x = tmpOriginX;
|
||||
textPos.y = tmpOriginY;
|
||||
Vector2D<float> textPos(tmpOriginX, tmpOriginY);
|
||||
clipping_ts drawClipping;
|
||||
drawClipping.x = paddingSize;
|
||||
drawClipping.y = paddingSize;
|
||||
|
@ -378,13 +378,13 @@ void ewol::WidgetScrooled::GenDraw(DrawProperty displayProp)
|
||||
if (SCROLL_MODE_CENTER == m_scroollingMode) {
|
||||
glPushMatrix();
|
||||
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
|
||||
glViewport( m_origin.x,
|
||||
ewol::GetCurrentHeight() - m_size.y - m_origin.y,
|
||||
glViewport( m_origin.x,
|
||||
m_origin.y,
|
||||
m_size.x,
|
||||
m_size.y);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthoEwol(-m_size.x/2, m_size.x/2, m_size.y/2, -m_size.y/2, -1, 1);
|
||||
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glScalef(m_zoom, m_zoom, 1.0);
|
||||
|
@ -91,50 +91,66 @@ ewol::FileChooser::FileChooser(void)
|
||||
m_file = "";
|
||||
|
||||
mySizerVert = new ewol::SizerVert();
|
||||
if (NULL == mySizerVert) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->LockExpendContamination(true);
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
m_widgetTitle = new ewol::Label("File chooser ...");
|
||||
mySizerVert->SubWidgetAdd(m_widgetTitle);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myImage = new ewol::Image("icon/Folder.svg");
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
|
||||
m_widgetCurrentFolder = new ewol::Entry(m_folder);
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFolder);
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFolderEnter);
|
||||
m_widgetCurrentFolder->SetExpendX(true);
|
||||
m_widgetCurrentFolder->SetFillX(true);
|
||||
m_widgetCurrentFolder->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFolder);
|
||||
myImage = new ewol::Image("icon/Home.svg");
|
||||
myImage->RegisterOnEvent(this, ewolEventImagePressed, ewolEventFileChooserHome);
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myImage = new ewol::Image("icon/File.svg");
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
m_widgetCurrentFileName = new ewol::Entry(m_file);
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFile);
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFileEnter);
|
||||
m_widgetCurrentFileName->SetExpendX(true);
|
||||
m_widgetCurrentFileName->SetFillX(true);
|
||||
m_widgetCurrentFileName->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFileName);
|
||||
|
||||
m_widgetCheckBox = new ewol::CheckBox("Show hiden files");
|
||||
if (NULL == m_widgetCheckBox) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCheckBox->RegisterOnEvent(this, ewolEventCheckBoxClicked, ewolEventFileChooserHidenFileChange);
|
||||
m_widgetCheckBox->SetValue(false);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCheckBox);
|
||||
}
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
m_widgetValidate = new ewol::Button("Validate");
|
||||
if (NULL == m_widgetValidate) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetValidate->SetImage("icon/Load.svg");
|
||||
m_widgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate);
|
||||
mySizerHori->SubWidgetAdd(m_widgetValidate);
|
||||
}
|
||||
m_widgetCancel = new ewol::Button("Cancel");
|
||||
if (NULL == m_widgetCancel) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCancel->SetImage("icon/Remove.svg");
|
||||
m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCancel);
|
||||
}
|
||||
}
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
m_widgetListFolder = new ListFileSystem();
|
||||
if (NULL == m_widgetListFolder) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetListFolder->SetShowFolder(true);
|
||||
m_widgetListFolder->SetShowFiles(false);
|
||||
m_widgetListFolder->SetShowHiddenFiles(false);
|
||||
@ -142,10 +158,18 @@ ewol::FileChooser::FileChooser(void)
|
||||
m_widgetListFolder->SetExpendY(true);
|
||||
m_widgetListFolder->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(m_widgetListFolder);
|
||||
}
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
m_widgetListFile = new ListFileSystem();
|
||||
if (NULL == m_widgetListFile) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetListFile->SetShowFolder(false);
|
||||
m_widgetListFile->SetShowFiles(true);
|
||||
m_widgetListFile->SetShowHiddenFiles(false);
|
||||
@ -156,28 +180,80 @@ ewol::FileChooser::FileChooser(void)
|
||||
m_widgetListFile->SetExpendY(true);
|
||||
m_widgetListFile->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(m_widgetListFile);
|
||||
}
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
|
||||
}
|
||||
}
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
m_widgetCheckBox = new ewol::CheckBox("Show hiden files");
|
||||
m_widgetCheckBox->RegisterOnEvent(this, ewolEventCheckBoxClicked, ewolEventFileChooserHidenFileChange);
|
||||
m_widgetCheckBox->SetValue(false);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCheckBox);
|
||||
mySpacer = new ewol::Spacer();
|
||||
mySpacer->SetExpendX(true);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
m_widgetValidate = new ewol::Button("Validate");
|
||||
m_widgetValidate->SetImage("icon/Load.svg");
|
||||
m_widgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate);
|
||||
mySizerHori->SubWidgetAdd(m_widgetValidate);
|
||||
m_widgetCancel = new ewol::Button("Cancel");
|
||||
m_widgetCancel->SetImage("icon/Remove.svg");
|
||||
m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCancel);
|
||||
|
||||
myImage = new ewol::Image("icon/File.svg");
|
||||
if (NULL == myImage) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
m_widgetCurrentFileName = new ewol::Entry(m_file);
|
||||
if (NULL == m_widgetCurrentFileName) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFile);
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFileEnter);
|
||||
m_widgetCurrentFileName->SetExpendX(true);
|
||||
m_widgetCurrentFileName->SetFillX(true);
|
||||
m_widgetCurrentFileName->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFileName);
|
||||
}
|
||||
}
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myImage = new ewol::Image("icon/Folder.svg");
|
||||
if (NULL == myImage) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
|
||||
m_widgetCurrentFolder = new ewol::Entry(m_folder);
|
||||
if (NULL == m_widgetCurrentFolder) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFolder);
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFolderEnter);
|
||||
m_widgetCurrentFolder->SetExpendX(true);
|
||||
m_widgetCurrentFolder->SetFillX(true);
|
||||
m_widgetCurrentFolder->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFolder);
|
||||
}
|
||||
myImage = new ewol::Image("icon/Home.svg");
|
||||
if (NULL == myImage) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->RegisterOnEvent(this, ewolEventImagePressed, ewolEventFileChooserHome);
|
||||
myImage->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
}
|
||||
|
||||
m_widgetTitle = new ewol::Label("File chooser ...");
|
||||
if (NULL == m_widgetTitle) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(m_widgetTitle);
|
||||
}
|
||||
}
|
||||
// set the default Folder properties:
|
||||
UpdateCurrentFolder();
|
||||
}
|
||||
|
@ -69,22 +69,28 @@ ewol::Parameter::Parameter(void) :
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
m_widgetTitle = new ewol::Label("File chooser ...");
|
||||
if (NULL == m_widgetTitle) {
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetTitle->SetExpendX(true);
|
||||
mySizerVert->SubWidgetAdd(m_widgetTitle);
|
||||
}
|
||||
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetSize(5);
|
||||
mySpacer->SetColor(0x000000BF);
|
||||
mySizerVert->SubWidgetAdd(mySpacer);
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_widgetCancel = new ewol::Button("Close");
|
||||
if (NULL == m_widgetCancel) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCancel->SetImage("icon/Remove.svg");
|
||||
m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventParameterClose);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCancel);
|
||||
}
|
||||
}
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
@ -114,28 +120,22 @@ ewol::Parameter::Parameter(void) :
|
||||
}
|
||||
}
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
if (NULL == mySizerHori) {
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
|
||||
mySpacer = new ewol::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_widgetCancel = new ewol::Button("Close");
|
||||
if (NULL == m_widgetCancel) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetCancel->SetImage("icon/Remove.svg");
|
||||
m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventParameterClose);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCancel);
|
||||
}
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetSize(5);
|
||||
mySpacer->SetColor(0x000000BF);
|
||||
mySizerVert->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_widgetTitle = new ewol::Label("File chooser ...");
|
||||
if (NULL == m_widgetTitle) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetTitle->SetExpendX(true);
|
||||
mySizerVert->SubWidgetAdd(m_widgetTitle);
|
||||
}
|
||||
}
|
||||
MarkToReedraw();
|
||||
|
Loading…
x
Reference in New Issue
Block a user