]>
Commit | Line | Data |
---|---|---|
9b6dbb09 | 1 | ///////////////////////////////////////////////////////////////////////////// |
925f7740 | 2 | // Name: wx/motif/control.h |
9b6dbb09 JS |
3 | // Purpose: wxControl class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
9b6dbb09 | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
9b6dbb09 JS |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_CONTROL_H_ | |
12 | #define _WX_CONTROL_H_ | |
13 | ||
9b6dbb09 JS |
14 | #include "wx/window.h" |
15 | #include "wx/list.h" | |
16 | #include "wx/validate.h" | |
17 | ||
18 | // General item class | |
53a2db12 | 19 | class WXDLLIMPEXP_CORE wxControl: public wxControlBase |
9b6dbb09 | 20 | { |
a4294b78 | 21 | DECLARE_ABSTRACT_CLASS(wxControl) |
925f7740 | 22 | |
9b6dbb09 | 23 | public: |
a4294b78 | 24 | wxControl(); |
0148fe1e | 25 | wxControl( wxWindow *parent, |
83df96d6 JS |
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 ) | |
5a2155ef BJ |
32 | { |
33 | Create(parent, id, pos, size, style, validator, name); | |
34 | } | |
925f7740 | 35 | |
5a2155ef | 36 | bool Create(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
37 | const wxPoint& pos = wxDefaultPosition, |
38 | const wxSize& size = wxDefaultSize, long style = 0, | |
39 | const wxValidator& validator = wxDefaultValidator, | |
40 | const wxString& name = wxControlNameStr); | |
925f7740 | 41 | |
0c02f070 | 42 | // simulates the event, returns true if the event was processed |
31528cd3 | 43 | virtual void Command(wxCommandEvent& WXUNUSED(event)) { } |
925f7740 | 44 | |
0c02f070 | 45 | // calls the callback and appropriate event handlers, returns true if |
31528cd3 VZ |
46 | // event was processed |
47 | virtual bool ProcessCommand(wxCommandEvent& event); | |
925f7740 | 48 | |
a4294b78 JS |
49 | virtual void SetLabel(const wxString& label); |
50 | virtual wxString GetLabel() const ; | |
925f7740 | 51 | |
7491d644 | 52 | bool InSetValue() const { return m_inSetValue; } |
925f7740 | 53 | |
9b6dbb09 | 54 | protected: |
ec75d791 MB |
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 | ||
0c02f070 MB |
65 | // native implementation using XtQueryGeometry |
66 | virtual wxSize DoGetBestSize() const; | |
67 | ||
70dc287a VZ |
68 | // Motif: prevent callbacks being called while in SetValue |
69 | bool m_inSetValue; | |
925f7740 | 70 | |
a4294b78 | 71 | DECLARE_EVENT_TABLE() |
9b6dbb09 JS |
72 | }; |
73 | ||
70dc287a | 74 | #endif // _WX_CONTROL_H_ |