wxCHECK_MSG( node, false, _T("Failed to find child node") );
- wxSizerItem *item = node->GetData();
-
- if ( item->IsWindow() )
- item->GetWindow()->SetContainingSizer( NULL );
-
- delete item;
+ delete node->GetData();
m_children.Erase( node );
+
return true;
}
if (item->GetWindow() == window)
{
- item->GetWindow()->SetContainingSizer( NULL );
delete item;
m_children.Erase( node );
return true;
if ( item->IsSizer() )
item->DetachSizer();
- else if ( item->IsWindow() )
- item->GetWindow()->SetContainingSizer( NULL );
delete item;
m_children.Erase( node );
if (item->GetWindow() == oldwin)
{
- item->GetWindow()->SetContainingSizer( NULL );
- item->SetWindow(newwin);
+ item->AssignWindow(newwin);
newwin->SetContainingSizer( this );
return true;
}
if (item->GetSizer() == oldsz)
{
- wxSizer *old = item->GetSizer();
- item->SetSizer(newsz);
- delete old;
+ item->AssignSizer(newsz);
return true;
}
else if (recursive && item->IsSizer())