return FALSE;
// MSW-specific initialisation
- if ( !MSWCreateToolbar(pos, size, style) )
+ if ( !MSWCreateToolbar(pos, size) )
return FALSE;
// set up the colors and fonts
return TRUE;
}
-bool wxToolBar::MSWCreateToolbar(const wxPoint& pos,
- const wxSize& size,
- long style)
+bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
{
- if ( !MSWCreateControl(TOOLBARCLASSNAME, _T(""), pos, size, style) )
+ if ( !MSWCreateControl(TOOLBARCLASSNAME, _T(""), pos, size) )
return FALSE;
// toolbar-specific post initialisation
UnsubclassWin();
- if ( !MSWCreateToolbar(pos, size, GetWindowStyle()) )
+ if ( !MSWCreateToolbar(pos, size) )
{
// what can we do?
wxFAIL_MSG( _T("recreating the toolbar failed") );
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
// ----------------------------------------------------------------
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
// FIXME: 6 is hardcoded separator line height...
//h += 6;
if (HasFlag(wxTB_NODIVIDER))
- h += 3;
+ h += 4;
else
h += 6;
h *= m_maxRows;