Click or drag to resize

Accelerator Class

X#
Create an accelerator table.
Inheritance Hierarchy
Object
  VObject
    Accelerator

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS Accelerator INHERIT VObject
Request Example View Source

The Accelerator type exposes the following members.

Constructors
  NameDescription
Public methodAccelerator
Load an accelerator table from a resource entity.
Top
Properties
  NameDescription
Public propertyEmpty
Returns TRUE when the accelerator table contains no keys.
Top
Methods
  NameDescription
Public methodAddAccelerator
Adds all accelerator keys of one accelerator object to another
Public methodAddKey
Adds a new accelerator key to the accelerator table
Public methodCreate

Creates the underlying windows accelerator.

Public methodDestroy
Provide a method to de-instantiate an Accelerator object.
(Overrides Destroy.)
Public methodHandle
Return the handle for an accelerator.
Top
Fields
  NameDescription
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks
Many applications use accelerators as keyboard equivalents for menu selections. An accelerator is a keystroke sequence that is associated with a particular menu command—the accelerator is used to execute the menu command without requiring the application user to first display the menu and then choose the command. For example, if the File New command had an accelerator of Ctrl+N, you could simply press this key combination to open a new document, rather than having to choose the File menu and then the New command. Each window can be given its own accelerator using the Window:Accelerator property. An accelerator generates events as though its associated menu command was actually selected. Note that an accelerator's menu command does not even have to be visible on any menu—thus an accelerator can be seen as a direct keystroke sequence for generating a command event.
Examples
The following example demonstrates the use of the Accelerator class:
X#
1METHOD Init() CLASS MyTopAppWindow
2SUPER:Init()
3SELF:Show()
4SELF:Accelerator := Accelerator{IDA_HOTKEYS}
In Windows, an accelerator object is created using the ACCELERATORS statement in the resource entity. For example, the following defines three accelerator keys: "^X" for the Exit menu command, "Ctrl+Insert" for the Copy menu command, and "Shift+Insert" for the Paste menu command.
X#
1RESOURCE IDA_HOTKEYS ACCELERATORS
2BEGIN
3^X, IDMI_EXIT
4VK_INSERT, IDMI_COPY, VIRTKEY, CONTROL
5VK_INSERT, IDMI_PASTE, VIRTKEY, SHIFT
6END
See Also

Reference