X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65ba4113c63f5ad60aa6bb49a70cf893d1d175a3..66242f20794d33f61eb381fba6ca1fc6b9c1c929:/src/common/sizer.cpp?ds=sidebyside diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index fd78077c09..049760f8c2 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -196,7 +196,7 @@ void wxSizerItem::SetDimension( wxPoint pos, wxSize size ) size.x = rwidth; } } - + // This is what GetPosition() returns. Since we calculate // borders afterwards, GetPosition() will be the left/top // corner of the surrounding border. @@ -355,7 +355,12 @@ bool wxSizer::Remove( int pos ) void wxSizer::Fit( wxWindow *window ) { - wxSize size = FitSize( window ); + wxSize size; + if (window->IsTopLevel()) + size = FitSize( window ); + else + size = GetMinWindowSize( window ); + window->SetSize( size ); } @@ -371,7 +376,7 @@ void wxSizer::SetSizeHints( wxWindow *window ) window->SetSizeHints( size.x, size.y ); } -wxSize wxSizer::GetMaxWindowSize( wxWindow *window ) +wxSize wxSizer::GetMaxWindowSize( wxWindow *WXUNUSED(window) ) { wxSize sizeMax = wxGetDisplaySize(); // make the max size a bit smaller than the screen, a window which takes @@ -942,7 +947,7 @@ wxSize wxBoxSizer::CalcMin() wxSizerItem *item = (wxSizerItem*) node->Data(); m_stretchable += item->GetOption(); - + wxSize size( item->CalcMin() ); if (m_orient == wxHORIZONTAL) @@ -964,7 +969,7 @@ wxSize wxBoxSizer::CalcMin() m_fixedWidth = wxMax( m_fixedWidth, size.x ); } else - { + { m_fixedWidth += size.x; m_fixedHeight = wxMax( m_fixedHeight, size.y ); } @@ -999,7 +1004,7 @@ static void GetStaticBoxBorders(wxStaticBox *box, else #endif // __WXGTK__ *borderTop = 15; - + (void)box; *borderOther = 5; }