Public Types | Public Member Functions

KeyMappingEditorComponent Class Reference

A component to allow editing of the keymaps stored by a KeyPressMappingSet object. More...

Inherits Component.

List of all members.

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.
KeyPressMappingSetgetMappings () 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.

Detailed Description

A component to allow editing of the keymaps stored by a KeyPressMappingSet object.

See also:
KeyPressMappingSet

Member Enumeration Documentation

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

See also:
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator:
backgroundColourId 

The background colour to fill the editor background.

textColourId 

The colour for the text.


Constructor & Destructor Documentation

KeyMappingEditorComponent::KeyMappingEditorComponent ( KeyPressMappingSet mappingSet,
bool  showResetToDefaultButton 
)

Creates a KeyMappingEditorComponent.

Parameters:
mappingSetthis is the set of mappings to display and edit. Make sure the mappings object is not deleted before this component!
showResetToDefaultButtonif true, then at the bottom of the list, the component will include a 'reset to defaults' button.
virtual KeyMappingEditorComponent::~KeyMappingEditorComponent (  ) [virtual]

Destructor.


Member Function Documentation

void KeyMappingEditorComponent::setColours ( const Colour mainBackground,
const Colour textColour 
)

Sets up the colours to use for parts of the component.

Parameters:
mainBackgroundcolour to use for most of the background
textColourcolour 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.

See also:
getParentComponent, isShowing, ComponentListener::componentParentHierarchyChanged

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.

See also:
moved, setSize

Reimplemented from Component.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines