Spacer: add config size; Sizer: add contamination expend restriction(vert); debug:add the time; Pop-up:add the %of use
This commit is contained in:
parent
4d06072529
commit
5b0170582c
@ -56,16 +56,20 @@ void TOOLS_DisplayFuncName(int32_t ligne, const char* className, const char* fun
|
||||
etk::cout << tmpName;
|
||||
}
|
||||
|
||||
|
||||
void TOOLS_DisplayTime(void)
|
||||
{
|
||||
char tmpdata[50];
|
||||
#ifdef __PLATFORM__Android
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
sprintf(tmpdata, " %2dh %2dmin %2ds | ", (int32_t)(now.tv_sec/3600), (int32_t)(now.tv_sec/60)%60, (int32_t)(now.tv_sec%60));
|
||||
#else
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
char tmpdata[50];
|
||||
|
||||
time(&rawtime);
|
||||
timeinfo = localtime(&rawtime);
|
||||
sprintf(tmpdata, " %2dh %2dmin %2ds | ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
||||
#endif
|
||||
etk::cout << tmpdata ;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ void TOOLS_DisplayTime(void);
|
||||
|
||||
#define ETK_DBG_COMMON(libName, color, info, data) do { \
|
||||
etk::cout << color; \
|
||||
/*TOOLS_DisplayTime();*/ \
|
||||
TOOLS_DisplayTime(); \
|
||||
TOOLS_DisplayFuncName(__LINE__, __class__, __func__, libName); \
|
||||
etk::cout << "[" << info << "] " << data; \
|
||||
etk::cout << ETK_BASH_COLOR_NORMAL <<etk::endl; \
|
||||
|
@ -160,23 +160,24 @@ namespace ewol {
|
||||
bool m_userFillX;
|
||||
bool m_userFillY;
|
||||
public:
|
||||
void SetOrigin(etkFloat_t x, etkFloat_t y) { m_origin.x=x; m_origin.y=y; };
|
||||
coord GetOrigin(void) { return m_origin; };
|
||||
void SetOrigin(etkFloat_t x, etkFloat_t y) { m_origin.x=x; m_origin.y=y; };
|
||||
coord GetOrigin(void) { return m_origin; };
|
||||
virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ...
|
||||
virtual bool CalculateMinSize(void) {m_minSize.x = m_userMinSize.x; m_minSize.y = m_userMinSize.y; return true; }; //update the min Size ... and the expend parameters for the sizer
|
||||
virtual void SetMinSize(etkFloat_t x=-1, etkFloat_t y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; };
|
||||
coord GetMinSize(void) { return m_minSize; };
|
||||
coord GetSize(void) { return m_size; };
|
||||
//update the min Size ... and the expend parameters for the sizer
|
||||
virtual bool CalculateMinSize(void) {m_minSize.x = m_userMinSize.x; m_minSize.y = m_userMinSize.y; return true; };
|
||||
virtual void SetMinSize(etkFloat_t x=-1, etkFloat_t y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; };
|
||||
coord GetMinSize(void) { return m_minSize; };
|
||||
coord GetSize(void) { return m_size; };
|
||||
void SetCurrentSise(etkFloat_t x=-1, etkFloat_t y=-1) { m_size.x = x; m_size.y = y; };
|
||||
coord GetCurrentSize(void) { return m_size; };
|
||||
virtual void SetExpendX(bool newExpend=false) { m_userExpendX = newExpend; };
|
||||
virtual bool CanExpentX(void) { return m_userExpendX; };
|
||||
virtual void SetExpendY(bool newExpend=false) { m_userExpendY = newExpend; };
|
||||
virtual bool CanExpentY(void) { return m_userExpendY; };
|
||||
virtual void SetFillX(bool newFill=false) { m_userFillX = newFill; };
|
||||
bool CanFillX(void) { return m_userFillX; };
|
||||
virtual void SetFillY(bool newFill=false) { m_userFillY = newFill; };
|
||||
bool CanFillY(void) { return m_userFillY; };
|
||||
coord GetCurrentSize(void) { return m_size; };
|
||||
virtual void SetExpendX(bool newExpend=false) { m_userExpendX = newExpend; };
|
||||
virtual bool CanExpentX(void) { return m_userExpendX; };
|
||||
virtual void SetExpendY(bool newExpend=false) { m_userExpendY = newExpend; };
|
||||
virtual bool CanExpentY(void) { return m_userExpendY; };
|
||||
virtual void SetFillX(bool newFill=false) { m_userFillX = newFill; };
|
||||
bool CanFillX(void) { return m_userFillX; };
|
||||
virtual void SetFillY(bool newFill=false) { m_userFillY = newFill; };
|
||||
bool CanFillY(void) { return m_userFillY; };
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
// -- Focus Area
|
||||
|
@ -66,7 +66,7 @@ void ewol::List::OnRegenerateDisplay(void)
|
||||
{
|
||||
// clean the object list ...
|
||||
ClearOObjectList();
|
||||
|
||||
EWOL_DEBUG("OnRegenerateDisplay(" << m_size.x << "," << m_size.y << ")");
|
||||
|
||||
int32_t tmpOriginX = 0;
|
||||
int32_t tmpOriginY = 0;
|
||||
|
@ -70,6 +70,14 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
|
||||
if (true == m_subWidget->CanExpentY()) {
|
||||
subWidgetSize.y = m_size.y;
|
||||
}
|
||||
if (m_displayRatio>0.1 && m_displayRatio<=100) {
|
||||
subWidgetSize.x = etk_max(m_size.x*m_displayRatio, subWidgetSize.x);
|
||||
subWidgetSize.y = etk_max(m_size.y*m_displayRatio, subWidgetSize.y);
|
||||
}
|
||||
// force to be an integer ...
|
||||
subWidgetSize.x = (int32_t)subWidgetSize.x;
|
||||
subWidgetSize.y = (int32_t)subWidgetSize.y;
|
||||
// set config to the Sub-widget
|
||||
subWidgetOrigin.x = (int32_t)(m_size.x - m_origin.x - subWidgetSize.x)/2 + m_origin.x;
|
||||
subWidgetOrigin.y = (int32_t)(m_size.y - m_origin.y - subWidgetSize.y)/2 + m_origin.y;
|
||||
|
||||
@ -179,3 +187,7 @@ bool ewol::PopUp::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etk
|
||||
}
|
||||
|
||||
|
||||
void ewol::PopUp::SetDisplayRatio(etkFloat_t ratio)
|
||||
{
|
||||
m_displayRatio = ratio;
|
||||
}
|
||||
|
@ -41,10 +41,12 @@ namespace ewol {
|
||||
virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1);
|
||||
virtual void SetExpendX(bool newExpend=false);
|
||||
virtual void SetExpendY(bool newExpend=false);
|
||||
void SetDisplayRatio(etkFloat_t ratio);
|
||||
private:
|
||||
color_ts m_colorBackGroung;
|
||||
color_ts m_colorEmptyArea;
|
||||
ewol::Widget* m_subWidget;
|
||||
etkFloat_t m_displayRatio;
|
||||
public:
|
||||
void SubWidgetSet(ewol::Widget* newWidget);
|
||||
void SubWidgetRemove(void);
|
||||
|
@ -78,7 +78,7 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
// Set the origin :
|
||||
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
|
||||
// Now Update his Size his size in X and the curent sizer size in Y:
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
|
@ -34,6 +34,8 @@ ewol::SizerVert::SizerVert(void)
|
||||
{
|
||||
GenericDrawDisable();
|
||||
SpecificDrawEnable();
|
||||
// set contamination enable
|
||||
LockExpendContamination();
|
||||
}
|
||||
|
||||
ewol::SizerVert::~SizerVert(void)
|
||||
@ -133,11 +135,31 @@ void ewol::SizerVert::SetExpendX(bool newExpend)
|
||||
EWOL_ERROR("Sizer can not have a user expend settings X (herited from under elements)");
|
||||
}
|
||||
|
||||
bool ewol::SizerVert::CanExpentX(void)
|
||||
{
|
||||
if (true == m_lockExpendContamination) {
|
||||
return false;
|
||||
}
|
||||
return m_userExpendX;
|
||||
}
|
||||
|
||||
void ewol::SizerVert::SetExpendY(bool newExpend)
|
||||
{
|
||||
EWOL_ERROR("Sizer can not have a user expend settings Y (herited from under elements)");
|
||||
}
|
||||
|
||||
bool ewol::SizerVert::CanExpentY(void)
|
||||
{
|
||||
if (true == m_lockExpendContamination) {
|
||||
return false;
|
||||
}
|
||||
return m_userExpendY;
|
||||
}
|
||||
|
||||
void ewol::SizerVert::LockExpendContamination(bool lockExpend)
|
||||
{
|
||||
m_lockExpendContamination = lockExpend;
|
||||
}
|
||||
|
||||
//etk::VectorType<ewol::Widget*> m_SubWidget;
|
||||
|
||||
|
@ -40,8 +40,12 @@ namespace ewol {
|
||||
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
|
||||
virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1);
|
||||
virtual void SetExpendX(bool newExpend=false);
|
||||
virtual bool CanExpentX(void);
|
||||
virtual void SetExpendY(bool newExpend=false);
|
||||
virtual bool CanExpentY(void);
|
||||
void LockExpendContamination(bool lockExpend=false);
|
||||
private:
|
||||
bool m_lockExpendContamination;
|
||||
etk::VectorType<ewol::Widget*> m_subWidget;
|
||||
public:
|
||||
void SubWidgetRemoveAll(void);
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
ewol::Spacer::Spacer(void)
|
||||
{
|
||||
m_size = 10;
|
||||
GenericDrawDisable();
|
||||
SetCanHaveFocus(false);
|
||||
}
|
||||
@ -45,10 +46,14 @@ ewol::Spacer::~Spacer(void)
|
||||
|
||||
bool ewol::Spacer::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 20;
|
||||
m_minSize.y = 20;
|
||||
m_minSize.x = m_size;
|
||||
m_minSize.y = m_size;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ewol::Spacer::SetSize(etkFloat_t size)
|
||||
{
|
||||
m_size = size;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,9 @@ namespace ewol {
|
||||
Spacer(void);
|
||||
virtual ~Spacer(void);
|
||||
virtual bool CalculateMinSize(void);
|
||||
void SetSize(etkFloat_t size);
|
||||
private:
|
||||
etkFloat_t m_size;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -220,7 +220,10 @@ ewol::FileChooser::FileChooser(void)
|
||||
FileChooserFolderList * myListFolder = NULL;
|
||||
ewol::Label * myLabel = NULL;
|
||||
|
||||
SetDisplayRatio(0.80);
|
||||
|
||||
mySizerVert = new ewol::SizerVert();
|
||||
mySizerVert->LockExpendContamination(true);
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
@ -229,7 +232,7 @@ ewol::FileChooser::FileChooser(void)
|
||||
mySizerVert->SubWidgetAdd(myLabel);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerHori->LockExpendContamination(true);
|
||||
//mySizerHori->LockExpendContamination(true);
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
myButton = new ewol::Button("<-");
|
||||
myButton->ExternLinkOnEvent("ewol Button Pressed", GetWidgetId(), ewolEventFileChooserFolderUp );
|
||||
@ -242,24 +245,32 @@ ewol::FileChooser::FileChooser(void)
|
||||
mySizerHori->SubWidgetAdd(myEntry);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerHori->LockExpendContamination(true);
|
||||
//mySizerHori->LockExpendContamination(true);
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
mySpacer = new ewol::Spacer();
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
myListFolder = new FileChooserFolderList();
|
||||
m_widgetListFolderId = myListFolder->GetWidgetId();
|
||||
//myList->SetExpendX(true);
|
||||
myListFolder->SetExpendY(true);
|
||||
myListFolder->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myListFolder);
|
||||
mySpacer = new ewol::Spacer();
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
myListFile = new FileChooserFileList();
|
||||
m_widgetListFileId = myListFile->GetWidgetId();
|
||||
myListFile->SetExpendY(true);
|
||||
myListFile->SetExpendX(true);
|
||||
myListFile->SetFillX(true);
|
||||
myListFile->SetExpendY(true);
|
||||
myListFile->SetFillY(true);
|
||||
mySizerHori->SubWidgetAdd(myListFile);
|
||||
mySpacer = new ewol::Spacer();
|
||||
mySpacer->SetSize(2);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerHori->LockExpendContamination(true);
|
||||
//mySizerHori->LockExpendContamination(true);
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
mySpacer = new ewol::Spacer();
|
||||
mySpacer->SetExpendX(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user