KeyMappingEditorComponent Class Reference

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

Inherits Component, TreeViewItem, ChangeListener, and ButtonListener.

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 throw ()
 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 ()
void resized ()
void changeListenerCallback (void *)
bool mightContainSubItems ()
const String getUniqueName () const
void buttonClicked (Button *button)

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:
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.


Member Function Documentation

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

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

Parameters:
mainBackground colour to use for most of the background
textColour colour to use for the text
KeyPressMappingSet* KeyMappingEditorComponent::getMappings (  )  const throw ()

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]

For internal use only.

Reimplemented from Component.

void KeyMappingEditorComponent::resized (  )  [virtual]

For internal use only.

Reimplemented from Component.

void KeyMappingEditorComponent::changeListenerCallback ( void *   )  [virtual]

For internal use only.

Implements ChangeListener.

bool KeyMappingEditorComponent::mightContainSubItems (  )  [virtual]

For internal use only.

Implements TreeViewItem.

const String KeyMappingEditorComponent::getUniqueName (  )  const [virtual]

For internal use only.

Reimplemented from TreeViewItem.

void KeyMappingEditorComponent::buttonClicked ( Button button  )  [virtual]

For internal use only.

Implements ButtonListener.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:13 2010 for JUCE by  doxygen 1.6.3