Use the size value passed to the ctor to set the window's minimum size.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -194,7 +194,7 @@ wxWindowBase::wxWindowBase()
|
|||||||
bool wxWindowBase::CreateBase(wxWindowBase *parent,
|
bool wxWindowBase::CreateBase(wxWindowBase *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& WXUNUSED(pos),
|
const wxPoint& WXUNUSED(pos),
|
||||||
const wxSize& WXUNUSED(size),
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
const wxValidator& wxVALIDATOR_PARAM(validator),
|
const wxValidator& wxVALIDATOR_PARAM(validator),
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
@@ -223,6 +223,14 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
|
|||||||
SetWindowStyleFlag(style);
|
SetWindowStyleFlag(style);
|
||||||
SetParent(parent);
|
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
|
#if wxUSE_VALIDATORS
|
||||||
SetValidator(validator);
|
SetValidator(validator);
|
||||||
#endif // wxUSE_VALIDATORS
|
#endif // wxUSE_VALIDATORS
|
||||||
|
Reference in New Issue
Block a user