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
This commit is contained in:
@@ -147,7 +147,7 @@ wxControl::~wxControl()
|
|||||||
|
|
||||||
void wxControl::SetLabel(const wxString& title)
|
void wxControl::SetLabel(const wxString& title)
|
||||||
{
|
{
|
||||||
m_label = title ;
|
m_label = wxStripMenuCodes(title) ;
|
||||||
|
|
||||||
if ( (ControlHandle) m_macControl )
|
if ( (ControlHandle) m_macControl )
|
||||||
{
|
{
|
||||||
@@ -155,9 +155,9 @@ void wxControl::SetLabel(const wxString& title)
|
|||||||
wxString label ;
|
wxString label ;
|
||||||
|
|
||||||
if( wxApp::s_macDefaultEncodingIsPC )
|
if( wxApp::s_macDefaultEncodingIsPC )
|
||||||
label = wxMacMakeMacStringFromPC( title ) ;
|
label = wxMacMakeMacStringFromPC( m_label ) ;
|
||||||
else
|
else
|
||||||
label = title ;
|
label = m_label ;
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
c2pstrcpy( (StringPtr) maclabel , label ) ;
|
c2pstrcpy( (StringPtr) maclabel , label ) ;
|
||||||
|
@@ -115,14 +115,14 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
|||||||
Rect bounds ;
|
Rect bounds ;
|
||||||
Str255 title ;
|
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,
|
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
|
||||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
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 ) ;
|
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
|
||||||
if ( i == 0 )
|
if ( i == 0 )
|
||||||
m_radioButtonCycle = radBtn ;
|
m_radioButtonCycle = radBtn ;
|
||||||
|
@@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
m_label = label ;
|
m_label = wxStripMenuCodes(label) ;
|
||||||
|
|
||||||
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
|
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
|
||||||
SetBestSize( size ) ;
|
SetBestSize( size ) ;
|
||||||
|
@@ -147,7 +147,7 @@ wxControl::~wxControl()
|
|||||||
|
|
||||||
void wxControl::SetLabel(const wxString& title)
|
void wxControl::SetLabel(const wxString& title)
|
||||||
{
|
{
|
||||||
m_label = title ;
|
m_label = wxStripMenuCodes(title) ;
|
||||||
|
|
||||||
if ( (ControlHandle) m_macControl )
|
if ( (ControlHandle) m_macControl )
|
||||||
{
|
{
|
||||||
@@ -155,9 +155,9 @@ void wxControl::SetLabel(const wxString& title)
|
|||||||
wxString label ;
|
wxString label ;
|
||||||
|
|
||||||
if( wxApp::s_macDefaultEncodingIsPC )
|
if( wxApp::s_macDefaultEncodingIsPC )
|
||||||
label = wxMacMakeMacStringFromPC( title ) ;
|
label = wxMacMakeMacStringFromPC( m_label ) ;
|
||||||
else
|
else
|
||||||
label = title ;
|
label = m_label ;
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
c2pstrcpy( (StringPtr) maclabel , label ) ;
|
c2pstrcpy( (StringPtr) maclabel , label ) ;
|
||||||
|
@@ -115,14 +115,14 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
|||||||
Rect bounds ;
|
Rect bounds ;
|
||||||
Str255 title ;
|
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,
|
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
|
||||||
kControlGroupBoxTextTitleProc , (long) this ) ;
|
kControlGroupBoxTextTitleProc , (long) this ) ;
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
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 ) ;
|
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
|
||||||
if ( i == 0 )
|
if ( i == 0 )
|
||||||
m_radioButtonCycle = radBtn ;
|
m_radioButtonCycle = radBtn ;
|
||||||
|
@@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
m_label = label ;
|
m_label = wxStripMenuCodes(label) ;
|
||||||
|
|
||||||
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
|
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
|
||||||
SetBestSize( size ) ;
|
SetBestSize( size ) ;
|
||||||
|
Reference in New Issue
Block a user