diff --git a/include/wx/motif/stattext.h b/include/wx/motif/stattext.h index e64de49452..336ff7ae76 100644 --- a/include/wx/motif/stattext.h +++ b/include/wx/motif/stattext.h @@ -56,6 +56,7 @@ public: virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeBackgroundColour(); virtual void ChangeForegroundColour(); + virtual void SetLabel(const wxString& label); // Get the widget that corresponds to the label (for font setting, label setting etc.) virtual WXWidget GetLabelWidget() const diff --git a/src/makeg95.env b/src/makeg95.env index 46c9254159..39f402da26 100644 --- a/src/makeg95.env +++ b/src/makeg95.env @@ -15,8 +15,8 @@ MINGW32=1 # Set to the version you have -MINGW32VERSION=2.95 -#MINGW32VERSION=3.0 +#MINGW32VERSION=2.95 +MINGW32VERSION=3.0 # If building DLL, the version WXVERSION=233 diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index 2b4166a75a..722ea20e7b 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -33,6 +33,8 @@ #pragma message enable nosimpint #endif +#include "wx/motif/private.h" + IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) bool wxStaticText::Create(wxWindow *parent, wxWindowID id, @@ -144,3 +146,36 @@ void wxStaticText::ChangeForegroundColour() wxWindow::ChangeForegroundColour(); } +void wxStaticText::SetLabel(const wxString& label) +{ + wxString buf(wxStripMenuCodes(label)); + wxXmString label_str(buf); + + // This variable means we don't need so many casts later. + Widget widget = (Widget) m_labelWidget; + + if (GetWindowStyle() & wxST_NO_AUTORESIZE) + { + XtUnmanageChild(widget); + Dimension width, height; + XtVaGetValues(widget, XmNwidth, &width, XmNheight, &height, NULL); + + XtVaSetValues(widget, + XmNlabelString, label_str(), + XmNlabelType, XmSTRING, + NULL); + XtVaSetValues(widget, + XmNwidth, width, + XmNheight, height, + NULL); + XtManageChild(widget); + } + else + { + XtVaSetValues(widget, + XmNlabelString, label_str(), + XmNlabelType, XmSTRING, + NULL); + } +} +