don't update the size of a maximized TLW, whatever happens with the pane

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-10-23 21:05:12 +00:00
parent dedcebb9df
commit 069a9976c3

View File

@@ -109,8 +109,9 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz)
SetMinSize(sz); SetMinSize(sz);
SetSize(sz); SetSize(sz);
wxWindow *top = wxGetTopLevelParent(this); wxTopLevelWindow *
if (top) top = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
if ( top )
{ {
// we've changed our size, thus our top level parent needs to relayout // we've changed our size, thus our top level parent needs to relayout
// itself // itself
@@ -131,7 +132,11 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz)
#endif #endif
top->GetSizer()->SetSizeHints(top); top->GetSizer()->SetSizeHints(top);
if (IsCollapsed())
// we shouldn't attempt to resize a maximized window, whatever happens
if ( !top->IsMaximized() )
{
if ( IsCollapsed() )
{ {
// use SetClientSize() and not SetSize() otherwise the size for // use SetClientSize() and not SetSize() otherwise the size for
// e.g. a wxFrame with a menubar wouldn't be correctly set // e.g. a wxFrame with a menubar wouldn't be correctly set
@@ -144,6 +149,7 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz)
top->Fit(); top->Fit();
} }
} }
}
} }
void wxGenericCollapsiblePane::Collapse(bool collapse) void wxGenericCollapsiblePane::Collapse(bool collapse)