]> git.saurik.com Git - wxWidgets.git/blob - interface/accel.h
b12465366a4c889ce6009cdd02bb0dee2d38ed53
[wxWidgets.git] / interface / accel.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: accel.h
3 // Purpose: documentation for wxAcceleratorEntry class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxAcceleratorEntry
11 @wxheader{accel.h}
12
13 An object used by an application wishing to create an @ref
14 overview_wxacceleratortable "accelerator table".
15
16 @library{wxcore}
17 @category{FIXME}
18
19 @seealso
20 wxAcceleratorTable, wxWindow::SetAcceleratorTable
21 */
22 class wxAcceleratorEntry
23 {
24 public:
25 //@{
26 /**
27 Constructor.
28
29 @param flags
30 One of wxACCEL_ALT, wxACCEL_SHIFT, wxACCEL_CTRL and wxACCEL_NORMAL.
31 Indicates
32 which modifier key is held down.
33 @param keyCode
34 The keycode to be detected. See Keycodes for a full list of keycodes.
35 @param cmd
36 The menu or control command identifier.
37 */
38 wxAcceleratorEntry();
39 wxAcceleratorEntry(int flags, int keyCode, int cmd);
40 //@}
41
42 /**
43 Returns the command identifier for the accelerator table entry.
44 */
45 int GetCommand() const;
46
47 /**
48 Returns the flags for the accelerator table entry.
49 */
50 int GetFlags() const;
51
52 /**
53 Returns the keycode for the accelerator table entry.
54 */
55 int GetKeyCode() const;
56
57 /**
58 Sets the accelerator entry parameters.
59
60 @param flags
61 One of wxACCEL_ALT, wxACCEL_SHIFT, wxACCEL_CTRL and wxACCEL_NORMAL.
62 Indicates
63 which modifier key is held down.
64 @param keyCode
65 The keycode to be detected. See Keycodes for a full list of keycodes.
66 @param cmd
67 The menu or control command identifier.
68 */
69 void Set(int flags, int keyCode, int cmd);
70 };
71
72
73 /**
74 @class wxAcceleratorTable
75 @wxheader{accel.h}
76
77 An accelerator table allows the application to specify a table of keyboard
78 shortcuts for
79 menus or other commands. On Windows and Mac OS X, menu or button commands are
80 supported; on GTK,
81 only menu commands are supported.
82
83 The object @b wxNullAcceleratorTable is defined to be a table with no data, and
84 is the
85 initial accelerator table for a window.
86
87 @library{wxcore}
88 @category{misc}
89
90 @stdobjects
91 Objects:
92 wxNullAcceleratorTable
93
94 @seealso
95 wxAcceleratorEntry, wxWindow::SetAcceleratorTable
96 */
97 class wxAcceleratorTable : public wxObject
98 {
99 public:
100 //@{
101 /**
102 Loads the accelerator table from a Windows resource (Windows only).
103
104 @param n
105 Number of accelerator entries.
106 @param entries
107 The array of entries.
108 @param resource
109 Name of a Windows accelerator.
110 */
111 wxAcceleratorTable();
112 wxAcceleratorTable(const wxAcceleratorTable& bitmap);
113 wxAcceleratorTable(int n, wxAcceleratorEntry entries[]);
114 wxAcceleratorTable(const wxString& resource);
115 //@}
116
117 /**
118 Destroys the wxAcceleratorTable object.
119 See @ref overview_refcountdestruct "reference-counted object destruction" for
120 more info.
121 */
122 ~wxAcceleratorTable();
123
124 /**
125 Returns @true if the accelerator table is valid.
126 */
127 bool IsOk() const;
128
129 /**
130 Assignment operator, using @ref overview_trefcount "reference counting".
131
132 @param accel
133 Accelerator table to assign.
134 */
135 wxAcceleratorTable operator =(const wxAcceleratorTable& accel);
136 };