JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::Component::Positioner Class Referenceabstract

Base class for objects that can be used to automatically position a component according to some kind of algorithm. More...

#include <juce_Component.h>

Inheritance diagram for juce::Component::Positioner:
Collaboration diagram for juce::Component::Positioner:

Public Member Functions

 Positioner (Component &component) noexcept
 Creates a Positioner which can control the specified component. More...
 
virtual ~Positioner ()=default
 Destructor. More...
 
virtual void applyNewBounds (const Rectangle< int > &newBounds)=0
 Attempts to set the component's position to the given rectangle. More...
 
ComponentgetComponent () const noexcept
 Returns the component that this positioner controls. More...
 

Private Attributes

Componentcomponent
 

Detailed Description

Base class for objects that can be used to automatically position a component according to some kind of algorithm.

The component class simply holds onto a reference to a Positioner, but doesn't actually do anything with it - all the functionality must be implemented by the positioner itself (e.g. it might choose to watch some kind of value and move the component when the value changes).

Constructor & Destructor Documentation

◆ Positioner()

juce::Component::Positioner::Positioner ( Component component)
explicitnoexcept

Creates a Positioner which can control the specified component.

◆ ~Positioner()

virtual juce::Component::Positioner::~Positioner ( )
virtualdefault

Destructor.

Member Function Documentation

◆ applyNewBounds()

virtual void juce::Component::Positioner::applyNewBounds ( const Rectangle< int > &  newBounds)
pure virtual

Attempts to set the component's position to the given rectangle.

Unlike simply calling Component::setBounds(), this may involve the positioner being smart enough to adjust itself to fit the new bounds.

◆ getComponent()

Component& juce::Component::Positioner::getComponent ( ) const
inlinenoexcept

Returns the component that this positioner controls.

Member Data Documentation

◆ component

Component& juce::Component::Positioner::component
private

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