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
}
11 \helpref{wxAcceleratorTable
}{wxacceleratortable
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
13 \latexignore{\rtfignore{\wxheading{Members
}}}
15 \membersection{wxAcceleratorEntry::wxAcceleratorEntry
}\label{wxacceleratorentryconstr
}
17 \func{}{wxAcceleratorEntry
}{\void}
21 \func{}{wxAcceleratorEntry
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
25 \wxheading{Parameters
}
27 \docparam{flags
}{One of wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
28 which modifier key is held down.
}
30 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
32 \docparam{cmd
}{The menu or control command identifier.
}
34 \membersection{wxAcceleratorEntry::GetCommand
}\label{wxacceleratorentrygetcommand
}
36 \constfunc{int
}{GetCommand
}{\void}
38 Returns the command identifier for the accelerator table entry.
40 \membersection{wxAcceleratorEntry::GetFlags
}\label{wxacceleratorentrygetflags
}
42 \constfunc{int
}{GetFlags
}{\void}
44 Returns the flags for the accelerator table entry.
46 \membersection{wxAcceleratorEntry::GetKeyCode
}\label{wxacceleratorentrygetkeycode
}
48 \constfunc{int
}{GetKeyCode
}{\void}
50 Returns the keycode for the accelerator table entry.
52 \membersection{wxAcceleratorEntry::Set
}\label{wxacceleratorentryset
}
54 \func{void
}{Set
}{\param{int
}{ flags
},
\param{int
}{ keyCode
},
\param{int
}{ cmd
}}
56 Sets the accelerator entry parameters.
58 \wxheading{Parameters
}
60 \docparam{flags
}{One of wxACCEL
\_SHIFT, wxACCEL
\_CTRL and wxACCEL
\_NORMAL. Indicates
61 which modifier key is held down.
}
63 \docparam{keyCode
}{The keycode to be detected. See
\helpref{Keycodes
}{keycodes
} for a full list of keycodes.
}
65 \docparam{cmd
}{The menu or control command identifier.
}
67 \section{\class{wxAcceleratorTable
}}\label{wxacceleratortable
}
69 An accelerator table allows the application to specify a table of keyboard shortcuts for
70 menus or other commands. On Windows, menu or button commands are supported; on GTK,
71 only menu commands are supported.
73 The object
{\bf wxNullAcceleratorTable
} is defined to be a table with no data, and is the
74 initial accelerator table for a window.
76 \wxheading{Derived from
}
78 \helpref{wxObject
}{wxobject
}
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);
96 An accelerator takes precedence over normal processing and can be a convenient way to program some event handling.
97 For example, you can use an accelerator table to enable a dialog with a multi-line text control to
98 accept CTRL-Enter as meaning 'OK' (but not in GTK at present).
102 \helpref{wxAcceleratorEntry
}{wxacceleratorentry
},
\helpref{wxWindow::SetAcceleratorTable
}{wxwindowsetacceleratortable
}
104 \latexignore{\rtfignore{\wxheading{Members
}}}
106 \membersection{wxAcceleratorTable::wxAcceleratorTable
}\label{wxacceleratortableconstr
}
108 \func{}{wxAcceleratorTable
}{\void}
112 \func{}{wxAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{bitmap
}}
116 \func{}{wxAcceleratorTable
}{\param{int
}{ n
},
\param{wxAcceleratorEntry
}{ entries
[]}}
118 Creates from an array of
\helpref{wxAcceleratorEntry
}{wxacceleratorentry
} objects.
120 \func{}{wxAcceleratorTable
}{\param{const wxString\&
}{ resource
}}
122 Loads the accelerator table from a Windows resource (Windows only).
124 \wxheading{Parameters
}
126 \docparam{n
}{Number of accelerator entries.
}
128 \docparam{entries
}{The array of entries.
}
130 \docparam{resource
}{Name of a Windows accelerator.
}
132 \membersection{wxAcceleratorTable::
\destruct{wxAcceleratorTable
}}
134 \func{}{\destruct{wxAcceleratorTable
}}{\void}
136 Destroys the wxAcceleratorTable object.
138 \membersection{wxAcceleratorTable::Ok
}\label{wxacceleratortableok
}
140 \constfunc{bool
}{Ok
}{\void}
142 Returns TRUE if the accelerator table is valid.
144 \membersection{wxAcceleratorTable::operator $=$
}
146 \func{wxAcceleratorTable\&
}{operator $=$
}{\param{const wxAcceleratorTable\&
}{accel
}}
148 Assignment operator. This operator does not copy any data, but instead
149 passes a pointer to the data in
{\it accel
} and increments a reference
150 counter. It is a fast operation.
152 \wxheading{Parameters
}
154 \docparam{accel
}{Accelerator table to assign.
}
156 \wxheading{Return value
}
158 Returns 'this' object.
160 \membersection{wxAcceleratorTable::operator $==$
}
162 \func{bool
}{operator $==$
}{\param{const wxAcceleratorTable\&
}{accel
}}
164 Equality operator. This operator tests whether the internal data pointers are
167 \wxheading{Parameters
}
169 \docparam{accel
}{Accelerator table to compare with 'this'
}
171 \wxheading{Return value
}
173 Returns TRUE if the accelerator tables were effectively equal, FALSE otherwise.
175 \membersection{wxAcceleratorTable::operator $!=$
}
177 \func{bool
}{operator $!=$
}{\param{const wxAcceleratorTable\&
}{accel
}}
179 Inequality operator. This operator tests whether the internal data pointers are
180 unequal (a fast test).
182 \wxheading{Parameters
}
184 \docparam{accel
}{Accelerator table to compare with 'this'
}
186 \wxheading{Return value
}
188 Returns TRUE if the accelerator tables were unequal, FALSE otherwise.