]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/control.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "control.h"
18 #include "wx/control.h"
23 #pragma message disable nosimpint
27 #pragma message enable nosimpint
30 IMPLEMENT_ABSTRACT_CLASS(wxControl
, wxWindow
)
32 BEGIN_EVENT_TABLE(wxControl
, wxWindow
)
36 wxControl::wxControl()
38 m_backgroundColour
= *wxWHITE
;
39 m_foregroundColour
= *wxBLACK
;
41 #if WXWIN_COMPATIBILITY
43 #endif // WXWIN_COMPATIBILITY
48 bool wxControl::Create( wxWindow
*parent
,
53 const wxValidator
& validator
,
56 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
59 SetValidator(validator
);
65 void wxControl::SetLabel(const wxString
& label
)
67 Widget widget
= (Widget
) GetLabelWidget() ;
71 wxString
buf(wxStripMenuCodes());
72 wxXmString
label_str(buf
);
74 XtVaSetValues (widget
,
75 XmNlabelString
, label_str
,
76 XmNlabelType
, XmSTRING
,
80 wxString
wxControl::GetLabel() const
82 Widget widget
= (Widget
) GetLabelWidget() ;
88 XtVaGetValues (widget
,
89 XmNlabelString
, &text
,
92 if (XmStringGetLtoR (text
, XmSTRING_DEFAULT_CHARSET
, &s
))
101 // XmStringFree(text);
102 return wxEmptyString
;
106 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
108 #if WXWIN_COMPATIBILITY
111 (void)(*m_callback
)(this, event
);
116 #endif // WXWIN_COMPATIBILITY
118 return GetEventHandler()->ProcessEvent(event
);