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
// ----------------------------------------------------------------
+ wxToolBarToolsList::Node *node;
int bitmapId = 0;
wxSize sizeBmp;
// the number of buttons (not separators)
int nButtons = 0;
- for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
- node;
- node = node->GetNext() )
+ for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{
wxToolBarToolBase *tool = node->GetData();
if ( tool->IsButton() )
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
bool lastWasRadio = FALSE;
int i = 0;
- for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
- node;
- node = node->GetNext() )
+ for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{
wxToolBarToolBase *tool = node->GetData();
// FIXME: 6 is hardcoded separator line height...
//h += 6;
if (HasFlag(wxTB_NODIVIDER))
- h += 3;
+ h += 4;
else
h += 6;
h *= m_maxRows;