]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
Fix for Bug #1432054: ToolBar controls not removed by ClearTools
[wxWidgets.git] / src / common / sizer.cpp
index 5db2c3022254f586f8776d098ff0a44964d74ab9..b250c0c04853a12bad57b0bcc61498cd08771e0b 100644 (file)
@@ -447,7 +447,20 @@ bool wxSizerItem::IsShown() const
             return m_window->IsShown();
 
         case Item_Sizer:
-            return m_sizer->IsShown();
+            // arbitrarily decide that if at least one of our elements is
+            // shown, so are we (this arbitrariness is the reason for
+            // deprecating this function)
+            {
+                for ( wxSizerItemList::compatibility_iterator
+                        node = m_sizer->GetChildren().GetFirst();
+                      node;
+                      node = node->GetNext() )
+                {
+                    if ( node->GetData()->IsShown() )
+                        return true;
+                }
+            }
+            return false;
 
         case Item_Spacer:
             return m_spacer->IsShown();
@@ -475,11 +488,6 @@ int wxSizerItem::GetOption() const
 // wxSizer
 //---------------------------------------------------------------------------
 
-wxSizer::wxSizer()
-{
-    m_isShown = true;
-}
-
 wxSizer::~wxSizer()
 {
     WX_CLEAR_LIST(wxSizerItemList, m_children);