fixed wxFrame::IconizeChildFrames() bug which would restore the child frame even if it had been iconized before the main frame was

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-11-14 01:26:14 +00:00
parent 5e6a47f5a7
commit 9327c3aa02
2 changed files with 17 additions and 1 deletions

View File

@@ -155,6 +155,9 @@ private:
WXHWND m_hwndToolTip; WXHWND m_hwndToolTip;
#endif // tooltips #endif // tooltips
// used by IconizeChildFrames(), see comments there
bool m_wasMinimized;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFrame) DECLARE_DYNAMIC_CLASS(wxFrame)
}; };

View File

@@ -112,6 +112,8 @@ void wxFrame::Init()
m_fsToolBarHeight = 0; m_fsToolBarHeight = 0;
// m_fsMenu = 0; // m_fsMenu = 0;
m_wasMinimized = FALSE;
m_winLastFocused = (wxWindow *)NULL; m_winLastFocused = (wxWindow *)NULL;
} }
@@ -523,6 +525,17 @@ void wxFrame::IconizeChildFrames(bool bIconize)
#endif // wxUSE_MDI_ARCHITECTURE #endif // wxUSE_MDI_ARCHITECTURE
) )
{ {
// we don't want to restore the child frames which had been
// iconized even before we were iconized, so save the child frame
// status when iconizing the parent frame and check it when
// restoring it
if ( bIconize )
{
frame->m_wasMinimized = frame->IsIconized();
}
// this test works for both iconizing and restoring
if ( !frame->m_wasMinimized )
frame->Iconize(bIconize); frame->Iconize(bIconize);
} }
} }