]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/button.cpp
Include wx/stattext.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / msw / button.cpp
index e7077383965ff1e6d2b5cc6cedc53949cfd8e2e5..ad0fbede215350c8bc4e9ec09b0ce99d43c72379 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        msw/button.cpp
+// Name:        src/msw/button.cpp
 // Purpose:     wxButton
 // Author:      Julian Smart
 // Modified by:
 
 #if wxUSE_BUTTON
 
+#include "wx/button.h"
+
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/button.h"
     #include "wx/brush.h"
     #include "wx/panel.h"
     #include "wx/bmpbuttn.h"
@@ -132,16 +133,16 @@ bool wxButton::Create(wxWindow *parent,
     {
         // On Windows, some buttons aren't supposed to have
         // mnemonics, so strip them out.
-        
-        label = wxGetStockLabel(id 
+
+        label = wxGetStockLabel(id
 #if defined(__WXMSW__) || defined(__WXWINCE__)
                                         , ( id != wxID_OK &&
                                             id != wxID_CANCEL &&
                                             id != wxID_CLOSE )
 #endif
                                 );
-     }
-    
+    }
+
     if ( !CreateControl(parent, id, pos, size, style, validator, name) )
         return false;
 
@@ -218,7 +219,7 @@ wxSize wxButton::DoGetBestSize() const
 
     wxCoord wBtn,
             hBtn;
-    dc.GetMultiLineTextExtent(GetLabel(), &wBtn, &hBtn);
+    dc.GetMultiLineTextExtent(wxStripMenuCodes(GetLabel()), &wBtn, &hBtn);
 
     // add a margin -- the button is wider than just its label
     wBtn += 3*GetCharWidth();
@@ -729,4 +730,3 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
 #endif // __WIN32__
 
 #endif // wxUSE_BUTTON
-