From: Robert Roebling Date: Mon, 30 Oct 2006 13:25:00 +0000 (+0000) Subject: Moved overridden SetMinSize() to base class. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cda5834e9d51eabc6463da5c301a7b8a3e89d80f Moved overridden SetMinSize() to base class. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 6ebb2001c8..f27e872b6b 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -121,10 +121,6 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); - // a different API for SetSizeHints - virtual void SetMinSize(const wxSize& minSize); - virtual void SetMaxSize(const wxSize& maxSize); - // give hints to the Window Manager for how the size // of the TLW can be changed by dragging virtual void DoSetSizeHints( int minW, int minH, diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index bde3440ec7..933b258595 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -250,6 +250,12 @@ public: virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; protected: + + // a different API for SetSizeHints + 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 ); diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 9e0d6357e5..97821d0d69 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -140,6 +140,16 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const // wxTopLevelWindow geometry // ---------------------------------------------------------------------------- +void wxTopLevelWindowBase::SetMinSize(const wxSize& minSize) +{ + SetSizeHints( minSize.x, minSize.y, GetMaxWidth(), GetMaxHeight() ); +} + +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, diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index a0d2574eb5..85f4b536dd 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -958,16 +958,6 @@ void wxTopLevelWindowGTK::DoSetClientSize( int width, int height ) width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle, 0); } -void wxTopLevelWindowGTK::SetMinSize(const wxSize& minSize) -{ - SetSizeHints( minSize.x, minSize.y, GetMaxWidth(), GetMaxHeight() ); -} - -void wxTopLevelWindowGTK::SetMaxSize(const wxSize& maxSize) -{ - SetSizeHints( GetMinWidth(), GetMinHeight(), maxSize.x, maxSize.y ); -} - void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH )