]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/control.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / motif / control.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/control.h
3 // Purpose: wxControl class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_CONTROL_H_
12 #define _WX_CONTROL_H_
13
14 #include "wx/window.h"
15 #include "wx/list.h"
16 #include "wx/validate.h"
17
18 // General item class
19 class WXDLLIMPEXP_CORE wxControl: public wxControlBase
20 {
21 DECLARE_ABSTRACT_CLASS(wxControl)
22
23 public:
24 wxControl();
25 wxControl( wxWindow *parent,
26 wxWindowID id,
27 const wxPoint &pos = wxDefaultPosition,
28 const wxSize &size = wxDefaultSize,
29 long style = 0,
30 const wxValidator& validator = wxDefaultValidator,
31 const wxString &name = wxControlNameStr )
32 {
33 Create(parent, id, pos, size, style, validator, name);
34 }
35
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);
41
42 // simulates the event, returns true if the event was processed
43 virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
44
45 // calls the callback and appropriate event handlers, returns true if
46 // event was processed
47 virtual bool ProcessCommand(wxCommandEvent& event);
48
49 virtual void SetLabel(const wxString& label);
50 virtual wxString GetLabel() const ;
51
52 bool InSetValue() const { return m_inSetValue; }
53
54 protected:
55 // calls wxControlBase::CreateControl, also sets foreground, background and
56 // font to parent's values
57 bool CreateControl(wxWindow *parent,
58 wxWindowID id,
59 const wxPoint& pos,
60 const wxSize& size,
61 long style,
62 const wxValidator& validator,
63 const wxString& name);
64
65 // native implementation using XtQueryGeometry
66 virtual wxSize DoGetBestSize() const;
67
68 // Motif: prevent callbacks being called while in SetValue
69 bool m_inSetValue;
70
71 DECLARE_EVENT_TABLE()
72 };
73
74 #endif // _WX_CONTROL_H_