X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/449090b54d2e74bfd28c217bab25d11764ca38cc..c77eea28f955e9c5e59d952594ccc5e96de1597e:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 44b93da89d..f67a25267f 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -580,7 +580,7 @@ wxSize wxWindowBase::DoGetBestSize() const } -wxSize wxWindowBase::GetBestFittingSize() const +wxSize wxWindowBase::GetEffectiveMinSize() const { // merge the best size with the min size, giving priority to the min size wxSize min = GetMinSize(); @@ -594,14 +594,14 @@ wxSize wxWindowBase::GetBestFittingSize() const } -void wxWindowBase::SetBestFittingSize(const wxSize& size) +void wxWindowBase::SetInitialSize(const wxSize& size) { // Set the min size to the size passed in. This will usually either be // wxDefaultSize or the size passed to this window's ctor/Create function. SetMinSize(size); // Merge the size with the best size if needed - wxSize best = GetBestFittingSize(); + wxSize best = GetEffectiveMinSize(); // If the current size doesn't match then change it if (GetSize() != best) @@ -615,23 +615,6 @@ wxPoint wxWindowBase::GetClientAreaOrigin() const return wxPoint(0,0); } -// set the min/max size of the window -void wxWindowBase::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; -} - void wxWindowBase::SetWindowVariant( wxWindowVariant variant ) { if ( m_windowVariant != variant ) @@ -677,6 +660,21 @@ void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant ) SetFont(font); } +void wxWindowBase::DoSetSizeHints( int minW, int minH, + int maxW, int maxH, + int WXUNUSED(incW), int WXUNUSED(incH) ) +{ + 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; +} + + void wxWindowBase::SetVirtualSizeHints( int minW, int minH, int maxW, int maxH ) { @@ -1040,7 +1038,7 @@ bool wxWindowBase::SetCursor(const wxCursor& cursor) { // setting an invalid cursor is ok, it means that we don't have any special // cursor - if ( m_cursor == cursor ) + if ( m_cursor.IsSameAs(cursor) ) { // no change return false;