JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::ComponentListener Class Reference

Gets informed about changes to a component's hierarchy or position. More...

#include "juce_ComponentListener.h"

Inheritance diagram for juce::ComponentListener:
juce::ComponentMovementWatcher juce::DropShadower juce::DropShadower::ParentVisibilityChangedListener juce::DropShadower::VirtualDesktopWatcher juce::FocusOutline juce::Label juce::MultiDocumentPanel juce::RelativeCoordinatePositionerBase juce::SidePanel juce::VBlankAttachment juce::Viewport juce::XEmbedComponent::Pimpl

Public Member Functions

virtual ~ComponentListener ()=default
 Destructor.
 
virtual void componentMovedOrResized (Component &component, bool wasMoved, bool wasResized)
 Called when the component's position or size changes.
 
virtual void componentBroughtToFront (Component &component)
 Called when the component is brought to the top of the z-order.
 
virtual void componentVisibilityChanged (Component &component)
 Called when the component is made visible or invisible.
 
virtual void componentChildrenChanged (Component &component)
 Called when the component has children added or removed, or their z-order changes.
 
virtual void componentParentHierarchyChanged (Component &component)
 Called to indicate that the component's parents have changed.
 
virtual void componentNameChanged (Component &component)
 Called when the component's name is changed.
 
virtual void componentBeingDeleted (Component &component)
 Called when the component is in the process of being deleted.
 
virtual void componentEnablementChanged (Component &component)
 

Detailed Description

Gets informed about changes to a component's hierarchy or position.

To monitor a component for changes, register a subclass of ComponentListener with the component using Component::addComponentListener().

Be sure to deregister listeners before you delete them!

See also
Component::addComponentListener, Component::removeComponentListener

@tags{GUI}

Definition at line 42 of file juce_ComponentListener.h.

Member Function Documentation

◆ componentBeingDeleted()

void juce::ComponentListener::componentBeingDeleted ( Component component)
virtual

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!

Parameters
componentthe component that was deleted

Reimplemented in juce::ComponentMovementWatcher, juce::RelativeCoordinatePositionerBase, and juce::ModalComponentManager::ModalItem.

Definition at line 35 of file juce_ComponentListener.cpp.

◆ componentBroughtToFront()

void juce::ComponentListener::componentBroughtToFront ( Component component)
virtual

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

Definition at line 30 of file juce_ComponentListener.cpp.

◆ componentChildrenChanged()

void juce::ComponentListener::componentChildrenChanged ( Component component)
virtual

Called when the component has children added or removed, or their z-order changes.

Parameters
componentthe component whose children have changed
See also
Component::childrenChanged, Component::addChildComponent, Component::removeChildComponent

Reimplemented in juce::RelativeCoordinatePositionerBase.

Definition at line 32 of file juce_ComponentListener.cpp.

◆ componentEnablementChanged()

void juce::ComponentListener::componentEnablementChanged ( Component component)
virtual

Definition at line 36 of file juce_ComponentListener.cpp.

◆ componentMovedOrResized()

void juce::ComponentListener::componentMovedOrResized ( Component component,
bool  wasMoved,
bool  wasResized 
)
virtual

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 in juce::ModalComponentManager::ModalItem, juce::ComponentMovementWatcher, juce::Viewport, juce::Label, and juce::RelativeCoordinatePositionerBase.

Definition at line 29 of file juce_ComponentListener.cpp.

◆ componentNameChanged()

void juce::ComponentListener::componentNameChanged ( Component component)
virtual

Called when the component's name is changed.

Parameters
componentthe component that had its name changed
See also
Component::setName, Component::getName

Reimplemented in juce::MultiDocumentPanel.

Definition at line 34 of file juce_ComponentListener.cpp.

◆ componentParentHierarchyChanged()

void juce::ComponentListener::componentParentHierarchyChanged ( Component component)
virtual

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 in juce::ComponentMovementWatcher, juce::RelativeCoordinatePositionerBase, juce::Label, juce::VBlankAttachment, juce::DropShadower::VirtualDesktopWatcher, and juce::DropShadower::ParentVisibilityChangedListener.

Definition at line 33 of file juce_ComponentListener.cpp.

◆ componentVisibilityChanged()

void juce::ComponentListener::componentVisibilityChanged ( Component component)
virtual

Called when the component is made visible or invisible.

Parameters
componentthe component that changed
See also
Component::setVisible

Reimplemented in juce::ModalComponentManager::ModalItem, juce::ComponentMovementWatcher, juce::Label, and juce::DropShadower::ParentVisibilityChangedListener.

Definition at line 31 of file juce_ComponentListener.cpp.


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