added wxSIZE_FORCE flag for SetSize()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-08-11 13:21:45 +00:00
parent 749870835d
commit 952f2aaa86
3 changed files with 16 additions and 5 deletions

View File

@@ -3133,16 +3133,20 @@ value should be used.}
\docparam{sizeFlags}{Indicates the interpretation of other parameters. It is a bit list of the following: \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.\\ 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.\\ a wxWidgets-supplied default width.\\
{\bf wxSIZE\_AUTO}: -1 size values are taken to indicate {\bf wxSIZE\_AUTO}: -1 size values are taken to indicate
a wxWidgets-supplied default size.\\ a wxWidgets-supplied default size.\\
{\bf wxSIZE\_USE\_EXISTING}: existing dimensions should be used {\bf wxSIZE\_USE\_EXISTING}: existing dimensions should be used
if -1 values are supplied.\\ 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. 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} \wxheading{Remarks}

View File

@@ -1802,6 +1802,11 @@ enum wxHitTest
/* Don't do parent client adjustments (for implementation only) */ /* Don't do parent client adjustments (for implementation only) */
#define wxSIZE_NO_ADJUSTMENTS 0x0008 #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 */ /* GDI descriptions */
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */

View File

@@ -1646,9 +1646,11 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
GetPosition(&currentX, &currentY); GetPosition(&currentX, &currentY);
GetSize(&currentW, &currentH); GetSize(&currentW, &currentH);
// ... 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 && if ( x == currentX && y == currentY &&
width == currentW && height == currentH ) width == currentW && height == currentH &&
!(sizeFlags & wxSIZE_FORCE) )
{ {
return; return;
} }