1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/control.h
3 // Purpose: wxControl class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_CONTROL_H_
12 #define _WX_CONTROL_H_
14 #include "wx/window.h"
16 #include "wx/validate.h"
19 class WXDLLIMPEXP_CORE wxControl
: public wxControlBase
21 DECLARE_ABSTRACT_CLASS(wxControl
)
25 wxControl( wxWindow
*parent
,
27 const wxPoint
&pos
= wxDefaultPosition
,
28 const wxSize
&size
= wxDefaultSize
,
30 const wxValidator
& validator
= wxDefaultValidator
,
31 const wxString
&name
= wxControlNameStr
)
33 Create(parent
, id
, pos
, size
, style
, validator
, name
);
36 bool Create(wxWindow
*parent
, wxWindowID id
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
, long style
= 0,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxControlNameStr
);
42 // simulates the event, returns true if the event was processed
43 virtual void Command(wxCommandEvent
& WXUNUSED(event
)) { }
45 // calls the callback and appropriate event handlers, returns true if
46 // event was processed
47 virtual bool ProcessCommand(wxCommandEvent
& event
);
49 virtual void SetLabel(const wxString
& label
);
50 virtual wxString
GetLabel() const ;
52 bool InSetValue() const { return m_inSetValue
; }
55 // calls wxControlBase::CreateControl, also sets foreground, background and
56 // font to parent's values
57 bool CreateControl(wxWindow
*parent
,
62 const wxValidator
& validator
,
63 const wxString
& name
);
65 // native implementation using XtQueryGeometry
66 virtual wxSize
DoGetBestSize() const;
68 // Motif: prevent callbacks being called while in SetValue
74 #endif // _WX_CONTROL_H_