]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxStripMenuCodes
authorDavid Elliott <dfe@tgwbd.org>
Mon, 8 Sep 2003 19:42:35 +0000 (19:42 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 8 Sep 2003 19:42:35 +0000 (19:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/button.mm
src/cocoa/checkbox.mm

index 093bc3fcf5eff66fc45d5f219326963793c9a22d..7b93013217cb15932c6238b39e7a38406a41fb49 100644 (file)
@@ -43,7 +43,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid,
     [m_cocoaNSView release];
 
     [GetNSButton() setBezelStyle:NSRoundedBezelStyle];
-    [GetNSButton() setTitle:wxNSStringWithWxString(label)];
+    [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
     [GetNSControl() sizeToFit];
 
     if(m_parent)
@@ -73,7 +73,7 @@ wxString wxButton::GetLabel() const
 
 void wxButton::SetLabel(const wxString& label)
 {
-    [GetNSButton() setTitle:wxNSStringWithWxString(label)];
+    [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
 }
 
 wxSize wxButtonBase::GetDefaultSize()
index b43f179077d8d1340c5863c4959c4291d54e537e..04204304f11c7d3f63916a1ba5babd32b9341982 100644 (file)
@@ -17,6 +17,7 @@
 #endif //WX_PRECOMP
 
 #include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/string.h"
 
 #import <AppKit/NSButton.h>
 #import <Foundation/NSString.h>
@@ -41,7 +42,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid,
     SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
     [GetNSButton() setButtonType: NSSwitchButton];
-    [GetNSButton() setTitle:[NSString stringWithCString: label.c_str()]];
+    [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
     [GetNSControl() sizeToFit];
 
     if(m_parent)