]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/accel.tex
Motif and other mods
[wxWidgets.git] / docs / latex / wx / accel.tex
CommitLineData
3972fb49
JS
1\section{\class{wxAcceleratorEntry}}\label{wxacceleratorentry}
2
3An object used by an application wishing to create an \helpref{accelerator table}{wxacceleratortable}.
4
5\wxheading{Derived from}
6
7None
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
19Default constructor.
20
21\func{}{wxAcceleratorEntry}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}}
22
23Constructor.
24
25\wxheading{Parameters}
26
27\docparam{flags}{One of wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
28which 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
38Returns the command identifier for the accelerator table entry.
39
40\membersection{wxAcceleratorEntry::GetFlags}\label{wxacceleratorentrygetflags}
41
42\constfunc{int}{GetFlags}{\void}
43
44Returns the flags for the accelerator table entry.
45
46\membersection{wxAcceleratorEntry::GetKeyCode}\label{wxacceleratorentrygetkeycode}
47
48\constfunc{int}{GetKeyCode}{\void}
49
50Returns 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
56Sets the accelerator entry parameters.
57
58\wxheading{Parameters}
59
60\docparam{flags}{One of wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
61which 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
69An accelerator table allows the application to specify a table of keyboard shortcuts for
70menus or other commands. On Windows, menu or button commands are supported; on GTK,
71only menu commands are supported.
72
73The object {\bf wxNullAcceleratorTable} is defined to be a table with no data, and is the
74initial 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
96An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
97For example, you can use an accelerator table to enable a dialog with a multi-line text control to
98accept 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
110Default constructor.
111
112\func{}{wxAcceleratorTable}{\param{const wxAcceleratorTable\& }{bitmap}}
113
114Copy constructor.
115
116\func{}{wxAcceleratorTable}{\param{int}{ n}, \param{wxAcceleratorEntry}{ entries[]}}
117
118Creates from an array of \helpref{wxAcceleratorEntry}{wxacceleratorentry} objects.
119
120\func{}{wxAcceleratorTable}{\param{const wxString\&}{ resource}}
121
122Loads 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
136Destroys the wxAcceleratorTable object.
137
138\membersection{wxAcceleratorTable::Ok}\label{wxacceleratortableok}
139
140\constfunc{bool}{Ok}{\void}
141
142Returns TRUE if the accelerator table is valid.
143
144\membersection{wxAcceleratorTable::operator $=$}
145
146\func{wxAcceleratorTable\& }{operator $=$}{\param{const wxAcceleratorTable\& }{accel}}
147
148Assignment operator. This operator does not copy any data, but instead
149passes a pointer to the data in {\it accel} and increments a reference
150counter. It is a fast operation.
151
152\wxheading{Parameters}
153
154\docparam{accel}{Accelerator table to assign.}
155
156\wxheading{Return value}
157
158Returns 'this' object.
159
160\membersection{wxAcceleratorTable::operator $==$}
161
162\func{bool}{operator $==$}{\param{const wxAcceleratorTable\& }{accel}}
163
164Equality operator. This operator tests whether the internal data pointers are
165equal (a fast test).
166
167\wxheading{Parameters}
168
169\docparam{accel}{Accelerator table to compare with 'this'}
170
171\wxheading{Return value}
172
173Returns 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
179Inequality operator. This operator tests whether the internal data pointers are
180unequal (a fast test).
181
182\wxheading{Parameters}
183
184\docparam{accel}{Accelerator table to compare with 'this'}
185
186\wxheading{Return value}
187
188Returns TRUE if the accelerator tables were unequal, FALSE otherwise.
189
190