JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions
KeyboardFocusTraverser Class Reference

Controls the order in which focus moves between components. More...

List of all members.

Public Member Functions

 KeyboardFocusTraverser ()
virtual ~KeyboardFocusTraverser ()
 Destructor.
virtual ComponentgetNextComponent (Component *current)
 Returns the component that should be given focus after the specified one when moving "forwards".
virtual ComponentgetPreviousComponent (Component *current)
 Returns the component that should be given focus after the specified one when moving "backwards".
virtual ComponentgetDefaultComponent (Component *parentComponent)
 Returns the component that should receive focus be default within the given parent component.

Detailed Description

Controls the order in which focus moves between components.

The default algorithm used by this class to work out the order of traversal is as follows:

If you need traversal in a more customised way, you can create a subclass of KeyboardFocusTraverser that uses your own algorithm, and use Component::createFocusTraverser() to create it.

See also:
Component::setExplicitFocusOrder, Component::createFocusTraverser

Constructor & Destructor Documentation

Destructor.


Member Function Documentation

Returns the component that should be given focus after the specified one when moving "forwards".

The default implementation will return the next component which is to the right of or below this one.

This may return 0 if there's no suitable candidate.

Returns the component that should be given focus after the specified one when moving "backwards".

The default implementation will return the next component which is to the left of or above this one.

This may return 0 if there's no suitable candidate.

virtual Component* KeyboardFocusTraverser::getDefaultComponent ( Component parentComponent) [virtual]

Returns the component that should receive focus be default within the given parent component.

The default implementation will just return the foremost child component that wants focus.

This may return 0 if there's no suitable candidate.


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