]>
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 bool wxControl::CreateControl(wxWindow
*parent
,
72 const wxValidator
& validator
,
75 if( !wxControlBase::CreateControl( parent
, id
, pos
, size
, style
,
79 m_backgroundColour
= parent
->GetBackgroundColour();
80 m_foregroundColour
= parent
->GetForegroundColour();
81 m_font
= parent
->GetFont();
86 void wxControl::SetLabel(const wxString
& label
)
88 Widget widget
= (Widget
) GetLabelWidget() ;
92 wxXmString
label_str(wxStripMenuCodes(label
));
94 XtVaSetValues (widget
,
95 XmNlabelString
, label_str(),
96 XmNlabelType
, XmSTRING
,
100 wxString
wxControl::GetLabel() const
102 Widget widget
= (Widget
) GetLabelWidget() ;
104 return wxEmptyString
;
107 XtVaGetValues (widget
,
108 XmNlabelString
, &text
,
111 return wxXmStringToString( text
);
114 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
116 #if WXWIN_COMPATIBILITY
119 (void)(*m_callback
)(this, event
);
124 #endif // WXWIN_COMPATIBILITY
126 return GetEventHandler()->ProcessEvent(event
);