- // minimal size has priority over the best size so set here our min size
- p->SetMinSize(sz);
- p->SetSize(sz);
-
- wxWindow *top = p->GetTopLevelParent();
- if (top)
- {
- // we've changed our size, thus our top level parent needs to relayout itself
- top->Layout();
-
- // FIXME: this makes wxGenericCollapsiblePane behave as the user expect but
- // maybe there are cases where this is unwanted!
- if (top->GetSizer())
-#ifdef __WXGTK__
- // FIXME: the SetSizeHints() call would be required also for GTK+ for the
- // expanded->collapsed transition.
- // Unfortunately if we enable this line, then the GTK+ top window
- // won't always be resized by the SetClientSize() call below!
- // As a side effect of this dirty fix, the minimal size for the
- // pane window is not set in GTK+ and the user can hide it shrinking
- // the "top" window...
- if (p->IsCollapsed())
-#endif
- top->GetSizer()->SetSizeHints(top);
-
- if (p->IsCollapsed())
- {
- // NB: we need to use SetClientSize() and not SetSize() otherwise the size for
- // windows like e.g. wxFrames with wxMenubars won'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 (p->m_bIgnoreNextChange)