X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9379c0d752144826342fa2688a77aa5cccea3d9b..88e183d7693c5272673d109b21e40e1bb525a386:/src/common/toplvcmn.cpp?ds=sidebyside diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 88350bebcf..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, @@ -165,16 +175,16 @@ void wxTopLevelWindowBase::GetRectForTopLevelChildren(int *x, int *y, int *w, in wxSize wxTopLevelWindowBase::GetMaxSize() const { - wxSize size( GetMaxWidth(), GetMaxHeight() ); - int w, h; + wxSize size = wxWindow::GetMaxSize(); - wxClientDisplayRect( 0, 0, &w, &h ); + int w, h; + wxClientDisplayRect(NULL, NULL, &w, &h ); - if( size.GetWidth() == wxDefaultCoord ) - size.SetWidth( w ); + if ( size.GetWidth() == wxDefaultCoord ) + size.SetWidth(w); - if( size.GetHeight() == wxDefaultCoord ) - size.SetHeight( h ); + if ( size.GetHeight() == wxDefaultCoord ) + size.SetHeight(h); return size; }