// 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,
+ 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 wxTopLevelWindowBase::GetRectForTopLevelChildren(int *x, int *y, int *w, int *h)
{
GetPosition(x,y);
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;
}