X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b84aec037f06174a9e911aa9c9307c2a4e5b8f0b..9ed79eee4ee3f8c83a87094eef4b7c933663001b:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index d8fd8eea60..13f270d4c5 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -254,7 +254,7 @@ wxSize wxButton::DoGetBestSize() const wxCoord wBtn, hBtn; - dc.GetMultiLineTextExtent(wxStripMenuCodes(GetLabel()), &wBtn, &hBtn); + dc.GetMultiLineTextExtent(GetLabelText(), &wBtn, &hBtn); // add a margin -- the button is wider than just its label wBtn += 3*GetCharWidth(); @@ -849,11 +849,10 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) } COLORREF colFg = wxColourToRGB(GetForegroundColour()); - DrawButtonText(hdc, &rectBtn, - (state & ODS_NOACCEL ? wxStripMenuCodes(GetLabel()) - : GetLabel()), - state & ODS_DISABLED ? GetSysColor(COLOR_GRAYTEXT) - : colFg); + if ( state & ODS_DISABLED ) colFg = GetSysColor(COLOR_GRAYTEXT) ; + wxString label = GetLabel(); + if ( state & ODS_NOACCEL ) label = GetLabelText() ; + DrawButtonText(hdc, &rectBtn, label, colFg); return true; }