fixes to the sizers behaviour necessary to make the log dialog work again

(thanks to Dimitri) and a few updates to the docs after the recent changes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-06-13 20:21:20 +00:00
parent aad65f130d
commit e5251d4f78
5 changed files with 18 additions and 14 deletions

View File

@@ -125,11 +125,11 @@ Here, the sizer will do the actual calculation of its children minimal sizes.
\membersection{wxSizer::Fit}\label{wxsizerfit}
\func{void}{Fit}{\param{wxWindow* }{window}}
\func{wxSize}{Fit}{\param{wxWindow* }{window}}
Tell the sizer to resize the {\it window} to match the sizer's minimal size. This
is commonly done in the constructor of the window itself, see sample in the description
of \helpref{wxBoxSizer}{wxboxsizer}.
of \helpref{wxBoxSizer}{wxboxsizer}. Returns the new size.
\membersection{wxSizer::FitInside}\label{wxsizerfitinside}

View File

@@ -252,10 +252,8 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title )
0, // make vertically unstretchable
wxALIGN_CENTER ); // no border and centre horizontally
SetAutoLayout( TRUE ); // tell dialog to use sizer
SetSizer( topsizer ); // actually set the sizer
SetSizer( topsizer ); // use the sizer for layout
topsizer->Fit( this ); // set size to minimum size as calculated by the sizer
topsizer->SetSizeHints( this ); // set size hints to honour minimum size
}
\end{verbatim}

View File

@@ -1914,10 +1914,11 @@ Sets the accelerator table for this window. See \helpref{wxAcceleratorTable}{wxa
\func{void}{SetAutoLayout}{\param{bool}{ autoLayout}}
Determines whether the \helpref{wxWindow::Layout}{wxwindowlayout} function will
be called automatically when the window is resized. Use in connection with
\helpref{wxWindow::SetSizer}{wxwindowsetsizer} and
\helpref{wxWindow::SetConstraints}{wxwindowsetconstraints} for laying out
subwindows.
be called automatically when the window is resized. It is called implicitly by
\helpref{wxWindow::SetSizer}{wxwindowsetsizer} but if you use
\helpref{wxWindow::SetConstraints}{wxwindowsetconstraints} you should call it
manually or otherwise the window layout won't be correctly updated when its
size changes.
\wxheading{Parameters}
@@ -2481,6 +2482,10 @@ will then own the object, and will take care of its deletion.
If an existing layout constraints object is already owned by the
window, it will be deleted if the deleteOld parameter is TRUE.
Note that this function will also call
\helpref{SetAutoLayout}{wxwindowsetautolayout} implicitly with {\tt TRUE}
parameter if the {\it sizer}\/ is non-NULL and {\tt FALSE} otherwise.
\wxheading{Parameters}
\docparam{sizer}{The sizer to set. Pass NULL to disassociate and conditionally delete

View File

@@ -184,7 +184,7 @@ public:
virtual void Layout();
void Fit( wxWindow *window );
wxSize Fit( wxWindow *window );
void FitInside( wxWindow *window );
void SetSizeHints( wxWindow *window );
void SetVirtualSizeHints( wxWindow *window );

View File

@@ -400,7 +400,7 @@ void wxSizer::DeleteWindows()
}
}
void wxSizer::Fit( wxWindow *window )
wxSize wxSizer::Fit( wxWindow *window )
{
wxSize size;
if (window->IsTopLevel())
@@ -408,8 +408,9 @@ void wxSizer::Fit( wxWindow *window )
else
size = GetMinWindowSize( window );
//window->SetClientSize( size );
window->SetSize( size );
return size;
}
void wxSizer::FitInside( wxWindow *window )
@@ -434,8 +435,8 @@ void wxSizer::SetSizeHints( wxWindow *window )
// Preserve the window's max size hints, but set the
// lower bound according to the sizer calculations.
Fit( window );
wxSize size( window->GetSize() );
wxSize size = Fit( window );
window->SetSizeHints( size.x,
size.y,
window->GetMaxWidth(),