size.x = rwidth;
}
}
-
+
// This is what GetPosition() returns. Since we calculate
// borders afterwards, GetPosition() will be the left/top
// corner of the surrounding border.
void wxSizer::Fit( wxWindow *window )
{
- wxSize size = FitSize( window );
+ wxSize size;
+ if (window->IsTopLevel())
+ size = FitSize( window );
+ else
+ size = GetMinWindowSize( window );
+
window->SetSize( size );
}
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
wxSizerItem *item = (wxSizerItem*) node->Data();
m_stretchable += item->GetOption();
-
+
wxSize size( item->CalcMin() );
if (m_orient == wxHORIZONTAL)
m_fixedWidth = wxMax( m_fixedWidth, size.x );
}
else
- {
+ {
m_fixedWidth += size.x;
m_fixedHeight = wxMax( m_fixedHeight, size.y );
}
else
#endif // __WXGTK__
*borderTop = 15;
-
+ (void)box;
*borderOther = 5;
}