don't use deprecated wxSizerItem::SetWindow/Sizer/Spacer(), use AssignXXX() equivalents instead

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-03-30 20:16:11 +00:00
parent ef0f138756
commit a50cf60efe
2 changed files with 7 additions and 17 deletions

View File

@ -587,13 +587,9 @@ bool wxSizer::Remove( int index )
wxCHECK_MSG( node, false, _T("Failed to find child node") ); wxCHECK_MSG( node, false, _T("Failed to find child node") );
wxSizerItem *item = node->GetData(); delete node->GetData();
if ( item->IsWindow() )
item->GetWindow()->SetContainingSizer( NULL );
delete item;
m_children.Erase( node ); m_children.Erase( node );
return true; return true;
} }
@ -630,7 +626,6 @@ bool wxSizer::Detach( wxWindow *window )
if (item->GetWindow() == window) if (item->GetWindow() == window)
{ {
item->GetWindow()->SetContainingSizer( NULL );
delete item; delete item;
m_children.Erase( node ); m_children.Erase( node );
return true; return true;
@ -655,8 +650,6 @@ bool wxSizer::Detach( int index )
if ( item->IsSizer() ) if ( item->IsSizer() )
item->DetachSizer(); item->DetachSizer();
else if ( item->IsWindow() )
item->GetWindow()->SetContainingSizer( NULL );
delete item; delete item;
m_children.Erase( node ); m_children.Erase( node );
@ -675,8 +668,7 @@ bool wxSizer::Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive )
if (item->GetWindow() == oldwin) if (item->GetWindow() == oldwin)
{ {
item->GetWindow()->SetContainingSizer( NULL ); item->AssignWindow(newwin);
item->SetWindow(newwin);
newwin->SetContainingSizer( this ); newwin->SetContainingSizer( this );
return true; return true;
} }
@ -704,9 +696,7 @@ bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive )
if (item->GetSizer() == oldsz) if (item->GetSizer() == oldsz)
{ {
wxSizer *old = item->GetSizer(); item->AssignSizer(newsz);
item->SetSizer(newsz);
delete old;
return true; return true;
} }
else if (recursive && item->IsSizer()) else if (recursive && item->IsSizer())

View File

@ -144,9 +144,9 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem()
wxWindow *wnd = wxDynamicCast(item, wxWindow); wxWindow *wnd = wxDynamicCast(item, wxWindow);
if (sizer) if (sizer)
sitem->SetSizer(sizer); sitem->AssignSizer(sizer);
else if (wnd) else if (wnd)
sitem->SetWindow(wnd); sitem->AssignWindow(wnd);
else else
wxLogError(wxT("Error in resource.")); wxLogError(wxT("Error in resource."));
@ -170,7 +170,7 @@ wxObject* wxSizerXmlHandler::Handle_spacer()
wxSizerItem* sitem = MakeSizerItem(); wxSizerItem* sitem = MakeSizerItem();
SetSizerItemAttributes(sitem); SetSizerItemAttributes(sitem);
sitem->SetSpacer(GetSize()); sitem->AssignSpacer(GetSize());
AddSizerItem(sitem); AddSizerItem(sitem);
return NULL; return NULL;
} }