From 1c49eb00dc68240ec38ce2f60d5965e351e4aa13 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 16 Nov 2003 11:05:24 +0000 Subject: [PATCH] Applied patch #840617 from Ian Brown: "motif 2.4.2, menu codes in static text" git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@24571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/motif/stattext.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index 722ea20e7b..f04edb1b8b 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -97,30 +97,22 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, ); } -#if 0 // gcc 2.95 doesn't like this apparently - // Use XmStringCreateLtoR(), since XmStringCreateSimple - // doesn't obey separators. -// XmString text = XmStringCreateSimple (label1); - XmString text = XmStringCreateLtoR (label1, XmSTRING_DEFAULT_CHARSET); -#endif // 0 - - XmString text = XmStringCreateLtoR ((char *)(const char*)label, XmSTRING_DEFAULT_CHARSET); - + wxString buf(wxStripMenuCodes(label)); + wxXmString label_str(buf); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_labelWidget = XtVaCreateManagedWidget ((char*) (const char*) name, xmLabelWidgetClass, borderWidget ? borderWidget : parentWidget, XmNfontList, fontList, - XmNlabelString, text, + XmNlabelString, label_str(), XmNalignment, ((style & wxALIGN_RIGHT) ? XmALIGNMENT_END : ((style & wxALIGN_CENTRE) ? XmALIGNMENT_CENTER : XmALIGNMENT_BEGINNING)), NULL); - XmStringFree (text); - m_mainWidget = borderWidget ? borderWidget : m_labelWidget; SetCanAddEventHandler(TRUE);