wxDialog, since SetSizeHints only has any effect in these classes.
It does nothing in normal windows or controls.
-This method is commonly invoked in the constructor of a toplevel window itself
-(see the sample in the description of \helpref{wxBoxSizer}{wxboxsizer}) if the
+This method is implicitly used by \helpref{wxWindow::SetSizerAndFit}{wxwindowsetsizerandfit}
+which is commonly invoked in the constructor of a toplevel window itself (see
+the sample in the description of \helpref{wxBoxSizer}{wxboxsizer}) if the
toplevel window is resizable.
+
\membersection{wxSizer::SetVirtualSizeHints}\label{wxsizersetvirtualsizehints}
\func{void}{SetVirtualSizeHints}{\param{wxWindow* }{window}}
0, // make vertically unstretchable
wxALIGN_CENTER ); // no border and centre horizontally
- SetSizer( topsizer ); // use the sizer for layout
-
- topsizer->SetSizeHints( this ); // set size hints to honour minimum size
+ SetSizerAndFit(topsizer); // use the sizer for layout and size window
+ // accordingly and prevent it from being resized
+ // to smaller size
}
\end{verbatim}
button_sizer,
wxSizerFlags(0).Center() );
- SetSizer( topsizer ); // use the sizer for layout
-
- topsizer->SetSizeHints( this ); // set size hints to honour minimum size
+ SetSizerAndFit(topsizer); // use the sizer for layout and set size and hints
}
\end{verbatim}
\func{void}{SetSizerAndFit}{\param{wxSizer* }{sizer}, \param{bool }{deleteOld=true}}
-The same as \helpref{SetSizer}{wxwindowsetsizer}, except it also sets the size hints
-for the window based on the sizer's minimum size.
+This method calls \helpref{SetSizer}{wxwindowsetsizer} and then
+\helpref{wxSizer::SetSizeHints}{wxsizersetsizehints} which sets the initial
+window size to the size needed to accommodate all sizer elements and sets the
+size hints which, if this window is a top level one, prevent the user from
+resizing it to be less than this minimial size.
\membersection{wxWindow::SetThemeEnabled}\label{wxwindowsetthemeenabled}