From 952f2aaa86db53c587a265485791b06afcc1e903 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 Aug 2005 13:21:45 +0000 Subject: [PATCH] added wxSIZE_FORCE flag for SetSize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/window.tex | 10 +++++++--- include/wx/defs.h | 5 +++++ src/msw/window.cpp | 6 ++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 7fdb71cc7f..5e6a220f58 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -3133,16 +3133,20 @@ value should be used.} \docparam{sizeFlags}{Indicates the interpretation of other parameters. It is a bit list of the following: -{\bf wxSIZE\_AUTO\_WIDTH}: a -1 width value is taken to indicate +{\bf wxSIZE\_AUTO\_WIDTH}: a $-1$ width value is taken to indicate a wxWidgets-supplied default width.\\ -{\bf wxSIZE\_AUTO\_HEIGHT}: a -1 height value is taken to indicate +{\bf wxSIZE\_AUTO\_HEIGHT}: a $-1$ height value is taken to indicate a wxWidgets-supplied default width.\\ {\bf wxSIZE\_AUTO}: -1 size values are taken to indicate a wxWidgets-supplied default size.\\ {\bf wxSIZE\_USE\_EXISTING}: existing dimensions should be used if -1 values are supplied.\\ -{\bf wxSIZE\_ALLOW\_MINUS\_ONE}: allow dimensions of -1 and less to be interpreted +{\bf wxSIZE\_ALLOW\_MINUS\_ONE}: allow dimensions of $-1$ and less to be interpreted as real dimensions, not default values. +{\bf wxSIZE\_FORCE}: normally, if the position and the size of the window are +already the same as the parameters of this function, nothing is done. but with +this flag a window resize may be forced even in this case (supported in wx +2.6.2 and later and only implemented for MSW and ignored elsewhere currently) } \wxheading{Remarks} diff --git a/include/wx/defs.h b/include/wx/defs.h index 3bf1cd275e..ba94f1e066 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1802,6 +1802,11 @@ enum wxHitTest /* Don't do parent client adjustments (for implementation only) */ #define wxSIZE_NO_ADJUSTMENTS 0x0008 +#if wxABI_VERSION >= 20602 +/* Change the window position even if it seems to be already correct */ +#define wxSIZE_FORCE 0x0010 +#endif // 2.6.2+ + /* ---------------------------------------------------------------------------- */ /* GDI descriptions */ /* ---------------------------------------------------------------------------- */ diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e01ee082b2..50f56cd2a7 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1646,9 +1646,11 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags) GetPosition(¤tX, ¤tY); GetSize(¤tW, ¤tH); - // ... and don't do anything (avoiding flicker) if it's already ok + // ... and don't do anything (avoiding flicker) if it's already ok unless + // we're forced to resize the window if ( x == currentX && y == currentY && - width == currentW && height == currentH ) + width == currentW && height == currentH && + !(sizeFlags & wxSIZE_FORCE) ) { return; } -- 2.47.2