]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/accel.tex
typo fix
[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
954b8ae6
JS
9\wxheading{Include files}
10
11<wx/accel.h>
12
a7af285d
VZ
13\wxheading{Library}
14
15\helpref{wxCore}{librarieslist}
16
3972fb49
JS
17\wxheading{See also}
18
19\helpref{wxAcceleratorTable}{wxacceleratortable}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable}
20
21\latexignore{\rtfignore{\wxheading{Members}}}
22
f510b7b2 23\membersection{wxAcceleratorEntry::wxAcceleratorEntry}\label{wxacceleratorentryctor}
3972fb49
JS
24
25\func{}{wxAcceleratorEntry}{\void}
26
27Default constructor.
28
29\func{}{wxAcceleratorEntry}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}}
30
31Constructor.
32
33\wxheading{Parameters}
34
446f8f2a 35\docparam{flags}{One of wxACCEL\_ALT, wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
3972fb49
JS
36which modifier key is held down.}
37
38\docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.}
39
40\docparam{cmd}{The menu or control command identifier.}
41
42\membersection{wxAcceleratorEntry::GetCommand}\label{wxacceleratorentrygetcommand}
43
44\constfunc{int}{GetCommand}{\void}
45
46Returns the command identifier for the accelerator table entry.
47
48\membersection{wxAcceleratorEntry::GetFlags}\label{wxacceleratorentrygetflags}
49
50\constfunc{int}{GetFlags}{\void}
51
52Returns the flags for the accelerator table entry.
53
54\membersection{wxAcceleratorEntry::GetKeyCode}\label{wxacceleratorentrygetkeycode}
55
56\constfunc{int}{GetKeyCode}{\void}
57
58Returns the keycode for the accelerator table entry.
59
60\membersection{wxAcceleratorEntry::Set}\label{wxacceleratorentryset}
61
62\func{void}{Set}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}}
63
64Sets the accelerator entry parameters.
65
66\wxheading{Parameters}
67
446f8f2a 68\docparam{flags}{One of wxACCEL\_ALT, wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
3972fb49
JS
69which modifier key is held down.}
70
71\docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.}
72
73\docparam{cmd}{The menu or control command identifier.}
74
75\section{\class{wxAcceleratorTable}}\label{wxacceleratortable}
76
77An accelerator table allows the application to specify a table of keyboard shortcuts for
7816e624 78menus or other commands. On Windows and Mac OS X, menu or button commands are supported; on GTK,
3972fb49
JS
79only menu commands are supported.
80
81The object {\bf wxNullAcceleratorTable} is defined to be a table with no data, and is the
82initial accelerator table for a window.
83
84\wxheading{Derived from}
85
86\helpref{wxObject}{wxobject}
87
954b8ae6
JS
88\wxheading{Include files}
89
90<wx/accel.h>
91
a7af285d
VZ
92\wxheading{Library}
93
94\helpref{wxCore}{librarieslist}
95
55ccdb93
VZ
96\wxheading{Predefined objects}
97
98Objects:
99
100{\bf wxNullAcceleratorTable}
101
3972fb49
JS
102\wxheading{Example}
103
104{\small%
105\begin{verbatim}
106 wxAcceleratorEntry entries[4];
107 entries[0].Set(wxACCEL_CTRL, (int) 'N', ID_NEW_WINDOW);
108 entries[1].Set(wxACCEL_CTRL, (int) 'X', wxID_EXIT);
109 entries[2].Set(wxACCEL_SHIFT, (int) 'A', ID_ABOUT);
fbc89908 110 entries[3].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_CUT);
3972fb49
JS
111 wxAcceleratorTable accel(4, entries);
112 frame->SetAcceleratorTable(accel);
113\end{verbatim}
0497e172 114}%
3972fb49
JS
115
116\wxheading{Remarks}
117
118An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
119For example, you can use an accelerator table to enable a dialog with a multi-line text control to
0497e172 120accept CTRL-Enter as meaning `OK' (but not in GTK+ at present).
3972fb49
JS
121
122\wxheading{See also}
123
124\helpref{wxAcceleratorEntry}{wxacceleratorentry}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable}
125
126\latexignore{\rtfignore{\wxheading{Members}}}
127
f510b7b2 128\membersection{wxAcceleratorTable::wxAcceleratorTable}\label{wxacceleratortablector}
3972fb49
JS
129
130\func{}{wxAcceleratorTable}{\void}
131
132Default constructor.
133
134\func{}{wxAcceleratorTable}{\param{const wxAcceleratorTable\& }{bitmap}}
135
a91225b2 136Copy constructor, uses \helpref{reference counting}{trefcount}.
3972fb49
JS
137
138\func{}{wxAcceleratorTable}{\param{int}{ n}, \param{wxAcceleratorEntry}{ entries[]}}
139
140Creates from an array of \helpref{wxAcceleratorEntry}{wxacceleratorentry} objects.
141
142\func{}{wxAcceleratorTable}{\param{const wxString\&}{ resource}}
143
144Loads the accelerator table from a Windows resource (Windows only).
145
146\wxheading{Parameters}
147
148\docparam{n}{Number of accelerator entries.}
149
150\docparam{entries}{The array of entries.}
151
152\docparam{resource}{Name of a Windows accelerator.}
153
76e1c2de
RD
154\pythonnote{The wxPython constructor accepts a list of
155wxAcceleratorEntry objects, or 3-tuples consisting of flags, keyCode,
156and cmd values like you would construct wxAcceleratorEntry objects with.}
157
f3539882 158\perlnote{The wxPerl constructor accepts a list of either
9b50920f
JS
159Wx::AcceleratorEntry objects or references to 3-element arrays
160( flags, keyCode, cmd ), like the parameters of Wx::AcceleratorEntry::new.}
f3539882 161
f510b7b2 162\membersection{wxAcceleratorTable::\destruct{wxAcceleratorTable}}\label{wxacceleratortabledtor}
3972fb49
JS
163
164\func{}{\destruct{wxAcceleratorTable}}{\void}
165
166Destroys the wxAcceleratorTable object.
55ccdb93 167See \helpref{reference-counted object destruction}{refcountdestruct} for more info.
3972fb49 168
b7cacb43 169\membersection{wxAcceleratorTable::IsOk}\label{wxacceleratortableisok}
3972fb49 170
b7cacb43 171\constfunc{bool}{IsOk}{\void}
3972fb49 172
cc81d32f 173Returns true if the accelerator table is valid.
3972fb49 174
f510b7b2 175\membersection{wxAcceleratorTable::operator $=$}\label{wxacceleratortableassign}
3972fb49
JS
176
177\func{wxAcceleratorTable\& }{operator $=$}{\param{const wxAcceleratorTable\& }{accel}}
178
a91225b2 179Assignment operator, using \helpref{reference counting}{trefcount}.
3972fb49
JS
180
181\wxheading{Parameters}
182
183\docparam{accel}{Accelerator table to assign.}
184
185\wxheading{Return value}
186
9b50920f
JS
187Returns a reference to this object.
188