]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/button.cpp
Changed name to wxFIXED_MINSIZE since that is more descriptive of what
[wxWidgets.git] / src / os2 / button.cpp
index 4475844729d9cfd5a208a2f2e5d1bd6bf7b9a7a2..cb6894c3e6aa72da55f7444dc13db877bd0214cb 100644 (file)
@@ -13,6 +13,7 @@
 #include "wx/wxprec.h"
 
 #ifndef WX_PRECOMP
+    #include "wx/app.h"
     #include "wx/button.h"
     #include "wx/brush.h"
     #include "wx/panel.h"
@@ -46,12 +47,13 @@ bool wxButton::Create(
 , const wxPoint&                    rPos
 , const wxSize&                     rSize
 , long                              lStyle
-#if wxUSE_VALIDATORS
 , const wxValidator&                rValidator
-#endif
 , const wxString&                   rsName
 )
 {
+
+    wxString                        sLabel = ::wxPMTextToLabel(rsLabel);
+
     SetName(rsName);
 #if wxUSE_VALIDATORS
     SetValidator(rValidator);
@@ -74,7 +76,7 @@ bool wxButton::Create(
 
     m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent)   // Parent handle
                                        ,WC_BUTTON            // A Button class window
-                                       ,(PSZ)rsLabel.c_str() // Button text
+                                       ,(PSZ)sLabel.c_str()  // Button text
                                        ,lStyle               // Button style
                                        ,0, 0, 0, 0           // Location and size
                                        ,GetHwndOf(pParent)   // Owner handle
@@ -160,7 +162,7 @@ wxSize wxButton::DoGetBestSize() const
     //
     // Need a little extra to make it look right
     //
-    nHeightButton += nHeightChar/1.5;
+    nHeightButton += (int)(nHeightChar/1.5);
 
     if (!HasFlag(wxBU_EXACTFIT))
     {
@@ -312,7 +314,7 @@ void wxButton::SetDefaultStyle(
         if ((lStyle & BS_USERBUTTON) != BS_USERBUTTON)
         {
             if (bOn)
-                lStyle | BS_DEFAULT;
+                lStyle |= BS_DEFAULT;
             else
                 lStyle &= ~BS_DEFAULT;
             ::WinSetWindowULong(GetHwndOf(pBtn), QWL_STYLE, lStyle);