]>
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 wxStripMenuCodes((char*) (const char*) label
, wxBuffer
);
73 XmString text
= XmStringCreateSimple (wxBuffer
);
74 XtVaSetValues (widget
,
76 XmNlabelType
, XmSTRING
,
81 wxString
wxControl::GetLabel() const
83 Widget widget
= (Widget
) GetLabelWidget() ;
89 XtVaGetValues (widget
,
90 XmNlabelString
, &text
,
93 if (XmStringGetLtoR (text
, XmSTRING_DEFAULT_CHARSET
, &s
))
102 // XmStringFree(text);
103 return wxEmptyString
;
107 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
109 #if WXWIN_COMPATIBILITY
112 (void)(*m_callback
)(this, event
);
117 #endif // WXWIN_COMPATIBILITY
119 return GetEventHandler()->ProcessEvent(event
);