X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/017dc06b502c041c112a3948e6c5f65000a86d94..43f4e852a1b2ac37c3db6a2b87315192ac549191:/src/msw/toolbar.cpp?ds=sidebyside diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 884fedaf40..8052cec705 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1053,6 +1053,14 @@ bool wxToolBar::Realize() 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; } @@ -1687,7 +1695,9 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event) // 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)