X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a2155efdb30931a19c2686511887966feb0c470..1f361cddbfcff9c54eef6b8c447d2b93ee2825f5:/src/motif/control.cpp diff --git a/src/motif/control.cpp b/src/motif/control.cpp index 4a79908477..1dc7e344c5 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -13,6 +13,8 @@ #pragma implementation "control.h" #endif +#include "wx/defs.h" + #include "wx/control.h" #include "wx/panel.h" #include "wx/utils.h" @@ -25,6 +27,8 @@ #pragma message enable nosimpint #endif +#include "wx/motif/private.h" + IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) BEGIN_EVENT_TABLE(wxControl, wxWindow) @@ -60,32 +64,19 @@ bool wxControl::Create( wxWindow *parent, return ret; } -wxControl::~wxControl() -{ - // If we delete an item, we should initialize the parent panel, - // because it could now be invalid. - wxPanel *panel = wxDynamicCast(GetParent(), wxPanel); - if (panel) - { - if (panel->GetDefaultItem() == this) - panel->SetDefaultItem((wxButton*) NULL); - } -} - void wxControl::SetLabel(const wxString& label) { Widget widget = (Widget) GetLabelWidget() ; if (!widget) return; - wxStripMenuCodes((char*) (const char*) label, wxBuffer); + wxString buf(wxStripMenuCodes(label)); + wxXmString label_str(buf); - XmString text = XmStringCreateSimple (wxBuffer); XtVaSetValues (widget, - XmNlabelString, text, + XmNlabelString, label_str(), XmNlabelType, XmSTRING, NULL); - XmStringFree (text); } wxString wxControl::GetLabel() const