]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/anybutton.cpp
Add "checked" property for toolbar tool elements in XRC.
[wxWidgets.git] / src / msw / anybutton.cpp
index db69814c48c04018ef7f759daca00a9f1f8d5709..0e3da82ea348a59e883144101e312498b0da28bd 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     wxAnyButton
 // Author:      Julian Smart
 // Created:     1998-01-04 (extracted from button.cpp)
-// RCS-ID:      $Id$
+// RCS-ID:      $Id: anybutton.cpp 67384 2011-04-03 20:31:32Z DS $
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -819,9 +819,9 @@ void DrawButtonText(HDC hdc,
         // now center this rect inside the entire button area
         const LONG w = rc.right - rc.left;
         const LONG h = rc.bottom - rc.top;
-        rc.left = (pRect->right - pRect->left)/2 - w/2;
+        rc.left = pRect->left + (pRect->right - pRect->left)/2 - w/2;
         rc.right = rc.left+w;
-        rc.top = (pRect->bottom - pRect->top)/2 - h/2;
+        rc.top = pRect->top + (pRect->bottom - pRect->top)/2 - h/2;
         rc.bottom = rc.top+h;
 
         ::DrawText(hdc, text.wx_str(), text.length(), &rc, flags);