wxAcceleratorTable
generated from ../src/mod_gui/misc/acctable.cppAn accelerator table allows the application to specify a table of keyboard shortcuts for menus or other commands. On Windows, menu or button commands are supported; on GTK, only menu commands are supported. The following example adds an accelerator to a frame. When CTRL-F1 is pressed the menu action associated with id 1 is executed.
wxTheApp.onInit = init;
function init()
{
var frame = new wxFrame(null, -1, "Accelerator Test");
var menuBar = new wxMenuBar();
var menu = new wxMenu();
var idInfoAbout = 1;
menu = new wxMenu();
menu.append(idInfoAbout, "About", infoAboutMenu);
menuBar.append(menu, "Info");
frame.menuBar = menuBar;
var entries = new Array();
entries[0] = new wxAcceleratorEntry(wxAcceleratorEntry.CTRL,
wxKeyCode.F1,
idInfoAbout);
frame.acceleratorTable = new wxAcceleratorTable(entries);
menu.getItem(idInfoAbout).accel = entries[0];
topWindow = frame;
frame.visible = true;
return true;
}
function infoAboutMenu(event)
{
wxMessageBox("Accelerator Test Version 1.0");
}
Constants
Constructor
wxAcceleratorTable
wxAcceleratorTable(Entries)
| Name | Type | Default | Description |
|---|---|---|---|
| Entries | Array | An array of wxAcceleratorEntry objects |
Constructs a new wxAcceleratorTable object.
Properties
| Name | Type | Description |
|---|---|---|
ok ![]() |
Boolean | Returns true when the accelerator table is valid |

© 2002 - 2007 Franky Braem.