1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxAcceleratorTable class
8 // Copyright: (c) AUTHOR
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
32 class WXDLLEXPORT wxAcceleratorEntry
35 wxAcceleratorEntry(int flags
= 0, int keyCode
= 0, int cmd
= 0)
37 m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
;
40 inline void Set(int flags
, int keyCode
, int cmd
)
41 { m_flags
= flags
; m_keyCode
= keyCode
; m_command
= cmd
; }
43 inline int GetFlags() const { return m_flags
; }
44 inline int GetKeyCode() const { return m_keyCode
; }
45 inline int GetCommand() const { return m_command
; }
48 int m_keyCode
; // ASCII or virtual keycode
49 int m_command
; // Command id to generate
52 class WXDLLEXPORT wxAcceleratorTable
: public wxObject
54 DECLARE_DYNAMIC_CLASS(wxAcceleratorTable
)
57 wxAcceleratorTable(const wxString
& resource
); // Load from .rc resource
58 wxAcceleratorTable(int n
, wxAcceleratorEntry entries
[]); // Load from array
61 inline wxAcceleratorTable(const wxAcceleratorTable
& accel
) { Ref(accel
); }
62 inline wxAcceleratorTable(const wxAcceleratorTable
* accel
) { if (accel
) Ref(*accel
); }
64 ~wxAcceleratorTable();
66 inline wxAcceleratorTable
& operator = (const wxAcceleratorTable
& accel
) { if (*this == accel
) return (*this); Ref(accel
); return *this; }
67 inline bool operator == (const wxAcceleratorTable
& accel
) { return m_refData
== accel
.m_refData
; }
68 inline bool operator != (const wxAcceleratorTable
& accel
) { return m_refData
!= accel
.m_refData
; }
71 /* TODO: Accessors for your GUI
72 void SetHACCEL(WXHACCEL hAccel);
73 WXHACCEL GetHACCEL() const;
77 WXDLLEXPORT_DATA(extern wxAcceleratorTable
) wxNullAcceleratorTable
;