X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa61d3525370a9b9fa8c797d9b7f89d96994db5f..9d8fe14a97d1092989eecbe43c4e1f730fba17ad:/src/motif/choice.cpp diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index 04531704ee..6c7edaa117 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -20,8 +20,11 @@ #endif #include "wx/choice.h" -#include "wx/utils.h" -#include "wx/arrstr.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/arrstr.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -68,6 +71,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, { if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; + PreCreation(); Widget parentWidget = (Widget) parent->GetClientWidget(); @@ -135,9 +139,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL); - ChangeFont(false); - ChangeBackgroundColour(); - + PostCreation(); AttachWidget (parent, m_buttonWidget, m_formWidget, pos.x, pos.y, bestSize.x, bestSize.y); @@ -192,7 +194,7 @@ int wxChoice::DoInsert(const wxString& item, unsigned int pos) #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 @@ -447,7 +449,7 @@ void wxChoice::ChangeFont(bool keepOriginalSize) // Note that this causes the widget to be resized back // to its original size! We therefore have to set the size // back again. TODO: a better way in Motif? - if (m_font.Ok()) + if (m_mainWidget && m_font.Ok()) { Display* dpy = XtDisplay((Widget) m_mainWidget); int width, height, width1, height1;