destroying native and wx controls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-03-29 13:09:31 +00:00
parent 5755c2b2a5
commit 488b2c29c0

View File

@@ -665,6 +665,23 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
tool->Detach();
wxToolBarTool* tl = wx_static_cast( wxToolBarTool* , tool ) ;
switch ( tool->GetStyle() )
{
case wxTOOL_STYLE_CONTROL:
tool->GetControl()->Destroy();
break;
case wxTOOL_STYLE_BUTTON:
case wxTOOL_STYLE_SEPARATOR:
if ( tl->GetControlHandle() )
{
DisposeControl( (ControlRef) tl->GetControlHandle() ) ;
tl->SetControlHandle( (ControlRef) NULL ) ;
}
break;
}
// and finally reposition all the controls after this one
for ( /* node -> first after deleted */ ; node; node = node->GetNext() )