]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxFrame::IconizeChildFrames() bug which would restore the child frame even...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Nov 2001 01:26:14 +0000 (01:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Nov 2001 01:26:14 +0000 (01:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/frame.h
src/msw/frame.cpp

index ed17ffef9b54a8a1d59f132232f56a1a3575270a..300931980a5020cdb999ea90e00f590f89870e0e 100644 (file)
@@ -155,6 +155,9 @@ private:
     WXHWND                m_hwndToolTip;
 #endif // tooltips
 
+    // used by IconizeChildFrames(), see comments there
+    bool m_wasMinimized;
+
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxFrame)
 };
index 3b555428be2a90739f1a206222e639c0fad5df54..57ac80ebfc462253f2d83186340532f4b1111394 100644 (file)
@@ -112,6 +112,8 @@ void wxFrame::Init()
     m_fsToolBarHeight = 0;
 //  m_fsMenu = 0;
 
+    m_wasMinimized = FALSE;
+
     m_winLastFocused = (wxWindow *)NULL;
 }
 
@@ -523,7 +525,18 @@ void wxFrame::IconizeChildFrames(bool bIconize)
 #endif // wxUSE_MDI_ARCHITECTURE
            )
         {
-            frame->Iconize(bIconize);
+            // 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);
         }
     }
 }