git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45176
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxCHECK_MSG( node, false, _T("Failed to find child node") );
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 );
m_children.Erase( node );
if (item->GetWindow() == window)
{
if (item->GetWindow() == window)
{
- item->GetWindow()->SetContainingSizer( NULL );
delete item;
m_children.Erase( node );
return true;
delete item;
m_children.Erase( node );
return true;
if ( item->IsSizer() )
item->DetachSizer();
if ( item->IsSizer() )
item->DetachSizer();
- else if ( item->IsWindow() )
- item->GetWindow()->SetContainingSizer( NULL );
delete item;
m_children.Erase( node );
delete item;
m_children.Erase( node );
if (item->GetWindow() == oldwin)
{
if (item->GetWindow() == oldwin)
{
- item->GetWindow()->SetContainingSizer( NULL );
- item->SetWindow(newwin);
+ item->AssignWindow(newwin);
newwin->SetContainingSizer( this );
return true;
}
newwin->SetContainingSizer( this );
return true;
}
if (item->GetSizer() == oldsz)
{
if (item->GetSizer() == oldsz)
{
- wxSizer *old = item->GetSizer();
- item->SetSizer(newsz);
- delete old;
+ item->AssignSizer(newsz);
return true;
}
else if (recursive && item->IsSizer())
return true;
}
else if (recursive && item->IsSizer())
wxWindow *wnd = wxDynamicCast(item, wxWindow);
if (sizer)
wxWindow *wnd = wxDynamicCast(item, wxWindow);
if (sizer)
- sitem->SetSizer(sizer);
+ sitem->AssignSizer(sizer);
+ sitem->AssignWindow(wnd);
else
wxLogError(wxT("Error in resource."));
else
wxLogError(wxT("Error in resource."));
wxSizerItem* sitem = MakeSizerItem();
SetSizerItemAttributes(sitem);
wxSizerItem* sitem = MakeSizerItem();
SetSizerItemAttributes(sitem);
- sitem->SetSpacer(GetSize());
+ sitem->AssignSpacer(GetSize());
AddSizerItem(sitem);
return NULL;
}
AddSizerItem(sitem);
return NULL;
}