remove the old buttons in Realize() before inserting the new ones in text only mode too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -472,6 +472,15 @@ bool wxToolBar::Realize()
|
||||
|
||||
const bool isVertical = HasFlag(wxTB_VERTICAL);
|
||||
|
||||
// delete all old buttons, if any
|
||||
for ( size_t pos = 0; pos < m_nButtons; pos++ )
|
||||
{
|
||||
if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) )
|
||||
{
|
||||
wxLogDebug(wxT("TB_DELETEBUTTON failed"));
|
||||
}
|
||||
}
|
||||
|
||||
// First, add the bitmap: we use one bitmap for all toolbar buttons
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
@@ -612,15 +621,6 @@ bool wxToolBar::Realize()
|
||||
|
||||
bitmapId = m_nButtons;
|
||||
}
|
||||
|
||||
// Now delete all the buttons
|
||||
for ( size_t pos = 0; pos < m_nButtons; pos++ )
|
||||
{
|
||||
if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) )
|
||||
{
|
||||
wxLogDebug(wxT("TB_DELETEBUTTON failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( addBitmap ) // no old bitmap or we can't replace it
|
||||
|
Reference in New Issue
Block a user