]>
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 wxString
buf(wxStripMenuCodes(label
));
93 wxXmString
label_str(buf
);
95 XtVaSetValues (widget
,
96 XmNlabelString
, label_str(),
97 XmNlabelType
, XmSTRING
,
101 wxString
wxControl::GetLabel() const
103 Widget widget
= (Widget
) GetLabelWidget() ;
105 return wxEmptyString
;
109 XtVaGetValues (widget
,
110 XmNlabelString
, &text
,
113 if (XmStringGetLtoR (text
, XmSTRING_DEFAULT_CHARSET
, &s
))
122 // XmStringFree(text);
123 return wxEmptyString
;
127 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
129 #if WXWIN_COMPATIBILITY
132 (void)(*m_callback
)(this, event
);
137 #endif // WXWIN_COMPATIBILITY
139 return GetEventHandler()->ProcessEvent(event
);