From 702a26fded8c16bf858631d929580441ba23fdc4 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sat, 12 Jan 2008 15:25:02 +0000
Subject: [PATCH] better documentation for wxWindow::SetSizerAndFit()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/sizer.tex  |  6 ++++--
 docs/latex/wx/tsizer.tex | 10 ++++------
 docs/latex/wx/window.tex |  7 +++++--
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/docs/latex/wx/sizer.tex b/docs/latex/wx/sizer.tex
index 36c801e152..0c8b32a5b0 100644
--- a/docs/latex/wx/sizer.tex
+++ b/docs/latex/wx/sizer.tex
@@ -527,10 +527,12 @@ passed to it. This only makes sense when {\it window} is actually a
 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}}
diff --git a/docs/latex/wx/tsizer.tex b/docs/latex/wx/tsizer.tex
index 815b7e4357..5218b51ef8 100644
--- a/docs/latex/wx/tsizer.tex
+++ b/docs/latex/wx/tsizer.tex
@@ -259,9 +259,9 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title )
      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}
 
@@ -302,9 +302,7 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title )
      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}
 
diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index cf6e0c3eca..2c1977bfe8 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -3594,8 +3594,11 @@ only the sizer will have effect.
 
 \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}
-- 
2.50.0

