From c978d28a2aa89bfa4f875d91328ce4a7546f684e Mon Sep 17 00:00:00 2001 From: David Elliott Date: Thu, 19 Jul 2007 19:19:52 +0000 Subject: [PATCH] Strip mnemonics from the label before passing it to Cocoa. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/stattext.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cocoa/stattext.mm b/src/cocoa/stattext.mm index b009c21868..4c948ba801 100644 --- a/src/cocoa/stattext.mm +++ b/src/cocoa/stattext.mm @@ -44,7 +44,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid, m_cocoaNSView = NULL; SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]); [m_cocoaNSView release]; - [GetNSTextField() setStringValue:wxNSStringWithWxString(label)]; + [GetNSTextField() setStringValue:wxNSStringWithWxString(wxStripMenuCodes(label, wxStrip_Mnemonics))]; // [GetNSTextField() setBordered: NO]; [GetNSTextField() setBezeled: NO]; [GetNSTextField() setEditable: NO]; @@ -70,7 +70,7 @@ wxStaticText::~wxStaticText() void wxStaticText::SetLabel(const wxString& label) { - [GetNSTextField() setStringValue:wxNSStringWithWxString(label)]; + [GetNSTextField() setStringValue:wxNSStringWithWxString(wxStripMenuCodes(label, wxStrip_Mnemonics))]; NSRect oldFrameRect = [GetNSTextField() frame]; NSView *superview = [GetNSTextField() superview]; wxLogTrace(wxTRACE_COCOA_Window_Size, wxT("wxStaticText::SetLabel Old Position: (%d,%d)"), GetPosition().x, GetPosition().y); -- 2.45.2