From 1ba8901f74b7a8391c81fc9328e9689bf7d60f95 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Wed, 8 Feb 2012 18:06:28 +0100 Subject: [PATCH] Correction of the windows resize --- Sources/libewol/ewol/Widget.cpp | 1 + Sources/libewol/ewol/Widget.h | 4 +-- Sources/libewol/ewol/base/guiX11.cpp | 30 ++++++++++++++++++++ Sources/libewol/ewol/widget/Button.cpp | 3 +- Sources/libewol/ewol/widget/CheckBox.cpp | 3 +- Sources/libewol/ewol/widget/Entry.cpp | 2 +- Sources/libewol/ewol/widget/Label.cpp | 1 + Sources/libewol/ewol/widget/PopUp.cpp | 2 ++ Sources/libewol/ewol/widgetMeta/StdPopUp.cpp | 14 ++++----- 9 files changed, 48 insertions(+), 12 deletions(-) diff --git a/Sources/libewol/ewol/Widget.cpp b/Sources/libewol/ewol/Widget.cpp index eccb65e7..3044cc56 100644 --- a/Sources/libewol/ewol/Widget.cpp +++ b/Sources/libewol/ewol/Widget.cpp @@ -116,6 +116,7 @@ bool ewol::Widget::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) { m_size.x = availlableX; m_size.y = availlableY; + MarkToReedraw(); return true; } diff --git a/Sources/libewol/ewol/Widget.h b/Sources/libewol/ewol/Widget.h index 95a184bc..39b98c5d 100644 --- a/Sources/libewol/ewol/Widget.h +++ b/Sources/libewol/ewol/Widget.h @@ -186,11 +186,11 @@ 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; }; + 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 ... //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 bool CalculateMinSize(void) {m_minSize.x = m_userMinSize.x; m_minSize.y = m_userMinSize.y; MarkToReedraw(); 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; }; diff --git a/Sources/libewol/ewol/base/guiX11.cpp b/Sources/libewol/ewol/base/guiX11.cpp index bdd83fc4..ad5878ed 100644 --- a/Sources/libewol/ewol/base/guiX11.cpp +++ b/Sources/libewol/ewol/base/guiX11.cpp @@ -389,6 +389,36 @@ void X11_Run(void) } } break; + case Expose: + EWOL_DEBUG("X11 event Expose"); + break; + case GraphicsExpose: + EWOL_DEBUG("X11 event GraphicsExpose"); + break; + case NoExpose: + EWOL_DEBUG("X11 event NoExpose"); + break; + case CreateNotify: + EWOL_DEBUG("X11 event CreateNotify"); + break; + case DestroyNotify: + EWOL_DEBUG("X11 event DestroyNotify"); + break; + case GravityNotify: + EWOL_DEBUG("X11 event GravityNotify"); + break; + case VisibilityNotify: + EWOL_DEBUG("X11 event VisibilityNotify"); + break; + case CirculateNotify: + EWOL_DEBUG("X11 event CirculateNotify"); + break; + case ReparentNotify: + EWOL_DEBUG("X11 event ReparentNotify"); + break; + case PropertyNotify: + EWOL_DEBUG("X11 event PropertyNotify"); + break; case ConfigureNotify: m_originX = event.xconfigure.x; m_originY = event.xconfigure.y; diff --git a/Sources/libewol/ewol/widget/Button.cpp b/Sources/libewol/ewol/widget/Button.cpp index 1d8fe474..3f762802 100644 --- a/Sources/libewol/ewol/widget/Button.cpp +++ b/Sources/libewol/ewol/widget/Button.cpp @@ -81,6 +81,7 @@ bool ewol::Button::CalculateMinSize(void) int32_t minHeight = ewol::GetHeight(fontId); m_minSize.x = 16+minWidth; m_minSize.y = 16+minHeight; + MarkToReedraw(); return true; } @@ -155,7 +156,7 @@ void ewol::Button::OnRegenerateDisplay(void) bool ewol::Button::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) { - EWOL_DEBUG("Event on BT ..."); + //EWOL_DEBUG("Event on BT ..."); if (1 == IdInput) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { // nothing to do ... diff --git a/Sources/libewol/ewol/widget/CheckBox.cpp b/Sources/libewol/ewol/widget/CheckBox.cpp index 058aa593..e57b7cd1 100644 --- a/Sources/libewol/ewol/widget/CheckBox.cpp +++ b/Sources/libewol/ewol/widget/CheckBox.cpp @@ -77,6 +77,7 @@ bool ewol::CheckBox::CalculateMinSize(void) etkFloat_t boxSize = etk_max(20, minHeight) + 5; m_minSize.x = boxSize+minWidth; m_minSize.y = etk_max(boxSize, minHeight)+3; + MarkToReedraw(); return true; } @@ -138,7 +139,7 @@ void ewol::CheckBox::OnRegenerateDisplay(void) bool ewol::CheckBox::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) { - EWOL_DEBUG("Event on checkbox ..."); + //EWOL_DEBUG("Event on checkbox ..."); if (1 == IdInput) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { if(true == m_value) { diff --git a/Sources/libewol/ewol/widget/Entry.cpp b/Sources/libewol/ewol/widget/Entry.cpp index af5b95d5..6ea88ec8 100644 --- a/Sources/libewol/ewol/widget/Entry.cpp +++ b/Sources/libewol/ewol/widget/Entry.cpp @@ -160,7 +160,7 @@ void ewol::Entry::OnRegenerateDisplay(void) bool ewol::Entry::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) { - EWOL_DEBUG("Event on Entry ..."); + //EWOL_DEBUG("Event on Entry ..."); if (1 == IdInput) { if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) { // nothing to do ... diff --git a/Sources/libewol/ewol/widget/Label.cpp b/Sources/libewol/ewol/widget/Label.cpp index da3c201a..edfe4a8e 100644 --- a/Sources/libewol/ewol/widget/Label.cpp +++ b/Sources/libewol/ewol/widget/Label.cpp @@ -71,6 +71,7 @@ bool ewol::Label::CalculateMinSize(void) int32_t minHeight = ewol::GetHeight(fontId); m_minSize.x = 3+minWidth; m_minSize.y = 3+minHeight; + MarkToReedraw(); return true; } diff --git a/Sources/libewol/ewol/widget/PopUp.cpp b/Sources/libewol/ewol/widget/PopUp.cpp index 620ef3e7..f6955239 100644 --- a/Sources/libewol/ewol/widget/PopUp.cpp +++ b/Sources/libewol/ewol/widget/PopUp.cpp @@ -91,6 +91,7 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::PopUp::CalculateMinSize(void) { + //EWOL_DEBUG("CalculateMinSize"); m_userExpendX=false; m_userExpendY=false; m_minSize.x = 50.0; @@ -102,6 +103,7 @@ bool ewol::PopUp::CalculateMinSize(void) m_minSize.y = tmpSize.y; } //EWOL_DEBUG("CalculateMinSize(" << m_minSize.x << "," << m_minSize.y << ")"); + MarkToReedraw(); return true; } diff --git a/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp b/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp index d5a4837f..6be848ab 100644 --- a/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp +++ b/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp @@ -44,7 +44,7 @@ extern const char * const ewolEventFileStdPopUpButton3 = "ewol event std_pop_up extern const char * const ewolEventFileStdPopUpButton4 = "ewol event std_pop_up BT4"; -ewol::FileChooser::FileChooser(void) +ewol::StdPopUp::StdPopUp(void) { AddEventId(ewolEventFileStdPopUpCancel); AddEventId(ewolEventFileStdPopUpValidate); @@ -122,13 +122,13 @@ ewol::FileChooser::FileChooser(void) } -ewol::FileChooser::~FileChooser(void) +ewol::StdPopUp::~StdPopUp(void) { } -void ewol::FileChooser::SetTitle(etk::String label) +void ewol::StdPopUp::SetTitle(etk::String label) { ewol::Label * tmpWidget = (ewol::Label*)ewol::widgetManager::Get(m_widgetTitleId); if (NULL == tmpWidget) { @@ -137,7 +137,7 @@ void ewol::FileChooser::SetTitle(etk::String label) tmpWidget->SetLabel(label); } -void ewol::FileChooser::SetValidateLabel(etk::String label) +void ewol::StdPopUp::SetValidateLabel(etk::String label) { ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetValidateId); if (NULL == tmpWidget) { @@ -146,7 +146,7 @@ void ewol::FileChooser::SetValidateLabel(etk::String label) tmpWidget->SetLabel(label); } -void ewol::FileChooser::SetCancelLabel(etk::String label) +void ewol::StdPopUp::SetCancelLabel(etk::String label) { ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetCancelId); if (NULL == tmpWidget) { @@ -155,14 +155,14 @@ void ewol::FileChooser::SetCancelLabel(etk::String label) tmpWidget->SetLabel(label); } -void ewol::FileChooser::SetFolder(etk::String folder) +void ewol::StdPopUp::SetFolder(etk::String folder) { m_folder = folder; } -bool ewol::FileChooser::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y) +bool ewol::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y) { EWOL_INFO("Receive Event from the BT ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> internalEvent=\"" << eventExternId << "\"" ); if (ewolEventFileChooserCancel == eventExternId) {