Loading...
Searching...
No Matches
juce::ComponentTraverser Class Referenceabstract

## Detailed Description

Base class for traversing components.

If you need custom focus or keyboard focus traversal for a component you can create a subclass of ComponentTraverser and return it from Component::createFocusTraverser() or Component::createKeyboardFocusTraverser().

See also
  Component::createFocusTraverser, Component::createKeyboardFocusTraverser

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

- juce_gui_basics/components/juce_ComponentTraverser.h

Inheritance diagram for juce::ComponentTraverser:

## Public Member Functions

virtual | ~ComponentTraverser ()=default
| Destructor.
virtual Component * | getDefaultComponent (Component *parentComponent)=0
| Returns the component that should be used as the traversal entry point within the given parent component.
virtual Component * | getNextComponent (Component *current)=0
| Returns the component that comes after the specified one when moving "forwards".
virtual Component * | getPreviousComponent (Component *current)=0
| Returns the component that comes after the specified one when moving "backwards".
virtual std::vector< Component * > | getAllComponents (Component *parentComponent)=0
| Returns all of the traversable components within the given parent component in traversal order.

## Constructors and Destructors

## ~ComponentTraverser()

virtual juce::ComponentTraverser::~ComponentTraverser | ( |  | ) |

virtual default

Destructor.

## Member Functions

## getDefaultComponent()

virtual Component * juce::ComponentTraverser::getDefaultComponent | ( | Component * | parentComponent | ) |

pure virtual

Returns the component that should be used as the traversal entry point within the given parent component.

This must return nullptr if there is no default component.

Implemented in juce::FocusTraverser, and juce::KeyboardFocusTraverser.

## getNextComponent()

virtual Component * juce::ComponentTraverser::getNextComponent | ( | Component * | current | ) |

pure virtual

Returns the component that comes after the specified one when moving "forwards".

This must return nullptr if there is no next component.

Implemented in juce::FocusTraverser, and juce::KeyboardFocusTraverser.

## getPreviousComponent()

virtual Component * juce::ComponentTraverser::getPreviousComponent | ( | Component * | current | ) |

pure virtual

Returns the component that comes after the specified one when moving "backwards".

This must return nullptr if there is no previous component.

Implemented in juce::FocusTraverser, and juce::KeyboardFocusTraverser.

## getAllComponents()

virtual std::vector< Component * > juce::ComponentTraverser::getAllComponents | ( | Component * | parentComponent | ) |

pure virtual

Returns all of the traversable components within the given parent component in traversal order.

Implemented in juce::FocusTraverser, and juce::KeyboardFocusTraverser.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited