From: Chris Elliott Date: Sun, 13 Aug 2006 12:12:55 +0000 (+0000) Subject: fix borland error about string refernce X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/047aa29670e4c7ba9e48e967506db4db3fbbf399 fix borland error about string refernce git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 05c20f9b88..13f270d4c5 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -849,11 +849,10 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) } COLORREF colFg = wxColourToRGB(GetForegroundColour()); - DrawButtonText(hdc, &rectBtn, - state & ODS_NOACCEL ? GetLabelText() - : 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; }