]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/control.h
Added wxMenu::Delete() and fixed some menu deleted memory
[wxWidgets.git] / include / wx / motif / control.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: control.h
3 // Purpose: wxControl class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CONTROL_H_
13 #define _WX_CONTROL_H_
14
15 #ifdef __GNUG__
16 #pragma interface "control.h"
17 #endif
18
19 #include "wx/window.h"
20 #include "wx/list.h"
21 #include "wx/validate.h"
22
23 // General item class
24 class WXDLLEXPORT wxControl: public wxWindow
25 {
26 DECLARE_ABSTRACT_CLASS(wxControl)
27
28 public:
29 wxControl();
30 ~wxControl();
31
32 // simulates the event, returns TRUE if the event was processed
33 virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
34
35 // calls the callback and appropriate event handlers, returns TRUE if
36 // event was processed
37 virtual bool ProcessCommand(wxCommandEvent& event);
38
39 virtual void SetLabel(const wxString& label);
40 virtual wxString GetLabel() const ;
41
42 #if WXWIN_COMPATIBILITY
43 void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
44
45 wxFunction GetCallback() { return m_callback; }
46 #endif // WXWIN_COMPATIBILITY
47
48 bool InSetValue() const { return m_inSetValue; }
49
50 protected:
51 #if WXWIN_COMPATIBILITY
52 wxFunction m_callback; // Callback associated with the window
53 #endif // WXWIN_COMPATIBILITY
54
55 bool m_inSetValue; // Motif: prevent callbacks being called while
56 // in SetValue
57
58 DECLARE_EVENT_TABLE()
59 };
60
61 #endif
62 // _WX_CONTROL_H_