From 032e024c1c6ab6a20226604baab9d00558620e72 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Dec 2009 23:37:36 +0000 Subject: [PATCH] Set initial window size as its minimal size. 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 30dc010510..2fd67dfa38 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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); -- 2.45.2