This object is used to pass information about a particular command, such as its name, description and other usage flags.
When an ApplicationCommandTarget is asked to provide information about the commands it can perform, this is the structure gets filled-in to describe each one.
Public Types | |
| enum | CommandFlags { isDisabled = 1 << 0, isTicked = 1 << 1, wantsKeyUpDownCallbacks = 1 << 2, hiddenFromKeyEditor = 1 << 3, readOnlyInKeyEditor = 1 << 4, dontTriggerVisualFeedback = 1 << 5 } |
| Flags describing the ways in which this command should be used. More... | |
Public Member Functions | |
| ApplicationCommandInfo (const CommandID commandID) throw () | |
| void | setInfo (const String &shortName, const String &description, const String &categoryName, const int flags) throw () |
| Sets a number of the structures values at once. | |
| void | setActive (const bool isActive) throw () |
| An easy way to set or remove the isDisabled bit in the structure's flags field. | |
| void | setTicked (const bool isTicked) throw () |
| An easy way to set or remove the isTicked bit in the structure's flags field. | |
| void | addDefaultKeypress (const int keyCode, const ModifierKeys &modifiers) throw () |
| Handy method for adding a keypress to the defaultKeypresses array. | |
Public Attributes | |
| CommandID | commandID |
| The command's unique ID number. | |
| String | shortName |
| A short name to describe the command. | |
| String | description |
| A longer description of the command. | |
| String | categoryName |
| A named category that the command fits into. | |
| Array< KeyPress > | defaultKeypresses |
| A list of zero or more keypresses that should be used as the default keys for this command. | |
| int | flags |
| A bitwise-OR of the values specified in the CommandFlags enum. | |
|
|
Flags describing the ways in which this command should be used. A bitwise-OR of these values is stored in the ApplicationCommandInfo::flags variable.
|
|
|
|
|
||||||||||||||||||||
|
Sets a number of the structures values at once. The meanings of each of the parameters is described below, in the appropriate member variable's description. |
|
|
An easy way to set or remove the isDisabled bit in the structure's flags field. If isActive is true, the flags member has the isDisabled bit cleared; if isActive is false, the bit is set. |
|
|
An easy way to set or remove the isTicked bit in the structure's flags field.
|
|
||||||||||||
|
Handy method for adding a keypress to the defaultKeypresses array. This is just so you can write things like: myinfo.addDefaultKeypress (T('s'), ModifierKeys::commandModifier); myinfo.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier)); |
|
|
The command's unique ID number.
|
|
|
A short name to describe the command. This should be suitable for use in menus, on buttons that trigger the command, etc. You can use the setInfo() method to quickly set this and some of the command's other properties. |
|
|
A longer description of the command. This should be suitable for use in contexts such as a KeyMappingEditorComponent or pop-up tooltip describing what the command does. You can use the setInfo() method to quickly set this and some of the command's other properties. |
|
|
A named category that the command fits into. You can give your commands any category you like, and these will be displayed in contexts such as the KeyMappingEditorComponent, where the category is used to group commands together. You can use the setInfo() method to quickly set this and some of the command's other properties. |
|
|
A list of zero or more keypresses that should be used as the default keys for this command. Methods such as KeyPressMappingSet::resetToDefaultMappings() will use the keypresses in this list to initialise the default set of key-to-command mappings.
|
|
|
A bitwise-OR of the values specified in the CommandFlags enum. You can use the setInfo() method to quickly set this and some of the command's other properties. |