Accelerator Class | |
Create an accelerator table.
Inheritance Hierarchy
Namespace:
VO
Assembly:
VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax The Accelerator type exposes the following members.
Constructors
| Name | Description |
---|
| Accelerator |
Load an accelerator table from a resource entity.
|
TopProperties
| Name | Description |
---|
| Empty |
Returns TRUE when the accelerator table contains no keys.
|
TopMethods
| Name | Description |
---|
| AddAccelerator |
Adds all accelerator keys of one accelerator object to another
|
| AddKey |
Adds a new accelerator key to the accelerator table
|
| Create | Creates the underlying windows accelerator. |
| Destroy |
Provide a method to de-instantiate an Accelerator object.
(Overrides Destroy.) |
| Handle |
Return the handle for an accelerator.
|
TopFields 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:
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.
1RESOURCE IDA_HOTKEYS ACCELERATORS
2BEGIN
3^X, IDMI_EXIT
4VK_INSERT, IDMI_COPY, VIRTKEY, CONTROL
5VK_INSERT, IDMI_PASTE, VIRTKEY, SHIFT
6END
See Also