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:
Vadim Zeitlin
2002-09-19 11:53:21 +00:00
parent 20b7206cb2
commit 164d6a95e6

View File

@@ -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