Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The accelerator table sends a message to a specific target object when the indicated key and modifier combination is pressed. More...
#include <FXAccelTable.h>
Classes | |
struct | FXAccelKey |
Public Member Functions | |
long | onKeyPress (FXObject *, FXSelector, void *) |
long | onKeyRelease (FXObject *, FXSelector, void *) |
FXAccelTable () | |
Construct empty accelerator table. | |
void | addAccel (FXHotKey hotkey, FXObject *target=nullptr, FXSelector seldn=0, FXSelector selup=0) |
Add accelerator key-combination into the accelerator table. | |
void | addAccel (const FXchar *string, FXObject *target=nullptr, FXSelector seldn=0, FXSelector selup=0) |
Parse key-combination description and add it into the accelerator table. | |
void | addAccel (const FXString &string, FXObject *target=nullptr, FXSelector seldn=0, FXSelector selup=0) |
void | removeAccel (FXHotKey hotkey) |
Remove accelerator key combination from the accelerator table. | |
void | removeAccel (const FXchar *string) |
Parse key-combination description and remove it from the accelerator table. | |
void | removeAccel (const FXString &string) |
FXbool | hasAccel (FXHotKey hotkey) const |
Return true if accelerator accelerator key-combination is in accelerator table. | |
FXbool | hasAccel (const FXchar *string) const |
Parse key-combination description and return true if it is in the accelerator table. | |
FXbool | hasAccel (const FXString &string) const |
FXObject * | targetOfAccel (FXHotKey hotkey) const |
Return target object of the given accelerator key-combination. | |
FXObject * | targetOfAccel (const FXchar *string) const |
Parse key-combination description and return its target. | |
FXObject * | targetOfAccel (const FXString &string) const |
virtual void | save (FXStream &store) const |
Save table to a stream. | |
virtual void | load (FXStream &store) |
Load table from a stream. | |
virtual | ~FXAccelTable () |
Destroy accelerator table. | |
Public Member Functions inherited from FX::FXObject | |
const FXchar * | getClassName () const |
Get class name of some object. | |
FXbool | isMemberOf (const FXMetaClass *metaclass) const |
Check if object is member of metaclass. | |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
Try handle message safely, catching certain exceptions. | |
virtual long | onDefault (FXObject *, FXSelector, void *) |
Called for unhandled messages. | |
virtual | ~FXObject () |
Virtual destructor. | |
Static Public Member Functions | |
static FXHotKey | parseAccel (const FXchar *string) |
Parse accelerator from string, yielding modifier and key code. More... | |
static FXHotKey | parseAccel (const FXString &string) |
static FXString | unparseAccel (FXHotKey key) |
Unparse hot key comprising modifier and key code back into a string suitable for parsing with fxparseHotKey. More... | |
The accelerator table sends a message to a specific target object when the indicated key and modifier combination is pressed.
|
static |
Parse accelerator from string, yielding modifier and key code.
The syntax of the string is:
<Accelerator> ::= (<Modifier> ('-' | '+'))* <Key>
where:
<Modifier> ::= 'Ctl' | 'Ctrl' | 'Alt' | 'Meta' | 'Shift'
<Key> ::= 'Home' | 'End' | 'PgUp' | 'PgDn' | 'Left' | 'Right' | 'Up' | 'Down' | 'Ins' | 'Del' | 'Esc' | 'Tab' | 'Return' | 'Enter' | 'Back' | 'Spc' | 'Space' | 'F'<Digit><Digit>? | '#'<HexDigit>+ | <Letter>
<Digit> ::= '0' ... '1' <Letter> ::= 'A' ... 'Z' <HexDigit> ::= '0' ... '9', 'A' ... 'F'
Case is not significant, but uppercase is preferred. For example, parseAccel("Ctl+Shift+X") yields the same value as: MKUINT(KEY_X,CONTROLMASK|SHIFTMASK).
|
static |
Unparse hot key comprising modifier and key code back into a string suitable for parsing with fxparseHotKey.
For example, an input of MKUINT(KEY_X,CONTROLMASK|SHIFTMASK) will return the string "Ctl+Shift+X".
Copyright © 1997-2022 Jeroen van der Zijp |