back to gui 

wxAcceleratorTable

generated from ../src/mod_gui/misc/acctable.cpp

An 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 read only Boolean Returns true when the accelerator table is valid


SourceForge.net Logo Support This Project

Table of Contents

Constructor

wxAcceleratorTable

Properties

ok


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.