1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxAcceleratorTable class
4 // Author: Robert Roebling
6 // Copyright: (c) Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
14 #pragma interface "accel.h"
18 #include "wx/object.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class wxAcceleratorEntry
;
26 class wxAcceleratorTable
;
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 extern wxAcceleratorTable wxNullAcceleratorTable
;
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
39 #define wxACCEL_ALT 0x01
42 #define wxACCEL_CTRL 0x02
44 // Hold Shift key down
45 #define wxACCEL_SHIFT 0x04
48 #define wxACCEL_NORMAL 0x00
50 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
54 class wxAcceleratorEntry
: public wxObject
58 wxAcceleratorEntry(int flags
= 0, int keyCode
= 0, int cmd
= 0)
59 { m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
; }
61 inline void Set(int flags
, int keyCode
, int cmd
)
62 { m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
; }
64 inline int GetFlags() const { return m_flags
; }
65 inline int GetKeyCode() const { return m_keyCode
; }
66 inline int GetCommand() const { return m_command
; }
69 int m_keyCode
; // ASCII or virtual keycode
70 int m_command
; // Command id to generate
73 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
77 class wxAcceleratorTable
: public wxObject
79 DECLARE_DYNAMIC_CLASS(wxAcceleratorTable
)
83 wxAcceleratorTable(int n
, wxAcceleratorEntry entries
[] );
84 ~wxAcceleratorTable();
86 inline wxAcceleratorTable(const wxAcceleratorTable
& accel
) : wxObject()
88 inline wxAcceleratorTable(const wxAcceleratorTable
* accel
)
89 { if (accel
) Ref(*accel
); }
90 inline bool operator == (const wxAcceleratorTable
& accel
)
91 { return m_refData
== accel
.m_refData
; }
92 inline bool operator != (const wxAcceleratorTable
& accel
)
93 { return m_refData
!= accel
.m_refData
; }
94 inline wxAcceleratorTable
& operator = (const wxAcceleratorTable
& accel
)
95 { if (*this == accel
) return (*this); Ref(accel
); return *this; }
101 int GetCommand( wxKeyEvent
&event
);