]>
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 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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
;
46 bool wxControl::Create( wxWindow
*parent
,
51 const wxValidator
& validator
,
54 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
57 SetValidator(validator
);
63 bool wxControl::CreateControl(wxWindow
*parent
,
68 const wxValidator
& validator
,
71 if( !wxControlBase::CreateControl( parent
, id
, pos
, size
, style
,
75 m_backgroundColour
= parent
->GetBackgroundColour();
76 m_foregroundColour
= parent
->GetForegroundColour();
77 m_font
= parent
->GetFont();
82 void wxControl::SetLabel(const wxString
& label
)
84 Widget widget
= (Widget
) GetLabelWidget() ;
88 wxXmString
label_str(wxStripMenuCodes(label
));
90 XtVaSetValues (widget
,
91 XmNlabelString
, label_str(),
92 XmNlabelType
, XmSTRING
,
96 wxString
wxControl::GetLabel() const
98 Widget widget
= (Widget
) GetLabelWidget() ;
100 return wxEmptyString
;
103 XtVaGetValues (widget
,
104 XmNlabelString
, &text
,
107 return wxXmStringToString( text
);
110 bool wxControl::ProcessCommand(wxCommandEvent
& event
)
112 return GetEventHandler()->ProcessEvent(event
);