From 49c9d05986415e8f4f2139f112d7a320b48c07e8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 3 May 2007 00:25:46 +0000 Subject: [PATCH] removed unneeded duplication of DoSetSizeHints() in wxTLWBase (as wxWindow version already does the same thing) and made wxTLW::SetMin/MaxSize() implementation less verbose git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/toplevel.h | 5 ----- src/common/toplvcmn.cpp | 21 ++------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 268ecbd4ad..92fcc6b37f 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -252,11 +252,6 @@ public: virtual void SetMinSize(const wxSize& minSize); virtual void SetMaxSize(const wxSize& maxSize); - // set size hints for "window manager" - virtual void DoSetSizeHints( int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, int incH = wxDefaultCoord ); - protected: // the frame client to screen translation should take account of the // toolbar which may shift the origin of the client area diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 428c54dac5..e72953cf7e 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -143,29 +143,12 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const void wxTopLevelWindowBase::SetMinSize(const wxSize& minSize) { - SetSizeHints( minSize.x, minSize.y, GetMaxWidth(), GetMaxHeight() ); + SetSizeHints(minSize, GetMaxSize()); } void wxTopLevelWindowBase::SetMaxSize(const wxSize& maxSize) { - SetSizeHints( GetMinWidth(), GetMinHeight(), maxSize.x, maxSize.y ); -} - -// set the min/max size of the window -void wxTopLevelWindowBase::DoSetSizeHints(int minW, int minH, - int maxW, int maxH, - int WXUNUSED(incW), int WXUNUSED(incH)) -{ - // setting min width greater than max width leads to infinite loops under - // X11 and generally doesn't make any sense, so don't allow it - wxCHECK_RET( (minW == wxDefaultCoord || maxW == wxDefaultCoord || minW <= maxW) && - (minH == wxDefaultCoord || maxH == wxDefaultCoord || minH <= maxH), - _T("min width/height must be less than max width/height!") ); - - m_minWidth = minW; - m_maxWidth = maxW; - m_minHeight = minH; - m_maxHeight = maxH; + SetSizeHints(GetMinSize(), maxSize); } void wxTopLevelWindowBase::GetRectForTopLevelChildren(int *x, int *y, int *w, int *h) -- 2.45.2