X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae580de3763c475c61cf3200692ae7fecfb42d62..739c5499fcab1c165b8dd0591c9fd9e2329b3cf9:/src/msw/toolbar.cpp diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 697b9c6c8d..7eaea5ca0f 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -985,7 +985,7 @@ bool wxToolBar::Realize() { const wxString& label = tool->GetLabel(); if ( !label.empty() ) - button.iString = (INT_PTR)label.wx_str(); + button.iString = (INT_PTR) wxMSW_CONV_LPCTSTR(label); } button.idCommand = tool->GetId(); @@ -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; }