// Author: Julian Smart
// Modified by:
// Created: 04/01/98
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
break;
}
+ // Instead of using fixed widths for all buttons, size them
+ // automatically according to the size of their bitmap and text
+ // label, if present. This particularly matters for toolbars
+ // with the wxTB_HORZ_LAYOUT style: they look hideously ugly
+ // without autosizing when the labels have even slightly
+ // different lengths.
+ button.fsStyle |= TBSTYLE_AUTOSIZE;
+
bitmapId++;
break;
}
{
LPNMTOOLBAR tbhdr = (LPNMTOOLBAR)lParam;
- wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tbhdr->iItem);
+ wxCommandEvent evt(wxEVT_TOOL_DROPDOWN, tbhdr->iItem);
if ( HandleWindowEvent(evt) )
{
// Event got handled, don't display default popup menu
// toolbar icons with comctl32.dll < 6.0.
void wxToolBar::OnEraseBackground(wxEraseEvent& event)
{
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
MSWDoEraseBackground(event.GetDC()->GetHDC());
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
}
bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
return 0;
break;
#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+ case WM_PRINTCLIENT:
+ wxFillRect(GetHwnd(), (HDC)wParam, MSWGetToolbarBgBrush());
+ return 1;
}
return wxControl::MSWWindowProc(nMsg, wParam, lParam);