\membersection{wxWindow::SetSizeHints}\label{wxwindowsetsizehints}
-This method does nothing for a normal wxWindow and is only kept
-for backwards compatibility. The actual implementation is in
+Use of this function for windows which are not toplevel windows
+(such as wxDialog or wxFrame) is discouraged. Please use
+\helpref{SetMinSize}{wxwindowsetminsize} and \helpref{SetMaxSize}{wxwindowsetmaxsize}
+instead.
+
+\wxheading{See also}
+
\helpref{wxTopLevelWindow::SetSizeHints}{wxtoplevelwindowsetsizehints}.
virtual void FitInside();
- // Methods for setting size hints. This is only used
- // for toplevel windows.
+ // SetSizeHints is actually for setting the size hints
+ // for the wxTLW for a Window Manager - hence the name -
+ // and it is therefore overridden in wxTLW to do that.
+ // In wxWindow(Base), it has (unfortunately) been abused
+ // to mean the same as SetMinSize() and SetMaxSize().
virtual void SetSizeHints( int minW, int minH,
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord,
const wxSize& incSize=wxDefaultSize)
{ DoSetSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y, incSize.x, incSize.y); }
- virtual void DoSetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
- int WXUNUSED(maxW), int WXUNUSED(maxH),
- int WXUNUSED(incW), int WXUNUSED(incH) )
- {
- }
+ virtual void DoSetSizeHints( int minW, int minH,
+ int maxW, int maxH,
+ int incW, int incH );
// Methods for setting virtual size hints
// FIXME: What are virtual size hints?
SetFont(font);
}
+void wxWindowBase::DoSetSizeHints( int minW, int minH,
+ int maxW, int maxH,
+ int incW, int 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 )
{