]> git.saurik.com Git - wxWidgets.git/commitdiff
Added accelerator handling for buttons and infrastructure to do the same for
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 15 Feb 2004 18:00:27 +0000 (18:00 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 15 Feb 2004 18:00:27 +0000 (18:00 +0000)
        other controls (patch 893580).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/control.h
src/os2/button.cpp
src/os2/control.cpp

index 496c2701919e9c04432f339520e6ff5475211787..396cf35fefbdc8f1bbeeb0016aa234794b83c74e 100644 (file)
@@ -50,6 +50,8 @@ public:
                 ,const wxString&    rsName = wxControlNameStr
                );
 
+    virtual void SetLabel(const wxString& rsLabel);
+
     //
     // Simulates an event
     //
index c47b6dce3238619770aeb192b2c70dc780b6b7df..7e0a49ebf05af21720e76140344908e14cbac59a 100644 (file)
@@ -51,6 +51,9 @@ bool wxButton::Create(
 , const wxString&                   rsName
 )
 {
+
+    wxString                        sLabel = ::wxPMTextToLabel(rsLabel);
+
     SetName(rsName);
 #if wxUSE_VALIDATORS
     SetValidator(rValidator);
@@ -73,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
index 324ea885b21935c133eedbb6266a93c67ab271de..1dd3f453d139f04fcf6142992350144a615f7436 100644 (file)
@@ -240,6 +240,15 @@ WXDWORD wxControl::OS2GetStyle(
     return dwStyle;
 } // end of wxControl::OS2GetStyle
 
+void wxControl::SetLabel(
+  const wxString&                   rsLabel
+)
+{
+    wxString                        sLabel = ::wxPMTextToLabel(rsLabel);
+
+    ::WinSetWindowText(GetHwnd(), sLabel.c_str());
+} // end of wxControl::SetLabel
+
 // ---------------------------------------------------------------------------
 // global functions
 // ---------------------------------------------------------------------------