From 28c98a77e93d2f3d4254dc757c431c523070e89d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 15 Jul 2002 17:15:51 +0000 Subject: [PATCH] Stripped menu control characters from buttons, static text, radiobox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/control.cpp | 6 +++--- src/mac/carbon/radiobox.cpp | 4 ++-- src/mac/carbon/stattext.cpp | 2 +- src/mac/control.cpp | 6 +++--- src/mac/radiobox.cpp | 4 ++-- src/mac/stattext.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 6570c1303b..945441b4ea 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -147,7 +147,7 @@ wxControl::~wxControl() void wxControl::SetLabel(const wxString& title) { - m_label = title ; + m_label = wxStripMenuCodes(title) ; if ( (ControlHandle) m_macControl ) { @@ -155,9 +155,9 @@ void wxControl::SetLabel(const wxString& title) wxString label ; if( wxApp::s_macDefaultEncodingIsPC ) - label = wxMacMakeMacStringFromPC( title ) ; + label = wxMacMakeMacStringFromPC( m_label ) ; else - label = title ; + label = m_label ; #if TARGET_CARBON c2pstrcpy( (StringPtr) maclabel , label ) ; diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 2d002e7852..98e7172f9a 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -115,14 +115,14 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, Rect bounds ; Str255 title ; - MacPreControlCreate( parent , id , label , pos , size ,style, val , name , &bounds , title ) ; + MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ; m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, kControlGroupBoxTextTitleProc , (long) this ) ; for (i = 0; i < n; i++) { - wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(),choices[i],wxPoint(5,20*i+10), + wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(), wxStripMenuCodes(choices[i]),wxPoint(5,20*i+10), wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ; if ( i == 0 ) m_radioButtonCycle = radBtn ; diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index ac2dc2e4d0..bc89591282 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_windowId = id; m_windowStyle = style; - m_label = label ; + m_label = wxStripMenuCodes(label) ; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); SetBestSize( size ) ; diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 6570c1303b..945441b4ea 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -147,7 +147,7 @@ wxControl::~wxControl() void wxControl::SetLabel(const wxString& title) { - m_label = title ; + m_label = wxStripMenuCodes(title) ; if ( (ControlHandle) m_macControl ) { @@ -155,9 +155,9 @@ void wxControl::SetLabel(const wxString& title) wxString label ; if( wxApp::s_macDefaultEncodingIsPC ) - label = wxMacMakeMacStringFromPC( title ) ; + label = wxMacMakeMacStringFromPC( m_label ) ; else - label = title ; + label = m_label ; #if TARGET_CARBON c2pstrcpy( (StringPtr) maclabel , label ) ; diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index 2d002e7852..98e7172f9a 100644 --- a/src/mac/radiobox.cpp +++ b/src/mac/radiobox.cpp @@ -115,14 +115,14 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, Rect bounds ; Str255 title ; - MacPreControlCreate( parent , id , label , pos , size ,style, val , name , &bounds , title ) ; + MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ; m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, kControlGroupBoxTextTitleProc , (long) this ) ; for (i = 0; i < n; i++) { - wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(),choices[i],wxPoint(5,20*i+10), + wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(), wxStripMenuCodes(choices[i]),wxPoint(5,20*i+10), wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ; if ( i == 0 ) m_radioButtonCycle = radBtn ; diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index ac2dc2e4d0..bc89591282 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_windowId = id; m_windowStyle = style; - m_label = label ; + m_label = wxStripMenuCodes(label) ; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); SetBestSize( size ) ; -- 2.45.2