]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Use the size value passed to the ctor to set the window's minimum size.
[wxWidgets.git] / src / common / wincmn.cpp
index 14d868fdd87abd108a6914befe705649b1c7685f..465635a87c45bcaed073d7c600bdb5bf87c041e7 100644 (file)
@@ -194,7 +194,7 @@ wxWindowBase::wxWindowBase()
 bool wxWindowBase::CreateBase(wxWindowBase *parent,
                               wxWindowID id,
                               const wxPoint& WXUNUSED(pos),
-                              const wxSize& WXUNUSED(size),
+                              const wxSize& size,
                               long style,
                               const wxValidator& wxVALIDATOR_PARAM(validator),
                               const wxString& name)
@@ -223,6 +223,14 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     SetWindowStyleFlag(style);
     SetParent(parent);
 
+    // Set the minsize to be the size passed to the ctor (if any) for
+    // non-TLWs.  This is so items used in a sizer will use this explicitly
+    // set size for layout, instead of falling back the (probably smaller)
+    // bestsize.
+    if (! IsTopLevel())
+        SetSizeHints(size);
+
+    
 #if wxUSE_VALIDATORS
     SetValidator(validator);
 #endif // wxUSE_VALIDATORS