- // Override this method to control the values given to Sizers etc.
- virtual wxSize GetMaxSize() const { return wxSize( m_maxWidth, m_maxHeight ); }
- virtual wxSize GetMinSize() const { return wxSize( m_minWidth, m_minHeight ); }
+ // Call these to override what GetBestSize() returns. This
+ // method is only virtual because it is overriden in wxTLW
+ // as a different API for SetSizeHints().
+ virtual void SetMinSize(const wxSize& minSize) { m_minWidth = minSize.x; m_minHeight = minSize.y; }
+ virtual void SetMaxSize(const wxSize& maxSize) { m_maxWidth = maxSize.x; m_maxHeight = maxSize.y; }
+
+ // Override these methods to impose restrictions on min/max size.
+ // The easier way is to call SetMinSize() and SetMaxSize() which
+ // will have the same effect. Doing both is non-sense.
+ virtual wxSize GetMinSize() const { return wxSize(m_minWidth, m_minHeight); }
+ virtual wxSize GetMaxSize() const { return wxSize(m_maxWidth, m_maxHeight); }
+
+ // Get the min and max values one by one
+ int GetMinWidth() const { return GetMinSize().x; }
+ int GetMinHeight() const { return GetMinSize().y; }
+ int GetMaxWidth() const { return GetMaxSize().x; }
+ int GetMaxHeight() const { return GetMaxSize().y; }
+