]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/control.cpp
423c53e5804742cba120ccd3c55956570f3a8ee9
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "control.h"
16 #include "wx/control.h"
21 #pragma message disable nosimpint
25 #pragma message enable nosimpint
28 IMPLEMENT_ABSTRACT_CLASS(wxControl
, wxWindow
)
30 BEGIN_EVENT_TABLE(wxControl
, wxWindow
)
34 wxControl::wxControl()
36 m_backgroundColour
= *wxWHITE
;
37 m_foregroundColour
= *wxBLACK
;
39 #if WXWIN_COMPATIBILITY
41 #endif // WXWIN_COMPATIBILITY
46 wxControl::~wxControl()
48 // If we delete an item, we should initialize the parent panel,
49 // because it could now be invalid.
50 wxPanel
*panel
= wxDynamicCast(GetParent(), wxPanel
);
53 if (panel
->GetDefaultItem() == this)
54 panel
->SetDefaultItem((wxButton
*) NULL
);
58 void wxControl::SetLabel(const wxString
& label
)
60 Widget widget
= (Widget
) GetLabelWidget() ;
64 wxStripMenuCodes((char*) (const char*) label
, wxBuffer
);
66 XmString text
= XmStringCreateSimple (wxBuffer
);
67 XtVaSetValues (widget
,
69 XmNlabelType
, XmSTRING
,
74 wxString
wxControl::GetLabel() const
76 Widget widget
= (Widget
) GetLabelWidget() ;
82 XtVaGetValues (widget
,
83 XmNlabelString
, &text
,
86 if (XmStringGetLtoR (text
, XmSTRING_DEFAULT_CHARSET
, &s
))
95 // XmStringFree(text);
100 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
102 #if WXWIN_COMPATIBILITY
105 (void)(*m_callback
)(this, event
);
110 #endif // WXWIN_COMPATIBILITY
112 return GetEventHandler()->ProcessEvent(event
);