]> git.saurik.com Git - wxWidgets.git/commitdiff
Set initial window size as its minimal size.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Dec 2009 23:37:36 +0000 (23:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Dec 2009 23:37:36 +0000 (23:37 +0000)
The change of r62306 broke the code which relied on the window created with a
given initial size to never become smaller than this size. This was to be
expected because the best size of such window is now (1, 1) and not its
initial size but we still need to preserve the old behaviour for compatibility
and also because it usually does make sense to avoid shrinking the window with
an explicitly specified initial size beneath this value.

So call SetMinSize() with the initial size explicitly now in wxWindowBase
ctor.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index 30dc0105107312bfbbc2bce5d7e3f97079741f17..2fd67dfa382af5e29081413d118354d1efa7cd2f 100644 (file)
@@ -213,7 +213,7 @@ wxWindowBase::wxWindowBase()
 bool wxWindowBase::CreateBase(wxWindowBase *parent,
                               wxWindowID id,
                               const wxPoint& WXUNUSED(pos),
-                              const wxSize& WXUNUSED(size),
+                              const wxSize& size,
                               long style,
                               const wxString& name)
 {
@@ -239,6 +239,11 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     // flags by updating the window dynamically and we don't need this here
     m_windowStyle = style;
 
+    // assume the user doesn't want this window to shrink beneath its initial
+    // size, this worked like this in wxWidgets 2.8 and before and generally
+    // often makes sense
+    SetMinSize(size);
+
     SetName(name);
     SetParent(parent);