]>
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 #include "wx/motif/private.h"
32 IMPLEMENT_ABSTRACT_CLASS(wxControl
, wxWindow
)
34 BEGIN_EVENT_TABLE(wxControl
, wxWindow
)
38 wxControl::wxControl()
40 m_backgroundColour
= *wxWHITE
;
41 m_foregroundColour
= *wxBLACK
;
43 #if WXWIN_COMPATIBILITY
45 #endif // WXWIN_COMPATIBILITY
50 bool wxControl::Create( wxWindow
*parent
,
55 const wxValidator
& validator
,
58 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
61 SetValidator(validator
);
67 void wxControl::SetLabel(const wxString
& label
)
69 Widget widget
= (Widget
) GetLabelWidget() ;
73 wxString
buf(wxStripMenuCodes(label
));
74 wxXmString
label_str(buf
);
76 XtVaSetValues (widget
,
77 XmNlabelString
, label_str(),
78 XmNlabelType
, XmSTRING
,
82 wxString
wxControl::GetLabel() const
84 Widget widget
= (Widget
) GetLabelWidget() ;
90 XtVaGetValues (widget
,
91 XmNlabelString
, &text
,
94 if (XmStringGetLtoR (text
, XmSTRING_DEFAULT_CHARSET
, &s
))
103 // XmStringFree(text);
104 return wxEmptyString
;
108 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
110 #if WXWIN_COMPATIBILITY
113 (void)(*m_callback
)(this, event
);
118 #endif // WXWIN_COMPATIBILITY
120 return GetEventHandler()->ProcessEvent(event
);