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{wxAcceleratorTable
}{wxacceleratortable
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxAcceleratorEntry::wxAcceleratorEntry
}\label{wxacceleratorentryconstr
}
21 \func{}{wxAcceleratorEntry
}{\void}
25 \func{}{wxAcceleratorEntry
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
29 \wxheading{Parameters
}
31 \docparam{flags
}{One of wxACCEL
\_ALT, wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
32 which modifier key is held down.
}
34 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
36 \docparam{cmd
}{The menu or control command identifier.
}
38 \membersection{wxAcceleratorEntry::GetCommand
}\label{wxacceleratorentrygetcommand
}
40 \constfunc{int
}{GetCommand
}{\void}
42 Returns the command identifier for the accelerator table entry.
44 \membersection{wxAcceleratorEntry::GetFlags
}\label{wxacceleratorentrygetflags
}
46 \constfunc{int
}{GetFlags
}{\void}
48 Returns the flags for the accelerator table entry.
50 \membersection{wxAcceleratorEntry::GetKeyCode
}\label{wxacceleratorentrygetkeycode
}
52 \constfunc{int
}{GetKeyCode
}{\void}
54 Returns the keycode for the accelerator table entry.
56 \membersection{wxAcceleratorEntry::Set
}\label{wxacceleratorentryset
}
58 \func{void
}{Set
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
60 Sets the accelerator entry parameters.
62 \wxheading{Parameters
}
64 \docparam{flags
}{One of wxACCEL
\_ALT, wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
65 which modifier key is held down.
}
67 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
69 \docparam{cmd
}{The menu or control command identifier.
}
71 \section{\class{wxAcceleratorTable
}}\label{wxacceleratortable
}
73 An accelerator table allows the application to specify a table of keyboard shortcuts for
74 menus or other commands. On Windows, menu or button commands are supported; on GTK,
75 only menu commands are supported.
77 The object
{\bf wxNullAcceleratorTable
} is defined to be a table with no data, and is the
78 initial accelerator table for a window.
80 \wxheading{Derived from
}
82 \helpref{wxObject
}{wxobject
}
84 \wxheading{Include files
}
92 wxAcceleratorEntry entries
[4];
93 entries
[0].Set(wxACCEL_CTRL, (int) 'N', ID_NEW_WINDOW);
94 entries
[1].Set(wxACCEL_CTRL, (int) 'X', wxID_EXIT);
95 entries
[2].Set(wxACCEL_SHIFT, (int) 'A', ID_ABOUT);
96 entries
[3].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_CUT);
97 wxAcceleratorTable accel(
4, entries);
98 frame->SetAcceleratorTable(accel);
104 An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
105 For example, you can use an accelerator table to enable a dialog with a multi-line text control to
106 accept CTRL-Enter as meaning `OK' (but not in GTK at present).
110 \helpref{wxAcceleratorEntry
}{wxacceleratorentry
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
112 \latexignore{\rtfignore{\wxheading{Members
}}}
114 \membersection{wxAcceleratorTable::wxAcceleratorTable
}\label{wxacceleratortableconstr
}
116 \func{}{wxAcceleratorTable
}{\void}
120 \func{}{wxAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{bitmap
}}
124 \func{}{wxAcceleratorTable
}{\param{int
}{ n
},
\param{wxAcceleratorEntry
}{ entries
[]}}
126 Creates from an array of
\helpref{wxAcceleratorEntry
}{wxacceleratorentry
} objects.
128 \func{}{wxAcceleratorTable
}{\param{const wxString\&
}{ resource
}}
130 Loads the accelerator table from a Windows resource (Windows only).
132 \wxheading{Parameters
}
134 \docparam{n
}{Number of accelerator entries.
}
136 \docparam{entries
}{The array of entries.
}
138 \docparam{resource
}{Name of a Windows accelerator.
}
140 \pythonnote{The wxPython constructor accepts a list of
141 wxAcceleratorEntry objects, or
3-tuples consisting of flags, keyCode,
142 and cmd values like you would construct wxAcceleratorEntry objects with.
}
144 \perlnote{The wxPerl constructor accepts a list of either
145 Wx::AcceleratorEntry objects or references to
3-element arrays
146 ( flags, keyCode, cmd ), like the parameters of Wx::AcceleratorEntry::new.
}
148 \membersection{wxAcceleratorTable::
\destruct{wxAcceleratorTable
}}
150 \func{}{\destruct{wxAcceleratorTable
}}{\void}
152 Destroys the wxAcceleratorTable object.
154 \membersection{wxAcceleratorTable::Ok
}\label{wxacceleratortableok
}
156 \constfunc{bool
}{Ok
}{\void}
158 Returns true if the accelerator table is valid.
160 \membersection{wxAcceleratorTable::operator $=$
}
162 \func{wxAcceleratorTable\&
}{operator $=$
}{\param{const wxAcceleratorTable\&
}{accel
}}
164 Assignment operator. This operator does not copy any data, but instead
165 passes a pointer to the data in
{\it accel
} and increments a reference
166 counter. It is a fast operation.
168 \wxheading{Parameters
}
170 \docparam{accel
}{Accelerator table to assign.
}
172 \wxheading{Return value
}
174 Returns reference to this object.
176 \membersection{wxAcceleratorTable::operator $==$
}
178 \func{bool
}{operator $==$
}{\param{const wxAcceleratorTable\&
}{accel
}}
180 Equality operator. This operator tests whether the internal data pointers are
183 \wxheading{Parameters
}
185 \docparam{accel
}{Accelerator table to compare with
}
187 \wxheading{Return value
}
189 Returns true if the accelerator tables were effectively equal, false otherwise.
191 \membersection{wxAcceleratorTable::operator $!=$
}
193 \func{bool
}{operator $!=$
}{\param{const wxAcceleratorTable\&
}{accel
}}
195 Inequality operator. This operator tests whether the internal data pointers are
196 unequal (a fast test).
198 \wxheading{Parameters
}
200 \docparam{accel
}{Accelerator table to compare with
}
202 \wxheading{Return value
}
204 Returns true if the accelerator tables were unequal, false otherwise.