A component to allow editing of the keymaps stored by a KeyPressMappingSet object. More...
Inherits Component.
Public Types | |
| enum | ColourIds { backgroundColourId = 0x100ad00, textColourId = 0x100ad01 } |
A set of colour IDs to use to change the colour of various aspects of the editor. More... | |
Public Member Functions | |
| KeyMappingEditorComponent (KeyPressMappingSet &mappingSet, bool showResetToDefaultButton) | |
| Creates a KeyMappingEditorComponent. | |
| virtual | ~KeyMappingEditorComponent () |
| Destructor. | |
| void | setColours (const Colour &mainBackground, const Colour &textColour) |
| Sets up the colours to use for parts of the component. | |
| KeyPressMappingSet & | getMappings () const noexcept |
| Returns the KeyPressMappingSet that this component is acting upon. | |
| virtual bool | shouldCommandBeIncluded (CommandID commandID) |
| Can be overridden if some commands need to be excluded from the list. | |
| virtual bool | isCommandReadOnly (CommandID commandID) |
| Can be overridden to indicate that some commands are shown as read-only. | |
| virtual const String | getDescriptionForKeyPress (const KeyPress &key) |
| This can be overridden to let you change the format of the string used to describe a keypress. | |
| void | parentHierarchyChanged () |
| Called to indicate that the component's parents have changed. | |
| void | resized () |
| Called when this component's size has been changed. | |
A component to allow editing of the keymaps stored by a KeyPressMappingSet object.
A set of colour IDs to use to change the colour of various aspects of the editor.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
To change the colours of the menu that pops up
| KeyMappingEditorComponent::KeyMappingEditorComponent | ( | KeyPressMappingSet & | mappingSet, |
| bool | showResetToDefaultButton | ||
| ) |
Creates a KeyMappingEditorComponent.
| mappingSet | this is the set of mappings to display and edit. Make sure the mappings object is not deleted before this component! |
| showResetToDefaultButton | if true, then at the bottom of the list, the component will include a 'reset to defaults' button. |
| virtual KeyMappingEditorComponent::~KeyMappingEditorComponent | ( | ) | [virtual] |
Destructor.
| void KeyMappingEditorComponent::setColours | ( | const Colour & | mainBackground, |
| const Colour & | textColour | ||
| ) |
Sets up the colours to use for parts of the component.
| mainBackground | colour to use for most of the background |
| textColour | colour to use for the text |
| KeyPressMappingSet& KeyMappingEditorComponent::getMappings | ( | ) | const |
Returns the KeyPressMappingSet that this component is acting upon.
| virtual bool KeyMappingEditorComponent::shouldCommandBeIncluded | ( | CommandID | commandID ) | [virtual] |
Can be overridden if some commands need to be excluded from the list.
By default this will use the KeyPressMappingSet's shouldCommandBeVisibleInEditor() method to decide what to return, but you can override it to handle special cases.
| virtual bool KeyMappingEditorComponent::isCommandReadOnly | ( | CommandID | commandID ) | [virtual] |
Can be overridden to indicate that some commands are shown as read-only.
By default this will use the KeyPressMappingSet's shouldCommandBeReadOnlyInEditor() method to decide what to return, but you can override it to handle special cases.
| virtual const String KeyMappingEditorComponent::getDescriptionForKeyPress | ( | const KeyPress & | key ) | [virtual] |
This can be overridden to let you change the format of the string used to describe a keypress.
This is handy if you're using non-standard KeyPress objects, e.g. for custom keys that are triggered by something else externally. If you override the method, be sure to let the base class's method handle keys you're not interested in.
| void KeyMappingEditorComponent::parentHierarchyChanged | ( | ) | [virtual] |
Called to indicate that the component's parents have changed.
When a component is added or removed from its parent, this method will be called on all of its children (recursively - so all children of its children will also be called as well).
Subclasses can override this if they need to react to this in some way.
Reimplemented from Component.
| void KeyMappingEditorComponent::resized | ( | ) | [virtual] |
Called when this component's size has been changed.
A component can implement this method to do things such as laying out its child components when its width or height changes.
The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).
If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.
Reimplemented from Component.