1 \section{\class{wxAcceleratorEntry
}}\label{wxacceleratorentry
}
3 An object used by an application wishing to create an
\helpref{accelerator table
}{wxacceleratortable
}.
5 \wxheading{Derived from
}
9 \wxheading{Include files
}
15 \helpref{wxCore
}{librarieslist
}
19 \helpref{wxAcceleratorTable
}{wxacceleratortable
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
21 \latexignore{\rtfignore{\wxheading{Members
}}}
23 \membersection{wxAcceleratorEntry::wxAcceleratorEntry
}\label{wxacceleratorentryctor
}
25 \func{}{wxAcceleratorEntry
}{\void}
29 \func{}{wxAcceleratorEntry
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
33 \wxheading{Parameters
}
35 \docparam{flags
}{One of wxACCEL
\_ALT, wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
36 which modifier key is held down.
}
38 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
40 \docparam{cmd
}{The menu or control command identifier.
}
42 \membersection{wxAcceleratorEntry::GetCommand
}\label{wxacceleratorentrygetcommand
}
44 \constfunc{int
}{GetCommand
}{\void}
46 Returns the command identifier for the accelerator table entry.
48 \membersection{wxAcceleratorEntry::GetFlags
}\label{wxacceleratorentrygetflags
}
50 \constfunc{int
}{GetFlags
}{\void}
52 Returns the flags for the accelerator table entry.
54 \membersection{wxAcceleratorEntry::GetKeyCode
}\label{wxacceleratorentrygetkeycode
}
56 \constfunc{int
}{GetKeyCode
}{\void}
58 Returns the keycode for the accelerator table entry.
60 \membersection{wxAcceleratorEntry::Set
}\label{wxacceleratorentryset
}
62 \func{void
}{Set
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
64 Sets the accelerator entry parameters.
66 \wxheading{Parameters
}
68 \docparam{flags
}{One of wxACCEL
\_ALT, wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
69 which modifier key is held down.
}
71 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
73 \docparam{cmd
}{The menu or control command identifier.
}
75 \section{\class{wxAcceleratorTable
}}\label{wxacceleratortable
}
77 An accelerator table allows the application to specify a table of keyboard shortcuts for
78 menus or other commands. On Windows and Mac OS X, menu or button commands are supported; on GTK,
79 only menu commands are supported.
81 The object
{\bf wxNullAcceleratorTable
} is defined to be a table with no data, and is the
82 initial accelerator table for a window.
84 \wxheading{Derived from
}
86 \helpref{wxObject
}{wxobject
}
88 \wxheading{Include files
}
94 \helpref{wxCore
}{librarieslist
}
96 \wxheading{Predefined objects
}
100 {\bf wxNullAcceleratorTable
}
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);
110 entries
[3].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_CUT);
111 wxAcceleratorTable accel(
4, entries);
112 frame->SetAcceleratorTable(accel);
118 An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
119 For example, you can use an accelerator table to enable a dialog with a multi-line text control to
120 accept CTRL-Enter as meaning `OK' (but not in GTK+ at present).
124 \helpref{wxAcceleratorEntry
}{wxacceleratorentry
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
126 \latexignore{\rtfignore{\wxheading{Members
}}}
128 \membersection{wxAcceleratorTable::wxAcceleratorTable
}\label{wxacceleratortablector
}
130 \func{}{wxAcceleratorTable
}{\void}
134 \func{}{wxAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{bitmap
}}
136 Copy constructor, uses
\helpref{reference counting
}{trefcount
}.
138 \func{}{wxAcceleratorTable
}{\param{int
}{ n
},
\param{wxAcceleratorEntry
}{ entries
[]}}
140 Creates from an array of
\helpref{wxAcceleratorEntry
}{wxacceleratorentry
} objects.
142 \func{}{wxAcceleratorTable
}{\param{const wxString\&
}{ resource
}}
144 Loads the accelerator table from a Windows resource (Windows only).
146 \wxheading{Parameters
}
148 \docparam{n
}{Number of accelerator entries.
}
150 \docparam{entries
}{The array of entries.
}
152 \docparam{resource
}{Name of a Windows accelerator.
}
154 \pythonnote{The wxPython constructor accepts a list of
155 wxAcceleratorEntry objects, or
3-tuples consisting of flags, keyCode,
156 and cmd values like you would construct wxAcceleratorEntry objects with.
}
158 \perlnote{The wxPerl constructor accepts a list of either
159 Wx::AcceleratorEntry objects or references to
3-element arrays
160 ( flags, keyCode, cmd ), like the parameters of Wx::AcceleratorEntry::new.
}
162 \membersection{wxAcceleratorTable::
\destruct{wxAcceleratorTable
}}\label{wxacceleratortabledtor
}
164 \func{}{\destruct{wxAcceleratorTable
}}{\void}
166 Destroys the wxAcceleratorTable object.
167 See
\helpref{reference-counted object destruction
}{refcountdestruct
} for more info.
169 \membersection{wxAcceleratorTable::IsOk
}\label{wxacceleratortableisok
}
171 \constfunc{bool
}{IsOk
}{\void}
173 Returns true if the accelerator table is valid.
175 \membersection{wxAcceleratorTable::operator $=$
}\label{wxacceleratortableassign
}
177 \func{wxAcceleratorTable\&
}{operator $=$
}{\param{const wxAcceleratorTable\&
}{accel
}}
179 Assignment operator, using
\helpref{reference counting
}{trefcount
}.
181 \wxheading{Parameters
}
183 \docparam{accel
}{Accelerator table to assign.
}
185 \wxheading{Return value
}
187 Returns a reference to this object.