]> git.saurik.com Git - wxWidgets.git/commitdiff
don't disable top level children in parents Enable()
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Aug 2002 15:10:59 +0000 (15:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Aug 2002 15:10:59 +0000 (15:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 62fd946240e16a271465130e1ac4d5772b67987e..3acb8366a90f09bb43a0aa071f7730d1b754893c 100644 (file)
@@ -506,10 +506,16 @@ bool wxWindowMSW::Enable(bool enable)
     // well but when it is enabled back, only those of the children which
     // hadn't been already disabled in the beginning should be enabled again,
     // so we have to keep the list of those children
-    wxWindowList::Node *node = GetChildren().GetFirst();
-    while ( node )
+    for ( wxWindowList::Node *node = GetChildren().GetFirst();
+          node;
+          node = node->GetNext() )
     {
         wxWindow *child = node->GetData();
+        if ( child->IsTopLevel() )
+        {
+            // the logic below doesn't apply to top level children
+            continue;
+        }
 
         if ( enable )
         {
@@ -534,8 +540,6 @@ bool wxWindowMSW::Enable(bool enable)
                 m_childrenDisabled->Append(child);
             }
         }
-
-        node = node->GetNext();
     }
 
     if ( enable && m_childrenDisabled )