]>
Commit | Line | Data |
---|---|---|
3972fb49 JS |
1 | \section{\class{wxAcceleratorEntry}}\label{wxacceleratorentry} |
2 | ||
3 | An object used by an application wishing to create an \helpref{accelerator table}{wxacceleratortable}. | |
4 | ||
5 | \wxheading{Derived from} | |
6 | ||
7 | None | |
8 | ||
9 | \wxheading{See also} | |
10 | ||
11 | \helpref{wxAcceleratorTable}{wxacceleratortable}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable} | |
12 | ||
13 | \latexignore{\rtfignore{\wxheading{Members}}} | |
14 | ||
15 | \membersection{wxAcceleratorEntry::wxAcceleratorEntry}\label{wxacceleratorentryconstr} | |
16 | ||
17 | \func{}{wxAcceleratorEntry}{\void} | |
18 | ||
19 | Default constructor. | |
20 | ||
21 | \func{}{wxAcceleratorEntry}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}} | |
22 | ||
23 | Constructor. | |
24 | ||
25 | \wxheading{Parameters} | |
26 | ||
27 | \docparam{flags}{One of wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates | |
28 | which modifier key is held down.} | |
29 | ||
30 | \docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.} | |
31 | ||
32 | \docparam{cmd}{The menu or control command identifier.} | |
33 | ||
34 | \membersection{wxAcceleratorEntry::GetCommand}\label{wxacceleratorentrygetcommand} | |
35 | ||
36 | \constfunc{int}{GetCommand}{\void} | |
37 | ||
38 | Returns the command identifier for the accelerator table entry. | |
39 | ||
40 | \membersection{wxAcceleratorEntry::GetFlags}\label{wxacceleratorentrygetflags} | |
41 | ||
42 | \constfunc{int}{GetFlags}{\void} | |
43 | ||
44 | Returns the flags for the accelerator table entry. | |
45 | ||
46 | \membersection{wxAcceleratorEntry::GetKeyCode}\label{wxacceleratorentrygetkeycode} | |
47 | ||
48 | \constfunc{int}{GetKeyCode}{\void} | |
49 | ||
50 | Returns the keycode for the accelerator table entry. | |
51 | ||
52 | \membersection{wxAcceleratorEntry::Set}\label{wxacceleratorentryset} | |
53 | ||
54 | \func{void}{Set}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}} | |
55 | ||
56 | Sets the accelerator entry parameters. | |
57 | ||
58 | \wxheading{Parameters} | |
59 | ||
60 | \docparam{flags}{One of wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates | |
61 | which modifier key is held down.} | |
62 | ||
63 | \docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.} | |
64 | ||
65 | \docparam{cmd}{The menu or control command identifier.} | |
66 | ||
67 | \section{\class{wxAcceleratorTable}}\label{wxacceleratortable} | |
68 | ||
69 | An accelerator table allows the application to specify a table of keyboard shortcuts for | |
70 | menus or other commands. On Windows, menu or button commands are supported; on GTK, | |
71 | only menu commands are supported. | |
72 | ||
73 | The object {\bf wxNullAcceleratorTable} is defined to be a table with no data, and is the | |
74 | initial accelerator table for a window. | |
75 | ||
76 | \wxheading{Derived from} | |
77 | ||
78 | \helpref{wxObject}{wxobject} | |
79 | ||
80 | \wxheading{Example} | |
81 | ||
82 | {\small% | |
83 | \begin{verbatim} | |
84 | wxAcceleratorEntry entries[4]; | |
85 | entries[0].Set(wxACCEL_CTRL, (int) 'N', ID_NEW_WINDOW); | |
86 | entries[1].Set(wxACCEL_CTRL, (int) 'X', wxID_EXIT); | |
87 | entries[2].Set(wxACCEL_SHIFT, (int) 'A', ID_ABOUT); | |
88 | entries[3].Set(wxACCEL_NONE, WXK_DELETE, wxID_CUT); | |
89 | wxAcceleratorTable accel(4, entries); | |
90 | frame->SetAcceleratorTable(accel); | |
91 | \end{verbatim} | |
92 | } | |
93 | ||
94 | \wxheading{Remarks} | |
95 | ||
96 | An accelerator takes precedence over normal processing and can be a convenient way to program some event handling. | |
97 | For example, you can use an accelerator table to enable a dialog with a multi-line text control to | |
98 | accept CTRL-Enter as meaning 'OK' (but not in GTK at present). | |
99 | ||
100 | \wxheading{See also} | |
101 | ||
102 | \helpref{wxAcceleratorEntry}{wxacceleratorentry}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable} | |
103 | ||
104 | \latexignore{\rtfignore{\wxheading{Members}}} | |
105 | ||
106 | \membersection{wxAcceleratorTable::wxAcceleratorTable}\label{wxacceleratortableconstr} | |
107 | ||
108 | \func{}{wxAcceleratorTable}{\void} | |
109 | ||
110 | Default constructor. | |
111 | ||
112 | \func{}{wxAcceleratorTable}{\param{const wxAcceleratorTable\& }{bitmap}} | |
113 | ||
114 | Copy constructor. | |
115 | ||
116 | \func{}{wxAcceleratorTable}{\param{int}{ n}, \param{wxAcceleratorEntry}{ entries[]}} | |
117 | ||
118 | Creates from an array of \helpref{wxAcceleratorEntry}{wxacceleratorentry} objects. | |
119 | ||
120 | \func{}{wxAcceleratorTable}{\param{const wxString\&}{ resource}} | |
121 | ||
122 | Loads the accelerator table from a Windows resource (Windows only). | |
123 | ||
124 | \wxheading{Parameters} | |
125 | ||
126 | \docparam{n}{Number of accelerator entries.} | |
127 | ||
128 | \docparam{entries}{The array of entries.} | |
129 | ||
130 | \docparam{resource}{Name of a Windows accelerator.} | |
131 | ||
132 | \membersection{wxAcceleratorTable::\destruct{wxAcceleratorTable}} | |
133 | ||
134 | \func{}{\destruct{wxAcceleratorTable}}{\void} | |
135 | ||
136 | Destroys the wxAcceleratorTable object. | |
137 | ||
138 | \membersection{wxAcceleratorTable::Ok}\label{wxacceleratortableok} | |
139 | ||
140 | \constfunc{bool}{Ok}{\void} | |
141 | ||
142 | Returns TRUE if the accelerator table is valid. | |
143 | ||
144 | \membersection{wxAcceleratorTable::operator $=$} | |
145 | ||
146 | \func{wxAcceleratorTable\& }{operator $=$}{\param{const wxAcceleratorTable\& }{accel}} | |
147 | ||
148 | Assignment operator. This operator does not copy any data, but instead | |
149 | passes a pointer to the data in {\it accel} and increments a reference | |
150 | counter. It is a fast operation. | |
151 | ||
152 | \wxheading{Parameters} | |
153 | ||
154 | \docparam{accel}{Accelerator table to assign.} | |
155 | ||
156 | \wxheading{Return value} | |
157 | ||
158 | Returns 'this' object. | |
159 | ||
160 | \membersection{wxAcceleratorTable::operator $==$} | |
161 | ||
162 | \func{bool}{operator $==$}{\param{const wxAcceleratorTable\& }{accel}} | |
163 | ||
164 | Equality operator. This operator tests whether the internal data pointers are | |
165 | equal (a fast test). | |
166 | ||
167 | \wxheading{Parameters} | |
168 | ||
169 | \docparam{accel}{Accelerator table to compare with 'this'} | |
170 | ||
171 | \wxheading{Return value} | |
172 | ||
173 | Returns TRUE if the accelerator tables were effectively equal, FALSE otherwise. | |
174 | ||
175 | \membersection{wxAcceleratorTable::operator $!=$} | |
176 | ||
177 | \func{bool}{operator $!=$}{\param{const wxAcceleratorTable\& }{accel}} | |
178 | ||
179 | Inequality operator. This operator tests whether the internal data pointers are | |
180 | unequal (a fast test). | |
181 | ||
182 | \wxheading{Parameters} | |
183 | ||
184 | \docparam{accel}{Accelerator table to compare with 'this'} | |
185 | ||
186 | \wxheading{Return value} | |
187 | ||
188 | Returns TRUE if the accelerator tables were unequal, FALSE otherwise. | |
189 | ||
190 |