]>
Commit | Line | Data |
---|---|---|
21aeca5e VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/generic/accel.h | |
3 | // Purpose: wxAcceleratorTable class | |
4 | // Author: Robert Roebling | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) Robert Roebling | |
65571936 | 7 | // Licence: wxWindows licence |
21aeca5e VZ |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifndef _WX_GENERIC_ACCEL_H_ | |
11 | #define _WX_GENERIC_ACCEL_H_ | |
12 | ||
21aeca5e VZ |
13 | class WXDLLEXPORT wxKeyEvent; |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // wxAcceleratorTable | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | class WXDLLEXPORT wxAcceleratorTable : public wxObject | |
20 | { | |
21 | public: | |
22 | wxAcceleratorTable(); | |
3c674514 | 23 | wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); |
21aeca5e VZ |
24 | virtual ~wxAcceleratorTable(); |
25 | ||
26 | wxAcceleratorTable(const wxAcceleratorTable& accel) | |
d84afea9 GD |
27 | : wxObject() |
28 | { Ref(accel); } | |
21aeca5e VZ |
29 | wxAcceleratorTable& operator=(const wxAcceleratorTable& accel) |
30 | { if ( m_refData != accel.m_refData ) Ref(accel); return *this; } | |
31 | ||
84df1042 | 32 | #if WXWIN_COMPATIBILITY_2_4 |
21aeca5e | 33 | bool operator==(const wxAcceleratorTable& accel) const |
84df1042 | 34 | { return m_refData == accel.m_refData; } |
21aeca5e VZ |
35 | bool operator!=(const wxAcceleratorTable& accel) const |
36 | { return !(*this == accel); } | |
84df1042 | 37 | #endif |
21aeca5e VZ |
38 | |
39 | bool Ok() const; | |
40 | ||
41 | void Add(const wxAcceleratorEntry& entry); | |
42 | void Remove(const wxAcceleratorEntry& entry); | |
43 | ||
44 | // implementation | |
45 | // -------------- | |
46 | ||
47 | wxMenuItem *GetMenuItem(const wxKeyEvent& event) const; | |
48 | int GetCommand(const wxKeyEvent& event) const; | |
49 | ||
50 | const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const; | |
51 | ||
fa03793d VS |
52 | protected: |
53 | // ref counting code | |
54 | virtual wxObjectRefData *CreateRefData() const; | |
55 | virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; | |
56 | ||
21aeca5e VZ |
57 | private: |
58 | DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) | |
59 | }; | |
60 | ||
61 | #endif // _WX_GENERIC_ACCEL_H_ | |
62 |