Add the double-buffering in all needed classes that is already missing
This commit is contained in:
parent
0e651c71ae
commit
8989a3dea0
@ -79,7 +79,7 @@ ewol::Widget::Widget(void)
|
||||
m_needRegenerateDisplay = true;
|
||||
m_currentDrawId = 0;
|
||||
m_currentCreateId = 1;
|
||||
m_needFlipFlop = false;
|
||||
m_needFlipFlop = true;
|
||||
m_origin.x = 0.0;
|
||||
m_origin.y = 0.0;
|
||||
m_size.x = 10.0;
|
||||
@ -202,6 +202,7 @@ void ewol::Widget::DoubleBufferFlipFlop(void)
|
||||
m_currentCreateId = 0;
|
||||
}
|
||||
m_needFlipFlop = false;
|
||||
OnFlipFlopEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,6 +213,7 @@ namespace ewol {
|
||||
bool NeedRedraw(void) { bool tmpData=m_needRegenerateDisplay; m_needRegenerateDisplay=false; return tmpData; };
|
||||
public:
|
||||
void DoubleBufferFlipFlop(void);
|
||||
virtual void OnFlipFlopEvent(void) { /* nothing to do */ };
|
||||
virtual void OnRegenerateDisplay(void) { /* nothing to do */ };
|
||||
bool GenDraw(void);
|
||||
|
||||
|
@ -73,7 +73,7 @@ void ewol::widgetManager::UnInit(void)
|
||||
}
|
||||
}
|
||||
// local acces ==> this control the mutex Lock
|
||||
RemoveAllMarkWidget();
|
||||
ewol::widgetManager::RemoveAllMarkWidget();
|
||||
|
||||
IsInit = false;
|
||||
|
||||
@ -251,6 +251,8 @@ void ewol::widgetManager::GetDoubleBufferFlipFlop(void)
|
||||
}
|
||||
}
|
||||
needRedraw = true;
|
||||
// Remove the deprecated flipFlop elements ...
|
||||
|
||||
pthread_mutex_unlock(&localMutex);
|
||||
}
|
||||
|
||||
@ -319,29 +321,25 @@ void ewol::widgetManager::MarkWidgetToBeRemoved(ewol::Widget * expectedWidget)
|
||||
|
||||
void ewol::widgetManager::RemoveAllMarkWidget(void)
|
||||
{
|
||||
if (IsInit) {
|
||||
pthread_mutex_lock(&localMutex);
|
||||
etk::VectorType<widgetList_ts> m_widgetDeletedList_tmp = m_widgetDeletedList;
|
||||
/*
|
||||
if (m_widgetDeletedList.Size() > 0 ) {
|
||||
EWOL_DEBUG("NB element to remove : " << m_widgetDeletedList.Size());
|
||||
}
|
||||
*/
|
||||
// flip/Flop all the widget registered :
|
||||
for(int32_t iii=0; iii<m_widgetDeletedList_tmp.Size(); iii++) {
|
||||
if (NULL != m_widgetDeletedList_tmp[iii].widgetPointer) {
|
||||
delete(m_widgetDeletedList_tmp[iii].widgetPointer);
|
||||
m_widgetDeletedList_tmp[iii].widgetPointer = NULL;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (m_widgetDeletedList.Size() > 0 ) {
|
||||
EWOL_CRITICAL("Memory leak ==> not all the widget are auto-removed nb = " << m_widgetDeletedList.Size());
|
||||
// in every case clean the list ...
|
||||
m_widgetDeletedList.Clear();
|
||||
}
|
||||
*/
|
||||
pthread_mutex_unlock(&localMutex);
|
||||
etk::VectorType<widgetList_ts> m_widgetDeletedList_tmp = m_widgetDeletedList;
|
||||
/*
|
||||
if (m_widgetDeletedList.Size() > 0 ) {
|
||||
EWOL_DEBUG("NB element to remove : " << m_widgetDeletedList.Size());
|
||||
}
|
||||
*/
|
||||
// flip/Flop all the widget registered :
|
||||
for(int32_t iii=0; iii<m_widgetDeletedList_tmp.Size(); iii++) {
|
||||
if (NULL != m_widgetDeletedList_tmp[iii].widgetPointer) {
|
||||
delete(m_widgetDeletedList_tmp[iii].widgetPointer);
|
||||
m_widgetDeletedList_tmp[iii].widgetPointer = NULL;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (m_widgetDeletedList.Size() > 0 ) {
|
||||
EWOL_CRITICAL("Memory leak ==> not all the widget are auto-removed nb = " << m_widgetDeletedList.Size());
|
||||
// in every case clean the list ...
|
||||
m_widgetDeletedList.Clear();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,9 @@ extern const char * const ewolEventWindowsHideKeyboard = "ewol Windows hideKey
|
||||
ewol::Windows::Windows(void)
|
||||
{
|
||||
SetCanHaveFocus(true);
|
||||
m_subWidget = NULL;
|
||||
for(int32_t iii=0; iii<NB_BOUBLE_BUFFER; iii++) {
|
||||
m_subWidget[iii] = NULL;
|
||||
}
|
||||
m_keyBoardwidget = NULL;
|
||||
SetDecorationDisable();
|
||||
//KeyboardShow(KEYBOARD_MODE_CODE);
|
||||
@ -54,18 +56,18 @@ ewol::Windows::Windows(void)
|
||||
|
||||
ewol::Windows::~Windows(void)
|
||||
{
|
||||
if (NULL != m_subWidget) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget);
|
||||
m_subWidget=NULL;
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId]);
|
||||
m_subWidget[m_currentCreateId]=NULL;
|
||||
}
|
||||
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_popUpWidgetList[iii]);
|
||||
m_popUpWidgetList[iii]=NULL;
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[m_currentCreateId][iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_popUpWidgetList[m_currentCreateId][iii]);
|
||||
m_popUpWidgetList[m_currentCreateId][iii]=NULL;
|
||||
}
|
||||
}
|
||||
m_popUpWidgetList.Clear();
|
||||
m_popUpWidgetList[m_currentCreateId].Clear();
|
||||
|
||||
if (NULL != m_keyBoardwidget) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_keyBoardwidget);
|
||||
@ -75,6 +77,7 @@ ewol::Windows::~Windows(void)
|
||||
|
||||
bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
|
||||
{
|
||||
//EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId);
|
||||
m_size.x = availlableX;
|
||||
m_size.y = availlableY;
|
||||
int32_t keyboardHigh = 0;
|
||||
@ -85,20 +88,18 @@ bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY
|
||||
m_keyBoardwidget->SetOrigin(0, m_size.y - keyboardHigh);
|
||||
m_keyBoardwidget->CalculateSize(m_size.x, keyboardHigh);
|
||||
}
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
m_subWidget[m_currentCreateId]->CalculateMinSize();
|
||||
// TODO : Check if min Size is possible ...
|
||||
// TODO : Herited from MinSize .. and expand ???
|
||||
m_subWidget->CalculateSize(m_size.x, m_size.y - keyboardHigh);
|
||||
m_subWidget[m_currentCreateId]->CalculateSize(m_size.x, m_size.y - keyboardHigh);
|
||||
}
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
m_popUpWidgetList[iii]->CalculateMinSize();
|
||||
m_popUpWidgetList[iii]->CalculateSize(m_size.x, m_size.y - keyboardHigh);
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[m_currentCreateId][iii]) {
|
||||
m_popUpWidgetList[m_currentCreateId][iii]->CalculateMinSize();
|
||||
m_popUpWidgetList[m_currentCreateId][iii]->CalculateSize(m_size.x, m_size.y - keyboardHigh);
|
||||
}
|
||||
}
|
||||
// regenerate all the display ...
|
||||
MarkToReedraw();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -113,15 +114,15 @@ bool ewol::Windows::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, e
|
||||
}
|
||||
}
|
||||
// event go directly on the pop-up
|
||||
if (0 < m_popUpWidgetList.Size()) {
|
||||
if (NULL == m_popUpWidgetList[m_popUpWidgetList.Size()-1]) {
|
||||
m_popUpWidgetList.PopBack();
|
||||
if (0 < m_popUpWidgetList[m_currentCreateId].Size()) {
|
||||
if (NULL == m_popUpWidgetList[m_currentCreateId][m_popUpWidgetList[m_currentCreateId].Size()-1]) {
|
||||
m_popUpWidgetList[m_currentCreateId].PopBack();
|
||||
} else {
|
||||
m_popUpWidgetList[m_popUpWidgetList.Size()-1]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
m_popUpWidgetList[m_currentCreateId][m_popUpWidgetList[m_currentCreateId].Size()-1]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
}
|
||||
// otherwise in the normal windows
|
||||
} else if (NULL != m_subWidget) {
|
||||
m_subWidget->GenEventInput(IdInput, typeEvent, x, y);
|
||||
} else if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
m_subWidget[m_currentCreateId]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -176,15 +177,12 @@ void ewol::Windows::SysDraw(void)
|
||||
|
||||
void ewol::Windows::OnRegenerateDisplay(void)
|
||||
{
|
||||
if (true == NeedRedraw()) {
|
||||
// no decoration ...
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
m_subWidget[m_currentCreateId]->OnRegenerateDisplay();
|
||||
}
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->OnRegenerateDisplay();
|
||||
}
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
m_popUpWidgetList[iii]->OnRegenerateDisplay();
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[m_currentCreateId][iii]) {
|
||||
m_popUpWidgetList[m_currentCreateId][iii]->OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) {
|
||||
@ -195,21 +193,22 @@ void ewol::Windows::OnRegenerateDisplay(void)
|
||||
|
||||
bool ewol::Windows::OnDraw(void)
|
||||
{
|
||||
//EWOL_WARNING(" WINDOWS draw on " << m_currentDrawId);
|
||||
// first display the windows on the display
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->GenDraw();
|
||||
if (NULL != m_subWidget[m_currentDrawId]) {
|
||||
m_subWidget[m_currentDrawId]->GenDraw();
|
||||
//EWOL_DEBUG("Draw Windows");
|
||||
}
|
||||
// second display the pop-up
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
m_popUpWidgetList[iii]->GenDraw();
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList[m_currentDrawId].Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[m_currentDrawId][iii]) {
|
||||
m_popUpWidgetList[m_currentDrawId][iii]->GenDraw();
|
||||
//EWOL_DEBUG("Draw Pop-up");
|
||||
}
|
||||
}
|
||||
if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) {
|
||||
m_keyBoardwidget->GenDraw();
|
||||
//EWOL_DEBUG("Draw Pop-up");
|
||||
//EWOL_DEBUG("Draw kewboard");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -218,33 +217,37 @@ bool ewol::Windows::OnDraw(void)
|
||||
|
||||
void ewol::Windows::SetSubWidget(ewol::Widget * widget)
|
||||
{
|
||||
if (NULL != m_subWidget) {
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
EWOL_INFO("Remove current main windows Widget...");
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget);
|
||||
m_subWidget = NULL;
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId]);
|
||||
m_subWidget[m_currentCreateId] = NULL;
|
||||
}
|
||||
m_subWidget = widget;
|
||||
m_subWidget[m_currentCreateId] = widget;
|
||||
// Regenerate the size calculation :
|
||||
CalculateSize(m_size.x, m_size.y);
|
||||
m_needFlipFlop = true;
|
||||
}
|
||||
|
||||
|
||||
void ewol::Windows::PopUpWidgetPush(ewol::Widget * widget)
|
||||
{
|
||||
m_popUpWidgetList.PushBack(widget);
|
||||
m_popUpWidgetList[m_currentCreateId].PushBack(widget);
|
||||
// Regenerate the size calculation :
|
||||
CalculateSize(m_size.x, m_size.y);
|
||||
m_needFlipFlop = true;
|
||||
}
|
||||
|
||||
void ewol::Windows::PopUpWidgetPop(int32_t popUpId)
|
||||
{
|
||||
if(popUpId >= 0) {
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
if (m_popUpWidgetList[iii]->GetWidgetId() == popUpId) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_popUpWidgetList[iii]);
|
||||
m_popUpWidgetList[iii] = NULL;
|
||||
m_popUpWidgetList.Erase(iii);
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[m_currentCreateId][iii]) {
|
||||
if (m_popUpWidgetList[m_currentCreateId][iii]->GetWidgetId() == popUpId) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_popUpWidgetList[m_currentCreateId][iii]);
|
||||
m_popUpWidgetList[m_currentCreateId][iii] = NULL;
|
||||
m_popUpWidgetList[m_currentCreateId].Erase(iii);
|
||||
m_needFlipFlop = true;
|
||||
CalculateSize(m_size.x, m_size.y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -279,7 +282,6 @@ void ewol::Windows::KeyboardShow(ewol::keyboardMode_te mode)
|
||||
m_keyBoardwidget->Show();
|
||||
}
|
||||
CalculateSize(m_size.x, m_size.y);
|
||||
MarkToReedraw();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -291,5 +293,14 @@ void ewol::Windows::KeyboardHide(void)
|
||||
m_keyBoardwidget->Hide();
|
||||
}
|
||||
CalculateSize(m_size.x, m_size.y);
|
||||
MarkToReedraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ewol::Windows::OnFlipFlopEvent(void)
|
||||
{
|
||||
//EWOL_CRITICAL("FlipFlop on windows draw("<<m_currentDrawId<<") create("<<m_currentCreateId<<")");
|
||||
// keep in the current element all the modification done ...
|
||||
m_subWidget[m_currentCreateId] = m_subWidget[m_currentDrawId];
|
||||
m_popUpWidgetList[m_currentCreateId] = m_popUpWidgetList[m_currentDrawId];
|
||||
}
|
@ -67,8 +67,8 @@ namespace ewol {
|
||||
m_hasDecoration = true;
|
||||
}
|
||||
private:
|
||||
ewol::Widget* m_subWidget;
|
||||
etk::VectorType<ewol::Widget*> m_popUpWidgetList;
|
||||
ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER];
|
||||
etk::VectorType<ewol::Widget*> m_popUpWidgetList[NB_BOUBLE_BUFFER];
|
||||
ewol::Keyboard* m_keyBoardwidget;
|
||||
public:
|
||||
void SetSubWidget(ewol::Widget * widget);
|
||||
@ -81,6 +81,7 @@ namespace ewol {
|
||||
public:
|
||||
void KeyboardShow(ewol::keyboardMode_te mode);
|
||||
void KeyboardHide(void);
|
||||
virtual void OnFlipFlopEvent(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -294,6 +294,7 @@ void EWOL_GenericDraw(bool everyTime)
|
||||
{
|
||||
nbDisplayTime++;
|
||||
gui_uniqueWindows->SysDraw();
|
||||
//EWOL_WARNING("DRAW...");
|
||||
}
|
||||
ewol::widgetManager::GetDoubleBufferStopDraw();
|
||||
// send Message that we just finished a display ...
|
||||
|
@ -59,14 +59,14 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
|
||||
m_size.x = availlableX;
|
||||
m_size.y = availlableY;
|
||||
|
||||
if (NULL != m_subWidget) {
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
coord2D_ts subWidgetSize;
|
||||
coord2D_ts subWidgetOrigin;
|
||||
subWidgetSize = m_subWidget->GetMinSize();
|
||||
if (true == m_subWidget->CanExpentX()) {
|
||||
subWidgetSize = m_subWidget[m_currentCreateId]->GetMinSize();
|
||||
if (true == m_subWidget[m_currentCreateId]->CanExpentX()) {
|
||||
subWidgetSize.x = m_size.x;
|
||||
}
|
||||
if (true == m_subWidget->CanExpentY()) {
|
||||
if (true == m_subWidget[m_currentCreateId]->CanExpentY()) {
|
||||
subWidgetSize.y = m_size.y;
|
||||
}
|
||||
if (m_displayRatio>0.1 && m_displayRatio<=1) {
|
||||
@ -80,8 +80,8 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
|
||||
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;
|
||||
|
||||
m_subWidget->SetOrigin(subWidgetOrigin.x, subWidgetOrigin.y);
|
||||
m_subWidget->CalculateSize(subWidgetSize.x, subWidgetSize.y);
|
||||
m_subWidget[m_currentCreateId]->SetOrigin(subWidgetOrigin.x, subWidgetOrigin.y);
|
||||
m_subWidget[m_currentCreateId]->CalculateSize(subWidgetSize.x, subWidgetSize.y);
|
||||
}
|
||||
MarkToReedraw();
|
||||
return true;
|
||||
@ -95,9 +95,9 @@ bool ewol::PopUp::CalculateMinSize(void)
|
||||
m_userExpendY=false;
|
||||
m_minSize.x = 50.0;
|
||||
m_minSize.y = 50.0;
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
coord2D_ts tmpSize = m_subWidget->GetMinSize();
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
m_subWidget[m_currentCreateId]->CalculateMinSize();
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetMinSize();
|
||||
m_minSize.x = tmpSize.x;
|
||||
m_minSize.y = tmpSize.y;
|
||||
}
|
||||
@ -127,16 +127,16 @@ void ewol::PopUp::SubWidgetSet(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
m_subWidget = newWidget;
|
||||
m_subWidget[m_currentCreateId] = newWidget;
|
||||
newWidget->SetParrent(this);
|
||||
}
|
||||
|
||||
|
||||
void ewol::PopUp::SubWidgetRemove(void)
|
||||
{
|
||||
if (NULL != m_subWidget) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget);
|
||||
m_subWidget = NULL;
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId]);
|
||||
m_subWidget[m_currentCreateId] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,8 +144,8 @@ bool ewol::PopUp::OnDraw(void)
|
||||
{
|
||||
// draw upper classes
|
||||
ewol::Drawable::OnDraw();
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->GenDraw();
|
||||
if (NULL != m_subWidget[m_currentDrawId]) {
|
||||
m_subWidget[m_currentDrawId]->GenDraw();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -163,27 +163,27 @@ void ewol::PopUp::OnRegenerateDisplay(void)
|
||||
BGOObjects->SetColor(m_colorEmptyArea);
|
||||
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
|
||||
// set the area in white ...
|
||||
if (NULL != m_subWidget) {
|
||||
coord2D_ts tmpSize = m_subWidget->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
|
||||
BGOObjects->SetColor(m_colorBackGroung);
|
||||
BGOObjects->Rectangle(tmpOrigin.x, tmpOrigin.y, tmpSize.x, tmpSize.y);
|
||||
}
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->OnRegenerateDisplay();
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
m_subWidget[m_currentCreateId]->OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ewol::PopUp::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
if (NULL != m_subWidget) {
|
||||
coord2D_ts tmpSize = m_subWidget->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
|
||||
if (NULL != m_subWidget[m_currentCreateId]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
|
||||
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
|
||||
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
|
||||
{
|
||||
return m_subWidget->GenEventInput(IdInput, typeEvent, x, y);
|
||||
return m_subWidget[m_currentCreateId]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
} else {
|
||||
//EWOL_INFO("Event ouside the Pop-up");
|
||||
}
|
||||
@ -197,3 +197,11 @@ void ewol::PopUp::SetDisplayRatio(etkFloat_t ratio)
|
||||
{
|
||||
m_displayRatio = ratio;
|
||||
}
|
||||
|
||||
|
||||
void ewol::PopUp::OnFlipFlopEvent(void)
|
||||
{
|
||||
// keep in the current element all the modification done ...
|
||||
m_subWidget[m_currentCreateId] = m_subWidget[m_currentDrawId];
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace ewol {
|
||||
private:
|
||||
color_ts m_colorBackGroung;
|
||||
color_ts m_colorEmptyArea;
|
||||
ewol::Widget* m_subWidget;
|
||||
ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER];
|
||||
etkFloat_t m_displayRatio;
|
||||
public:
|
||||
void SubWidgetSet(ewol::Widget* newWidget);
|
||||
@ -57,6 +57,7 @@ namespace ewol {
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
virtual void OnFlipFlopEvent(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -51,11 +51,11 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
etkFloat_t unexpendableSize=0.0;
|
||||
int32_t nbWidgetFixedSize=0;
|
||||
int32_t nbWidgetNotFixedSize=0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
unexpendableSize += tmpSize.x;
|
||||
if (false == m_subWidget[iii]->CanExpentX()) {
|
||||
if (false == m_subWidget[m_currentCreateId][iii]->CanExpentX()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
nbWidgetNotFixedSize++;
|
||||
@ -73,18 +73,18 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
coord2D_ts tmpOrigin;
|
||||
tmpOrigin.x = 0;
|
||||
tmpOrigin.y = 0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
// Set the origin :
|
||||
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
|
||||
m_subWidget[m_currentCreateId][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()) {
|
||||
m_subWidget[iii]->CalculateSize(tmpSize.x+sizeToAddAtEveryOne, m_size.y);
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentX()) {
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateSize(tmpSize.x+sizeToAddAtEveryOne, m_size.y);
|
||||
tmpOrigin.x += tmpSize.x+sizeToAddAtEveryOne;
|
||||
} else {
|
||||
m_subWidget[iii]->CalculateSize(tmpSize.x, m_size.y);
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateSize(tmpSize.x, m_size.y);
|
||||
tmpOrigin.x += tmpSize.x;
|
||||
}
|
||||
}
|
||||
@ -101,16 +101,16 @@ bool ewol::SizerHori::CalculateMinSize(void)
|
||||
m_userExpendY=false;
|
||||
m_minSize.x = 0.0;
|
||||
m_minSize.y = 0.0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateMinSize();
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentX()) {
|
||||
m_userExpendX = true;
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpentY()) {
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
|
||||
m_userExpendY = true;
|
||||
}
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
m_minSize.x += tmpSize.x;
|
||||
if (tmpSize.y>m_minSize.y) {
|
||||
m_minSize.y = tmpSize.y;
|
||||
@ -158,17 +158,17 @@ void ewol::SizerHori::LockExpendContamination(bool lockExpend)
|
||||
m_lockExpendContamination = lockExpend;
|
||||
}
|
||||
|
||||
//etk::VectorType<ewol::Widget*> m_SubWidget;
|
||||
//etk::VectorType<ewol::Widget*> m_subWidget[m_currentCreateId];
|
||||
|
||||
void ewol::SizerHori::SubWidgetRemoveAll(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[iii]);
|
||||
m_subWidget[iii] = NULL;
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId][iii]);
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
}
|
||||
}
|
||||
m_subWidget.Clear();
|
||||
m_subWidget[m_currentCreateId].Clear();
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ void ewol::SizerHori::SubWidgetAdd(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
m_subWidget.PushBack(newWidget);
|
||||
m_subWidget[m_currentCreateId].PushBack(newWidget);
|
||||
newWidget->SetParrent(this);
|
||||
}
|
||||
|
||||
@ -187,13 +187,13 @@ void ewol::SizerHori::SubWidgetRemove(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (newWidget == m_subWidget[iii]) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[iii]);
|
||||
m_subWidget[iii] = NULL;
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (newWidget == m_subWidget[m_currentCreateId][iii]) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId][iii]);
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
}
|
||||
m_subWidget.Erase(iii);
|
||||
m_subWidget[m_currentCreateId].Erase(iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -204,10 +204,10 @@ void ewol::SizerHori::SubWidgetUnLink(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (newWidget == m_subWidget[iii]) {
|
||||
m_subWidget[iii] = NULL;
|
||||
m_subWidget.Erase(iii);
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (newWidget == m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
m_subWidget[m_currentCreateId].Erase(iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -216,9 +216,9 @@ void ewol::SizerHori::SubWidgetUnLink(ewol::Widget* newWidget)
|
||||
|
||||
bool ewol::SizerHori::OnDraw(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->GenDraw();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentDrawId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentDrawId][iii]) {
|
||||
m_subWidget[m_currentDrawId][iii]->GenDraw();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -227,9 +227,9 @@ bool ewol::SizerHori::OnDraw(void)
|
||||
|
||||
void ewol::SizerHori::OnRegenerateDisplay(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->OnRegenerateDisplay();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii]->OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -237,14 +237,14 @@ void ewol::SizerHori::OnRegenerateDisplay(void)
|
||||
|
||||
bool ewol::SizerHori::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[iii]->GetOrigin();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
|
||||
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
|
||||
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
|
||||
{
|
||||
return m_subWidget[iii]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
return m_subWidget[m_currentCreateId][iii]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -252,3 +252,10 @@ bool ewol::SizerHori::OnEventInput(int32_t IdInput, eventInputType_te typeEvent,
|
||||
}
|
||||
|
||||
|
||||
void ewol::SizerHori::OnFlipFlopEvent(void)
|
||||
{
|
||||
// keep in the current element all the modification done ...
|
||||
m_subWidget[m_currentCreateId] = m_subWidget[m_currentDrawId];
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace ewol {
|
||||
void LockExpendContamination(bool lockExpend=false);
|
||||
private:
|
||||
bool m_lockExpendContamination;
|
||||
etk::VectorType<ewol::Widget*> m_subWidget;
|
||||
etk::VectorType<ewol::Widget*> m_subWidget[NB_BOUBLE_BUFFER];
|
||||
public:
|
||||
virtual void SubWidgetRemoveAll(void);
|
||||
virtual void SubWidgetAdd(ewol::Widget* newWidget);
|
||||
@ -57,6 +57,7 @@ namespace ewol {
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
virtual void OnFlipFlopEvent(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -52,11 +52,11 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
etkFloat_t unexpendableSize=0.0;
|
||||
int32_t nbWidgetFixedSize=0;
|
||||
int32_t nbWidgetNotFixedSize=0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
unexpendableSize += tmpSize.y;
|
||||
if (false == m_subWidget[iii]->CanExpentY()) {
|
||||
if (false == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
nbWidgetNotFixedSize++;
|
||||
@ -75,18 +75,18 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
coord2D_ts tmpOrigin;
|
||||
tmpOrigin.x = 0;
|
||||
tmpOrigin.y = 0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
// Set the origin :
|
||||
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
|
||||
m_subWidget[m_currentCreateId][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]->CanExpentY()) {
|
||||
m_subWidget[iii]->CalculateSize(m_size.x, tmpSize.y+sizeToAddAtEveryOne);
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateSize(m_size.x, tmpSize.y+sizeToAddAtEveryOne);
|
||||
tmpOrigin.y += tmpSize.y+sizeToAddAtEveryOne;
|
||||
} else {
|
||||
m_subWidget[iii]->CalculateSize(m_size.x, tmpSize.y);
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateSize(m_size.x, tmpSize.y);
|
||||
tmpOrigin.y += tmpSize.y;
|
||||
}
|
||||
}
|
||||
@ -103,16 +103,16 @@ bool ewol::SizerVert::CalculateMinSize(void)
|
||||
m_userExpendY=false;
|
||||
m_minSize.x = 0.0;
|
||||
m_minSize.y = 0.0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii]->CalculateMinSize();
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentX()) {
|
||||
m_userExpendX = true;
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpentY()) {
|
||||
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
|
||||
m_userExpendY = true;
|
||||
}
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
|
||||
//EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")");
|
||||
m_minSize.y += tmpSize.y;
|
||||
if (tmpSize.x>m_minSize.x) {
|
||||
@ -165,11 +165,11 @@ void ewol::SizerVert::LockExpendContamination(bool lockExpend)
|
||||
|
||||
void ewol::SizerVert::SubWidgetRemoveAll(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[iii]);
|
||||
m_subWidget[iii] = NULL;
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId][iii]);
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
}
|
||||
m_subWidget.Clear();
|
||||
m_subWidget[m_currentCreateId].Clear();
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ void ewol::SizerVert::SubWidgetAdd(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
m_subWidget.PushBack(newWidget);
|
||||
m_subWidget[m_currentCreateId].PushBack(newWidget);
|
||||
newWidget->SetParrent(this);
|
||||
}
|
||||
|
||||
@ -188,11 +188,11 @@ void ewol::SizerVert::SubWidgetRemove(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (newWidget == m_subWidget[iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[iii]);
|
||||
m_subWidget[iii] = NULL;
|
||||
m_subWidget.Erase(iii);
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (newWidget == m_subWidget[m_currentCreateId][iii]) {
|
||||
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget[m_currentCreateId][iii]);
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
m_subWidget[m_currentCreateId].Erase(iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -203,10 +203,10 @@ void ewol::SizerVert::SubWidgetUnLink(ewol::Widget* newWidget)
|
||||
if (NULL == newWidget) {
|
||||
return;
|
||||
}
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (newWidget == m_subWidget[iii]) {
|
||||
m_subWidget[iii] = NULL;
|
||||
m_subWidget.Erase(iii);
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (newWidget == m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii] = NULL;
|
||||
m_subWidget[m_currentCreateId].Erase(iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -215,9 +215,9 @@ void ewol::SizerVert::SubWidgetUnLink(ewol::Widget* newWidget)
|
||||
|
||||
bool ewol::SizerVert::OnDraw(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->GenDraw();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentDrawId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentDrawId][iii]) {
|
||||
m_subWidget[m_currentDrawId][iii]->GenDraw();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -227,9 +227,9 @@ bool ewol::SizerVert::OnDraw(void)
|
||||
|
||||
void ewol::SizerVert::OnRegenerateDisplay(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->OnRegenerateDisplay();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
m_subWidget[m_currentCreateId][iii]->OnRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -237,17 +237,23 @@ void ewol::SizerVert::OnRegenerateDisplay(void)
|
||||
|
||||
bool ewol::SizerVert::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[iii]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[iii]->GetOrigin();
|
||||
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
if (NULL != m_subWidget[m_currentCreateId][iii]) {
|
||||
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
|
||||
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
|
||||
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
|
||||
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
|
||||
{
|
||||
return m_subWidget[iii]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
return m_subWidget[m_currentCreateId][iii]->GenEventInput(IdInput, typeEvent, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ewol::SizerVert::OnFlipFlopEvent(void)
|
||||
{
|
||||
// keep in the current element all the modification done ...
|
||||
m_subWidget[m_currentCreateId] = m_subWidget[m_currentDrawId];
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace ewol {
|
||||
void LockExpendContamination(bool lockExpend=false);
|
||||
private:
|
||||
bool m_lockExpendContamination;
|
||||
etk::VectorType<ewol::Widget*> m_subWidget;
|
||||
etk::VectorType<ewol::Widget*> m_subWidget[NB_BOUBLE_BUFFER];
|
||||
public:
|
||||
virtual void SubWidgetRemoveAll(void);
|
||||
virtual void SubWidgetAdd(ewol::Widget* newWidget);
|
||||
@ -58,6 +58,7 @@ namespace ewol {
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
virtual void OnFlipFlopEvent(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -118,10 +118,10 @@ class FileChooserFolderList : public ewol::List
|
||||
|
||||
virtual color_ts GetBasicBG(void) {
|
||||
color_ts bg;
|
||||
bg.red = 1.0;
|
||||
bg.red = 0.0;
|
||||
bg.green = 0.0;
|
||||
bg.blue = 0.0;
|
||||
bg.alpha = 1.0;
|
||||
bg.alpha = 0.2;
|
||||
return bg;
|
||||
}
|
||||
|
||||
@ -217,10 +217,10 @@ class FileChooserFileList : public ewol::List
|
||||
};
|
||||
virtual color_ts GetBasicBG(void) {
|
||||
color_ts bg;
|
||||
bg.red = 1.0;
|
||||
bg.red = 0.0;
|
||||
bg.green = 0.0;
|
||||
bg.blue = 0.0;
|
||||
bg.alpha = 1.0;
|
||||
bg.alpha = 0.2;
|
||||
return bg;
|
||||
}
|
||||
void AddElement(etk::UString element)
|
||||
|
Loading…
x
Reference in New Issue
Block a user