Adds a focus outline to a component. More...
#include <juce_FocusOutline.h>
Classes | |
struct | OutlineWindowProperties |
Defines the focus outline window properties. More... | |
Public Member Functions | |
FocusOutline (std::unique_ptr< OutlineWindowProperties > props) | |
Creates a FocusOutline. More... | |
~FocusOutline () override | |
Destructor. More... | |
void | setOwner (Component *componentToFollow) |
Attaches the outline to a component. More... | |
Private Member Functions | |
virtual void | componentBeingDeleted (Component &component) |
Called when the component is in the process of being deleted. More... | |
void | componentBroughtToFront (Component &) override |
Called when the component is brought to the top of the z-order. More... | |
virtual void | componentChildrenChanged (Component &component) |
Called when the component has children added or removed, or their z-order changes. More... | |
virtual void | componentEnablementChanged (Component &component) |
void | componentMovedOrResized (Component &, bool, bool) override |
Called when the component's position or size changes. More... | |
virtual void | componentNameChanged (Component &component) |
Called when the component's name is changed. More... | |
void | componentParentHierarchyChanged (Component &) override |
Called to indicate that the component's parents have changed. More... | |
void | componentVisibilityChanged (Component &) override |
Called when the component is made visible or invisible. More... | |
void | updateOutlineWindow () |
void | updateParent () |
Private Attributes | |
WeakReference< Component > | lastParentComp |
std::unique_ptr< Component > | outlineWindow |
WeakReference< Component > | owner |
std::unique_ptr< OutlineWindowProperties > | properties |
bool | reentrant = false |
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}
juce::FocusOutline::FocusOutline | ( | std::unique_ptr< OutlineWindowProperties > | props | ) |
Creates a FocusOutline.
Call setOwner to attach it to a component.
|
override |
Destructor.
|
virtualinherited |
Called when the component is in the process of being deleted.
This callback is made from inside the destructor, so be very, very cautious about what you do in here.
In particular, bear in mind that it's the Component base class's destructor that calls this - so if the object that's being deleted is a subclass of Component, then the subclass layers of the object will already have been destructed when it gets to this point!
component | the component that was deleted |
Reimplemented in juce::ComponentMovementWatcher, and juce::RelativeCoordinatePositionerBase.
|
overrideprivatevirtual |
Called when the component is brought to the top of the z-order.
component | the component that was moved |
Reimplemented from juce::ComponentListener.
|
virtualinherited |
Called when the component has children added or removed, or their z-order changes.
component | the component whose children have changed |
Reimplemented in juce::DropShadower, and juce::RelativeCoordinatePositionerBase.
|
virtualinherited |
|
overrideprivatevirtual |
Called when the component's position or size changes.
component | the component that was moved or resized |
wasMoved | true if the component's top-left corner has just moved |
wasResized | true if the component's width or height has just changed |
Reimplemented from juce::ComponentListener.
|
virtualinherited |
Called when the component's name is changed.
component | the component that had its name changed |
Reimplemented in juce::MultiDocumentPanel.
|
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).
component | the component that this listener is registered with |
Reimplemented from juce::ComponentListener.
|
overrideprivatevirtual |
Called when the component is made visible or invisible.
component | the component that changed |
Reimplemented from juce::ComponentListener.
void juce::FocusOutline::setOwner | ( | Component * | componentToFollow | ) |
Attaches the outline to a component.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |