X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/222ed1d678dff2f5c3c4164321dd05e8f47de487..b0540bb8ba756e2df3479073d9f6d7c3373460c3:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 3f7e4352a6..87b68bee76 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -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; }