From 069a9976c389b868365164d8af68d97dd5f22633 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 23 Oct 2006 21:05:12 +0000 Subject: [PATCH] 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 --- src/generic/collpaneg.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/generic/collpaneg.cpp b/src/generic/collpaneg.cpp index 4a91de602d..0211001b92 100644 --- a/src/generic/collpaneg.cpp +++ b/src/generic/collpaneg.cpp @@ -109,8 +109,9 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz) SetMinSize(sz); SetSize(sz); - wxWindow *top = wxGetTopLevelParent(this); - if (top) + wxTopLevelWindow * + top = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); + if ( top ) { // we've changed our size, thus our top level parent needs to relayout // itself @@ -131,17 +132,22 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz) #endif top->GetSizer()->SetSizeHints(top); - if (IsCollapsed()) + + // we shouldn't attempt to resize a maximized window, whatever happens + if ( !top->IsMaximized() ) { - // use SetClientSize() and not SetSize() otherwise the size for - // e.g. a wxFrame with a menubar wouldn't be correctly set - top->SetClientSize(sz); - } - else - { - // force our parent to "fit", i.e. expand so that it can honour - // our minimal size - top->Fit(); + if ( IsCollapsed() ) + { + // use SetClientSize() and not SetSize() otherwise the size for + // e.g. a wxFrame with a menubar wouldn't be correctly set + top->SetClientSize(sz); + } + else + { + // force our parent to "fit", i.e. expand so that it can honour + // our minimal size + top->Fit(); + } } } }