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; return FALSE;
} }
// the base class version which m_label = label;
// will not set the label's text to it m_widget = gtk_label_new( wxGTK_CONV( GTKRemoveMnemonics(label)) );
// 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 ) );
GtkJustification justify; GtkJustification justify;
if ( style & wxALIGN_CENTER ) if ( style & wxALIGN_CENTER )
@@ -100,18 +95,13 @@ wxString wxStaticText::GetLabel() const
void wxStaticText::SetLabel( const wxString &label ) void wxStaticText::SetLabel( const wxString &label )
{ {
wxControl::SetLabel(label); wxCHECK_RET( m_widget != NULL, wxT("invalid static text") );
wxString label1(wxStripMenuCodes(label)); GTKSetLabelForLabel(GTK_LABEL(m_widget), label);
gtk_label_set( GTK_LABEL(m_widget), wxGTK_CONV( label1 ) );
// adjust the label size to the new label unless disabled // adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE)) if (!HasFlag(wxST_NO_AUTORESIZE))
{
InvalidateBestSize();
SetSize( GetBestSize() ); SetSize( GetBestSize() );
}
} }
bool wxStaticText::SetFont( const wxFont &font ) bool wxStaticText::SetFont( const wxFont &font )