use GTKRemoveMnemonics instead of wxStripMenuCodes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-02-05 23:02:47 +00:00
parent ee6dd41a50
commit 2ce89389bf

View File

@@ -61,13 +61,8 @@ bool wxStaticText::Create(wxWindow *parent,
return FALSE;
}
// the base class version which
// will not set the label's text to it
// because the label is not yet created and because SetLabel() has a side
// effect of changing the control size which might not be desirable
wxString label1(wxStripMenuCodes(label));
wxControl::SetLabel(label);
m_widget = gtk_label_new( wxGTK_CONV( label1 ) );
m_label = label;
m_widget = gtk_label_new( wxGTK_CONV( GTKRemoveMnemonics(label)) );
GtkJustification justify;
if ( style & wxALIGN_CENTER )
@@ -100,18 +95,13 @@ wxString wxStaticText::GetLabel() const
void wxStaticText::SetLabel( const wxString &label )
{
wxControl::SetLabel(label);
wxCHECK_RET( m_widget != NULL, wxT("invalid static text") );
wxString label1(wxStripMenuCodes(label));
gtk_label_set( GTK_LABEL(m_widget), wxGTK_CONV( label1 ) );
GTKSetLabelForLabel(GTK_LABEL(m_widget), label);
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
InvalidateBestSize();
SetSize( GetBestSize() );
}
}
bool wxStaticText::SetFont( const wxFont &font )