]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
removed OSX code that is no longer needed
[wxWidgets.git] / src / common / sizer.cpp
index 3f7e4352a6397e329d691e7a6e51cc3424ab43c1..87b68bee7606b5eb69e0db37d9ff06ebe2524806 100644 (file)
@@ -43,7 +43,38 @@ IMPLEMENT_CLASS(wxNotebookSizer, wxSizer)
 
 WX_DEFINE_EXPORTED_LIST( wxSizerItemList );
 
-
+/*
+       TODO PROPERTIES
+         sizeritem
+           object
+               object_ref
+                 minsize
+                 option
+                 flag
+                 border
+     spacer
+               option
+               flag
+               borfder
+       boxsizer
+          orient
+    staticboxsizer
+          orient
+          label
+       gridsizer
+          rows
+          cols
+          vgap
+          hgap
+       flexgridsizer
+          rows
+          cols
+          vgap
+          hgap
+          growablerows
+          growablecols
+    minsize
+*/
 //---------------------------------------------------------------------------
 // wxSizerItem
 //---------------------------------------------------------------------------
@@ -94,10 +125,16 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border,
 
 wxSizerItem::~wxSizerItem()
 {
-    if (m_userData)
-        delete m_userData;
-    if (m_sizer)
+    delete m_userData;
+
+    if ( m_window )
+    {
+        m_window->SetContainingSizer(NULL);
+    }
+    else // we must be a sizer
+    {
         delete m_sizer;
+    }
 }
 
 
@@ -434,6 +471,7 @@ bool wxSizer::Detach( wxSizer *sizer )
         if (item->GetSizer() == sizer)
         {
             item->DetachSizer();
+            delete item;
             m_children.Erase( node );
             return true;
         }
@@ -455,6 +493,7 @@ bool wxSizer::Detach( wxWindow *window )
         if (item->GetWindow() == window)
         {
             item->GetWindow()->SetContainingSizer( NULL );
+            delete item;
             m_children.Erase( node );
             return true;
         }
@@ -481,6 +520,7 @@ bool wxSizer::Detach( int index )
     else if( item->IsWindow() )
         item->GetWindow()->SetContainingSizer( NULL );
 
+    delete item;
     m_children.Erase( node );
     return true;
 }