1998-09-06 10:43:36 -04:00
|
|
|
\section{\class{wxAcceleratorEntry}}\label{wxacceleratorentry}
|
|
|
|
|
|
|
|
An object used by an application wishing to create an \helpref{accelerator table}{wxacceleratortable}.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
None
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/accel.h>
|
|
|
|
|
1998-09-06 10:43:36 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxAcceleratorTable}{wxacceleratortable}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxAcceleratorEntry::wxAcceleratorEntry}\label{wxacceleratorentryctor}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\func{}{wxAcceleratorEntry}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
\func{}{wxAcceleratorEntry}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
2000-01-24 10:38:34 -05:00
|
|
|
\docparam{flags}{One of wxACCEL\_ALT, wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
|
1998-09-06 10:43:36 -04:00
|
|
|
which modifier key is held down.}
|
|
|
|
|
|
|
|
\docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.}
|
|
|
|
|
|
|
|
\docparam{cmd}{The menu or control command identifier.}
|
|
|
|
|
|
|
|
\membersection{wxAcceleratorEntry::GetCommand}\label{wxacceleratorentrygetcommand}
|
|
|
|
|
|
|
|
\constfunc{int}{GetCommand}{\void}
|
|
|
|
|
|
|
|
Returns the command identifier for the accelerator table entry.
|
|
|
|
|
|
|
|
\membersection{wxAcceleratorEntry::GetFlags}\label{wxacceleratorentrygetflags}
|
|
|
|
|
|
|
|
\constfunc{int}{GetFlags}{\void}
|
|
|
|
|
|
|
|
Returns the flags for the accelerator table entry.
|
|
|
|
|
|
|
|
\membersection{wxAcceleratorEntry::GetKeyCode}\label{wxacceleratorentrygetkeycode}
|
|
|
|
|
|
|
|
\constfunc{int}{GetKeyCode}{\void}
|
|
|
|
|
|
|
|
Returns the keycode for the accelerator table entry.
|
|
|
|
|
|
|
|
\membersection{wxAcceleratorEntry::Set}\label{wxacceleratorentryset}
|
|
|
|
|
|
|
|
\func{void}{Set}{\param{int}{ flags}, \param{int}{ keyCode}, \param{int}{ cmd}}
|
|
|
|
|
|
|
|
Sets the accelerator entry parameters.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
2000-01-24 10:38:34 -05:00
|
|
|
\docparam{flags}{One of wxACCEL\_ALT, wxACCEL\_SHIFT, wxACCEL\_CTRL and wxACCEL\_NORMAL. Indicates
|
1998-09-06 10:43:36 -04:00
|
|
|
which modifier key is held down.}
|
|
|
|
|
|
|
|
\docparam{keyCode}{The keycode to be detected. See \helpref{Keycodes}{keycodes} for a full list of keycodes.}
|
|
|
|
|
|
|
|
\docparam{cmd}{The menu or control command identifier.}
|
|
|
|
|
|
|
|
\section{\class{wxAcceleratorTable}}\label{wxacceleratortable}
|
|
|
|
|
|
|
|
An accelerator table allows the application to specify a table of keyboard shortcuts for
|
2007-04-07 13:05:00 -04:00
|
|
|
menus or other commands. On Windows and Mac OS X, menu or button commands are supported; on GTK,
|
1998-09-06 10:43:36 -04:00
|
|
|
only menu commands are supported.
|
|
|
|
|
|
|
|
The object {\bf wxNullAcceleratorTable} is defined to be a table with no data, and is the
|
|
|
|
initial accelerator table for a window.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/accel.h>
|
|
|
|
|
2006-10-30 14:26:48 -05:00
|
|
|
\wxheading{Predefined objects}
|
|
|
|
|
|
|
|
Objects:
|
|
|
|
|
|
|
|
{\bf wxNullAcceleratorTable}
|
|
|
|
|
1998-09-06 10:43:36 -04:00
|
|
|
\wxheading{Example}
|
|
|
|
|
|
|
|
{\small%
|
|
|
|
\begin{verbatim}
|
|
|
|
wxAcceleratorEntry entries[4];
|
|
|
|
entries[0].Set(wxACCEL_CTRL, (int) 'N', ID_NEW_WINDOW);
|
|
|
|
entries[1].Set(wxACCEL_CTRL, (int) 'X', wxID_EXIT);
|
|
|
|
entries[2].Set(wxACCEL_SHIFT, (int) 'A', ID_ABOUT);
|
2000-01-25 19:50:16 -05:00
|
|
|
entries[3].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_CUT);
|
1998-09-06 10:43:36 -04:00
|
|
|
wxAcceleratorTable accel(4, entries);
|
|
|
|
frame->SetAcceleratorTable(accel);
|
|
|
|
\end{verbatim}
|
2003-08-24 04:16:37 -04:00
|
|
|
}%
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
|
|
|
|
For example, you can use an accelerator table to enable a dialog with a multi-line text control to
|
2003-08-24 04:16:37 -04:00
|
|
|
accept CTRL-Enter as meaning `OK' (but not in GTK+ at present).
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxAcceleratorEntry}{wxacceleratorentry}, \helpref{wxWindow::SetAcceleratorTable}{wxwindowsetacceleratortable}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxAcceleratorTable::wxAcceleratorTable}\label{wxacceleratortablector}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\func{}{wxAcceleratorTable}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
\func{}{wxAcceleratorTable}{\param{const wxAcceleratorTable\& }{bitmap}}
|
|
|
|
|
2006-10-18 13:23:42 -04:00
|
|
|
Copy constructor, uses \helpref{reference counting}{trefcount}.
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\func{}{wxAcceleratorTable}{\param{int}{ n}, \param{wxAcceleratorEntry}{ entries[]}}
|
|
|
|
|
|
|
|
Creates from an array of \helpref{wxAcceleratorEntry}{wxacceleratorentry} objects.
|
|
|
|
|
|
|
|
\func{}{wxAcceleratorTable}{\param{const wxString\&}{ resource}}
|
|
|
|
|
|
|
|
Loads the accelerator table from a Windows resource (Windows only).
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{n}{Number of accelerator entries.}
|
|
|
|
|
|
|
|
\docparam{entries}{The array of entries.}
|
|
|
|
|
|
|
|
\docparam{resource}{Name of a Windows accelerator.}
|
|
|
|
|
1999-09-30 03:13:40 -04:00
|
|
|
\pythonnote{The wxPython constructor accepts a list of
|
|
|
|
wxAcceleratorEntry objects, or 3-tuples consisting of flags, keyCode,
|
|
|
|
and cmd values like you would construct wxAcceleratorEntry objects with.}
|
|
|
|
|
2001-04-14 15:46:05 -04:00
|
|
|
\perlnote{The wxPerl constructor accepts a list of either
|
2006-10-30 18:42:22 -05:00
|
|
|
Wx::AcceleratorEntry objects or references to 3-element arrays
|
|
|
|
( flags, keyCode, cmd ), like the parameters of Wx::AcceleratorEntry::new.}
|
2001-04-14 15:46:05 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxAcceleratorTable::\destruct{wxAcceleratorTable}}\label{wxacceleratortabledtor}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxAcceleratorTable}}{\void}
|
|
|
|
|
|
|
|
Destroys the wxAcceleratorTable object.
|
2006-10-30 14:26:48 -05:00
|
|
|
See \helpref{reference-counted object destruction}{refcountdestruct} for more info.
|
1998-09-06 10:43:36 -04:00
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
\membersection{wxAcceleratorTable::IsOk}\label{wxacceleratortableisok}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
\constfunc{bool}{IsOk}{\void}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the accelerator table is valid.
|
1998-09-06 10:43:36 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxAcceleratorTable::operator $=$}\label{wxacceleratortableassign}
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\func{wxAcceleratorTable\& }{operator $=$}{\param{const wxAcceleratorTable\& }{accel}}
|
|
|
|
|
2006-10-18 13:23:42 -04:00
|
|
|
Assignment operator, using \helpref{reference counting}{trefcount}.
|
1998-09-06 10:43:36 -04:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{accel}{Accelerator table to assign.}
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2006-10-30 18:42:22 -05:00
|
|
|
Returns a reference to this object.
|
|
|
|
|