]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/anybutton.cpp
Fix bug in ribbon bar label size calculation.
[wxWidgets.git] / src / msw / anybutton.cpp
index 6251a69c5e7dd079470f61dc15f231f6783dd9c0..6e4438b3714c024dd1924890f47ee8f774c2ffe0 100644 (file)
@@ -395,7 +395,7 @@ wxSize wxMSWButton::GetFittingSize(wxWindow *win,
     {
         // We still need some margin or the text would be overwritten, just
         // make it as small as possible.
-        sizeBtn.x += (3*win->GetCharWidth())/2;
+        sizeBtn.x += (3*win->GetCharWidth());
     }
     else
     {
@@ -813,7 +813,7 @@ void DrawButtonText(HDC hdc,
         // first we need to compute its bounding rect
         RECT rc;
         ::CopyRect(&rc, pRect);
-        ::DrawText(hdc, text.wx_str(), text.length(), &rc,
+        ::DrawText(hdc, text.t_str(), text.length(), &rc,
                    DT_CENTER | DT_CALCRECT);
 
         // now center this rect inside the entire button area
@@ -824,7 +824,7 @@ void DrawButtonText(HDC hdc,
         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);
+        ::DrawText(hdc, text.t_str(), text.length(), &rc, flags);
     }
     else // single line label
     {
@@ -851,7 +851,7 @@ void DrawButtonText(HDC hdc,
 
         // notice that we must have DT_SINGLELINE for vertical alignment flags
         // to work
-        ::DrawText(hdc, text.wx_str(), text.length(), pRect,
+        ::DrawText(hdc, text.t_str(), text.length(), pRect,
                    flags | DT_SINGLELINE );
     }
 }