Fix for Bug #1432054: ToolBar controls not removed by ClearTools
Use DeleteTool in ClearTools instead of just destroying the internal list, so the toolbar is kept fully in sync with the removal of all tool types. Also fix wxMSW version to actually Destroy() the controls when they are deleted from the toolbar. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -409,7 +409,10 @@ void wxToolBarBase::UnToggleRadioGroup(wxToolBarToolBase *tool)
|
|||||||
|
|
||||||
void wxToolBarBase::ClearTools()
|
void wxToolBarBase::ClearTools()
|
||||||
{
|
{
|
||||||
WX_CLEAR_LIST(wxToolBarToolsList, m_tools);
|
while ( GetToolsCount() )
|
||||||
|
{
|
||||||
|
DeleteToolByPos(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxToolBarBase::Realize()
|
bool wxToolBarBase::Realize()
|
||||||
|
@@ -455,6 +455,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
|
|||||||
{
|
{
|
||||||
nButtonsToDelete = ((wxToolBarTool *)tool)->GetSeparatorsCount();
|
nButtonsToDelete = ((wxToolBarTool *)tool)->GetSeparatorsCount();
|
||||||
width *= nButtonsToDelete;
|
width *= nButtonsToDelete;
|
||||||
|
tool->GetControl()->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// do delete all buttons
|
// do delete all buttons
|
||||||
|
Reference in New Issue
Block a user