1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxAcceleratorTable class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "accel.h"
19 #include "wx/object.h"
21 class WXDLLEXPORT wxAcceleratorTable
;
24 #define wxACCEL_ALT 0x01
27 #define wxACCEL_CTRL 0x02
29 // Hold Shift key down
30 #define wxACCEL_SHIFT 0x04
33 #define wxACCEL_NORMAL 0x00
35 class WXDLLEXPORT wxAcceleratorEntry
38 wxAcceleratorEntry(int flags
= 0, int keyCode
= 0, int cmd
= 0)
40 m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
;
43 inline void Set(int flags
, int keyCode
, int cmd
)
44 { m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
; }
46 inline int GetFlags() const { return m_flags
; }
47 inline int GetKeyCode() const { return m_keyCode
; }
48 inline int GetCommand() const { return m_command
; }
51 int m_keyCode
; // ASCII or virtual keycode
52 int m_command
; // Command id to generate
55 class WXDLLEXPORT wxAcceleratorTable
: public wxObject
57 DECLARE_DYNAMIC_CLASS(wxAcceleratorTable
)
60 wxAcceleratorTable(const wxString
& resource
); // Load from .rc resource
61 wxAcceleratorTable(int n
, const wxAcceleratorEntry entries
[]); // Load from array
64 inline wxAcceleratorTable(const wxAcceleratorTable
& accel
) { Ref(accel
); }
65 inline wxAcceleratorTable(const wxAcceleratorTable
* accel
) { if (accel
) Ref(*accel
); }
67 ~wxAcceleratorTable();
69 inline wxAcceleratorTable
& operator = (const wxAcceleratorTable
& accel
) { if (*this == accel
) return (*this); Ref(accel
); return *this; }
70 inline bool operator == (const wxAcceleratorTable
& accel
) { return m_refData
== accel
.m_refData
; }
71 inline bool operator != (const wxAcceleratorTable
& accel
) { return m_refData
!= accel
.m_refData
; }
74 void SetHACCEL(WXHACCEL hAccel
);
75 WXHACCEL
GetHACCEL() const;
78 WXDLLEXPORT_DATA(extern wxAcceleratorTable
) wxNullAcceleratorTable
;