]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/accel.h
added assignment operators from int for disambiguation of expressions such as ll=0
[wxWidgets.git] / include / wx / generic / accel.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/accel.h
3 // Purpose: wxAcceleratorTable class
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GENERIC_ACCEL_H_
11 #define _WX_GENERIC_ACCEL_H_
12
13 class WXDLLEXPORT wxKeyEvent;
14
15 // ----------------------------------------------------------------------------
16 // wxAcceleratorTable
17 // ----------------------------------------------------------------------------
18
19 class WXDLLEXPORT wxAcceleratorTable : public wxObject
20 {
21 public:
22 wxAcceleratorTable();
23 wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
24 virtual ~wxAcceleratorTable();
25
26 #if WXWIN_COMPATIBILITY_2_4
27 bool operator==(const wxAcceleratorTable& accel) const
28 { return m_refData == accel.m_refData; }
29 bool operator!=(const wxAcceleratorTable& accel) const
30 { return !(*this == accel); }
31 #endif
32
33 bool Ok() const;
34
35 void Add(const wxAcceleratorEntry& entry);
36 void Remove(const wxAcceleratorEntry& entry);
37
38 // implementation
39 // --------------
40
41 wxMenuItem *GetMenuItem(const wxKeyEvent& event) const;
42 int GetCommand(const wxKeyEvent& event) const;
43
44 const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const;
45
46 protected:
47 // ref counting code
48 virtual wxObjectRefData *CreateRefData() const;
49 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
50
51 private:
52 DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
53 };
54
55 #endif // _WX_GENERIC_ACCEL_H_
56