Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXAccelTable Class Reference

The accelerator table sends a message to a specific target object when the indicated key and modifier combination is pressed. More...

#include <FXAccelTable.h>

Inheritance diagram for FX::FXAccelTable:
FX::FXObject

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
 
FXObjecttargetOfAccel (FXHotKey hotkey) const
 Return target object of the given accelerator key-combination.
 
FXObjecttargetOfAccel (const FXchar *string) const
 Parse key-combination description and return its target.
 
FXObjecttargetOfAccel (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...
 

Detailed Description

The accelerator table sends a message to a specific target object when the indicated key and modifier combination is pressed.

Member Function Documentation

◆ parseAccel()

static FXHotKey FX::FXAccelTable::parseAccel ( const FXchar *  string)
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).

◆ unparseAccel()

static FXString FX::FXAccelTable::unparseAccel ( FXHotKey  key)
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".


The documentation for this class was generated from the following file:

Copyright © 1997-2022 Jeroen van der Zijp