[m_cocoaNSView release];
[GetNSButton() setBezelStyle:NSRoundedBezelStyle];
- [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
+ [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))];
[GetNSControl() sizeToFit];
if(m_parent)
void wxButton::SetLabel(const wxString& label)
{
- [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
+ [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))];
}
wxSize wxButton::DoGetBestSize() const
[m_cocoaNSView release];
[GetNSButton() setButtonType: NSSwitchButton];
[GetNSButton() setAllowsMixedState: Is3State()];
- [GetNSButton() setTitle:wxNSStringWithWxString(wxStripMenuCodes(label))];
+ [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))];
[GetNSControl() sizeToFit];
if(m_parent)
return false;
m_cocoaNSView = NULL;
SetNSBox([[NSBox alloc] initWithFrame:MakeDefaultNSRect(size)]);
- [GetNSBox() setTitle:wxNSStringWithWxString(wxStripMenuCodes(title))];
+ [GetNSBox() setTitle:wxNSStringWithWxString(GetLabelText(title))];
if(m_parent)
m_parent->CocoaAddChild(this);
SetInitialFrameRect(pos,size);
wxRadioButton *radBtn = new wxRadioButton(
this,
wxID_ANY,
- wxStripMenuCodes(choices[i]),
+ GetLabelText(choices[i]),
wxPoint( 5, 20 * i + 10 ),
wxDefaultSize,
i == 0 ? wxRB_GROUP : 0 );
{
m_macIsUserPane = false;
- m_label = wxStripMenuCodes( label );
+ m_label = GetLabelText( label );
if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) )
return false;
void wxStaticText::SetLabel( const wxString& st )
{
- m_label = wxStripMenuCodes( st );
+ m_label = GetLabelText( st );
wxMacCFStringHolder str( m_label, m_font.GetEncoding() );
CFStringRef ref = str;
// adjust font, controlsize etc
DoSetWindowVariant( m_windowVariant ) ;
- m_peer->SetLabel( wxStripMenuCodes(m_label) ) ;
+ m_peer->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics) ) ;
if (!m_macIsUserPane)
SetInitialBestSize(size);
void wxWindowMac::SetLabel(const wxString& title)
{
- m_label = wxStripMenuCodes(title) ;
+ m_label = wxStripMenuCodes(title, wxStrip_Mnemonics) ;
if ( m_peer && m_peer->Ok() )
m_peer->SetLabel( m_label ) ;
void wxControl::SetLabel(const wxString& title)
{
- m_label = wxStripMenuCodes(title) ;
+ m_label = GetLabelText(title) ;
if ( m_macControl )
{
((Rect*)outBounds)->bottom = 0;
((Rect*)outBounds)->right = 0;
- wxMacStringToPascal( wxStripMenuCodes(label) , maclabel ) ;
+ wxMacStringToPascal( GetLabelText(label) , maclabel ) ;
}
void wxControl::MacPostControlCreate()
SetSize(pos.x, pos.y, new_size.x, new_size.y);
#if wxUSE_UNICODE
- UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ;
+ UMASetControlTitle( (ControlHandle) m_macControl , GetLabelText(m_label) , m_font.GetEncoding() ) ;
#endif
if ( m_macControlIsShown )
if( !CreateControl( parent, id, pos, size, style, validator, name ) )
return false;
- wxString label1(wxStripMenuCodes(label));
- wxXmString text( label1 );
+ wxXmString text( GetLabelText(label) );
Widget parentWidget = (Widget) parent->GetClientWidget();
name ) )
return false;
- wxString label1(wxStripMenuCodes(label));
- wxXmString text( label1 );
+ wxXmString text( GetLabelText(label) );
Widget parentWidget = (Widget) parent->GetClientWidget();
#ifndef XmNpositionIndex
wxCHECK_MSG( pos == GetCount(), -1, wxT("insert not implemented"));
#endif
- Widget w = XtVaCreateManagedWidget (wxStripMenuCodes(item),
+ Widget w = XtVaCreateManagedWidget (GetLabelText(item),
#if wxUSE_GADGETS
xmPushButtonGadgetClass, (Widget) m_menuWidget,
#else
if (!widget)
return;
- wxXmString label_str(wxStripMenuCodes(label));
+ wxXmString label_str(GetLabelText(label));
XtVaSetValues (widget,
XmNlabelString, label_str(),
XmNresizeWidth, True,
NULL);
- wxString label1(wxStripMenuCodes(title));
+ wxString label1(GetLabelText(title));
if (!label1.empty())
{
int i;
for (i = 0; i < n; i++)
{
- wxString str(wxStripMenuCodes(choices[i]));
+ wxString str(GetLabelText(choices[i]));
m_radioButtonLabels.push_back(str);
Widget radioItem = XtVaCreateManagedWidget (
wxConstCast(str.c_str(), char),
Widget widget = (Widget)m_radioButtons[item];
if (!label.empty())
{
- wxString label1(wxStripMenuCodes(label));
+ wxString label1(GetLabelText(label));
wxXmString text( label1 );
m_radioButtonLabels[item] = label1;
XtVaSetValues (widget,
Widget parentWidget = (Widget) parent->GetClientWidget();
Display* dpy = XtDisplay(parentWidget);
- wxString label1(wxStripMenuCodes(label));
+ wxString label1(GetLabelText(label));
wxXmString text( label1 );
if (!label.empty())
{
- wxString label1(wxStripMenuCodes(label));
+ wxString label1(GetLabelText(label));
wxXmString text(label1);
Display* dpy = XtDisplay( parentWidget );
Widget borderWidget =
(Widget) wxCreateBorderWidget( (WXWidget)parentWidget, style );
- wxXmString text( wxStripMenuCodes( label ) );
+ wxXmString text( GetLabelText( label ) );
m_labelWidget =
XtVaCreateManagedWidget (wxConstCast(name.c_str(), char),
void wxStaticText::SetLabel(const wxString& label)
{
- wxXmString label_str(wxStripMenuCodes(label));
+ wxXmString label_str(GetLabelText(label));
// This variable means we don't need so many casts later.
Widget widget = (Widget) m_labelWidget;
wxCoord wBtn,
hBtn;
- dc.GetMultiLineTextExtent(wxStripMenuCodes(GetLabel()), &wBtn, &hBtn);
+ dc.GetMultiLineTextExtent(GetLabelText(), &wBtn, &hBtn);
// add a margin -- the button is wider than just its label
wBtn += 3*GetCharWidth();
COLORREF colFg = wxColourToRGB(GetForegroundColour());
DrawButtonText(hdc, &rectBtn,
- (state & ODS_NOACCEL ? wxStripMenuCodes(GetLabel())
- : GetLabel()),
+ state & ODS_NOACCEL ? GetLabelText()
+ : GetLabel(),
state & ODS_DISABLED ? GetSysColor(COLOR_GRAYTEXT)
: colFg);
int wCheckbox, hCheckbox;
if ( !str.empty() )
{
- GetTextExtent(wxStripMenuCodes(str), &wCheckbox, &hCheckbox);
+ GetTextExtent(GetLabelText(str), &wCheckbox, &hCheckbox);
wCheckbox += s_checkSize + GetCharWidth();
if ( hCheckbox < s_checkSize )
// and also wide enough for its label
int widthLabel;
- GetTextExtent(wxStripMenuCodes(GetLabel()), &widthLabel, NULL);
+ GetTextExtent(GetLabelText(), &widthLabel, NULL);
widthLabel += RADIO_SIZE; // FIXME this is bogus too
if ( widthLabel > width )
width = widthLabel;
int wRadio, hRadio;
if ( !str.empty() )
{
- GetTextExtent(wxStripMenuCodes(str), &wRadio, &hRadio);
+ GetTextExtent(GetLabelText(str), &wRadio, &hRadio);
wRadio += s_radioSize + GetCharWidth();
if ( hRadio < s_radioSize )
wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
int wBox;
- GetTextExtent(wxStripMenuCodes(wxGetWindowText(m_hWnd)), &wBox, &cy);
+ GetTextExtent(GetLabelText(wxGetWindowText(m_hWnd)), &wBox, &cy);
wBox += 3*cx;
int hBox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
dc.SetFont(font);
wxCoord widthTextMax, heightTextTotal;
- dc.GetMultiLineTextExtent(::wxStripMenuCodes(GetLabel()),
- &widthTextMax, &heightTextTotal);
+ dc.GetMultiLineTextExtent(GetLabelText(), &widthTextMax, &heightTextTotal);
#ifdef __WXWINCE__
if ( widthTextMax )
{
wxString label = wxGetWindowText(GetHWND());
int wBtn;
- GetTextExtent(wxStripMenuCodes(label), &wBtn, NULL);
+ GetTextExtent(GetLabelText(label), &wBtn, NULL);
int wChar, hChar;
wxGetCharSize(GetHWND(), &wChar, &hChar, GetFont());