LMMS
Loading...
Searching...
No Matches
juce::FocusOutline Class Reference

#include <juce_FocusOutline.h>

Inheritance diagram for juce::FocusOutline:
juce::ComponentListener

Classes

struct  OutlineWindowProperties

Public Member Functions

 FocusOutline (std::unique_ptr< OutlineWindowProperties > props)
 ~FocusOutline () override
void setOwner (Component *componentToFollow)

Private Member Functions

void componentMovedOrResized (Component &, bool, bool) override
void componentBroughtToFront (Component &) override
void componentParentHierarchyChanged (Component &) override
void componentVisibilityChanged (Component &) override
void updateOutlineWindow ()
void updateParent ()
Private Member Functions inherited from juce::ComponentListener
virtual ~ComponentListener ()=default
virtual void componentChildrenChanged (Component &component)
virtual void componentNameChanged (Component &component)
virtual void componentBeingDeleted (Component &component)
virtual void componentEnablementChanged (Component &component)

Private Attributes

std::unique_ptr< OutlineWindowPropertiesproperties
WeakReference< Componentowner
std::unique_ptr< ComponentoutlineWindow
WeakReference< ComponentlastParentComp
bool reentrant = false

Detailed Description

Adds a focus outline to a component.

This object creates and manages a component that sits on top of a target component. It will track the position of the target component and will be brought to the front with the tracked component.

Use the Component::setHasFocusOutline() method to indicate that a component should have a focus outline drawn around it, and when it receives keyboard focus one of these objects will be created using the LookAndFeel::createFocusOutlineForComponent() method. You can override this method in your own LookAndFeel classes to draw a custom outline if required.

@tags{GUI}

Constructor & Destructor Documentation

◆ FocusOutline()

juce::FocusOutline::FocusOutline ( std::unique_ptr< OutlineWindowProperties > props)

Creates a FocusOutline.

Call setOwner to attach it to a component.

◆ ~FocusOutline()

juce::FocusOutline::~FocusOutline ( )
override

Destructor.

Member Function Documentation

◆ componentBroughtToFront()

void juce::FocusOutline::componentBroughtToFront ( Component & component)
overrideprivatevirtual

Called when the component is brought to the top of the z-order.

Parameters
componentthe component that was moved
See also
Component::toFront, Component::broughtToFront

Reimplemented from juce::ComponentListener.

◆ componentMovedOrResized()

void juce::FocusOutline::componentMovedOrResized ( Component & component,
bool wasMoved,
bool wasResized )
overrideprivatevirtual

Called when the component's position or size changes.

Parameters
componentthe component that was moved or resized
wasMovedtrue if the component's top-left corner has just moved
wasResizedtrue if the component's width or height has just changed
See also
Component::setBounds, Component::resized, Component::moved

Reimplemented from juce::ComponentListener.

◆ componentParentHierarchyChanged()

void juce::FocusOutline::componentParentHierarchyChanged ( Component & component)
overrideprivatevirtual

Called to indicate that the component's parents have changed.

When a component is added or removed from its parent, all of its children will produce this notification (recursively - so all children of its children will also be called as well).

Parameters
componentthe component that this listener is registered with
See also
Component::parentHierarchyChanged

Reimplemented from juce::ComponentListener.

◆ componentVisibilityChanged()

void juce::FocusOutline::componentVisibilityChanged ( Component & component)
overrideprivatevirtual

Called when the component is made visible or invisible.

Parameters
componentthe component that changed
See also
Component::setVisible

Reimplemented from juce::ComponentListener.

◆ setOwner()

void juce::FocusOutline::setOwner ( Component * componentToFollow)

Attaches the outline to a component.

◆ updateOutlineWindow()

void juce::FocusOutline::updateOutlineWindow ( )
private

◆ updateParent()

void juce::FocusOutline::updateParent ( )
private

Member Data Documentation

◆ lastParentComp

WeakReference<Component> juce::FocusOutline::lastParentComp
private

◆ outlineWindow

std::unique_ptr<Component> juce::FocusOutline::outlineWindow
private

◆ owner

WeakReference<Component> juce::FocusOutline::owner
private

◆ properties

std::unique_ptr<OutlineWindowProperties> juce::FocusOutline::properties
private

◆ reentrant

bool juce::FocusOutline::reentrant = false
private

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