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

#include <juce_DropShadower.h>

Inheritance diagram for juce::DropShadower:
juce::ComponentListener

Classes

class  ShadowWindow
class  ParentVisibilityChangedListener

Public Member Functions

 DropShadower (const DropShadow &shadowType)
 ~DropShadower () override
void setOwner (Component *componentToFollow)

Private Member Functions

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

Private Attributes

WeakReference< Componentowner
OwnedArray< ComponentshadowWindows
DropShadow shadow
bool reentrant = false
WeakReference< ComponentlastParentComp
std::unique_ptr< ParentVisibilityChangedListenervisibilityChangedListener

Detailed Description

Adds a drop-shadow to a component.

This object creates and manages a set of components which sit around a component, creating a gaussian shadow around it. The components will track the position of the component and if it's brought to the front they'll also follow this.

For desktop windows you don't need to use this class directly - just set the Component::windowHasDropShadow flag when calling Component::addToDesktop(), and the system will create one of these if it's needed (which it obviously isn't on the Mac, for example).

@tags{GUI}

Constructor & Destructor Documentation

◆ DropShadower()

juce::DropShadower::DropShadower ( const DropShadow & shadowType)

Creates a DropShadower.

◆ ~DropShadower()

juce::DropShadower::~DropShadower ( )
override

Destructor.

Member Function Documentation

◆ componentBroughtToFront()

void juce::DropShadower::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.

◆ componentChildrenChanged()

void juce::DropShadower::componentChildrenChanged ( Component & component)
overrideprivatevirtual

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 from juce::ComponentListener.

◆ componentMovedOrResized()

void juce::DropShadower::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::DropShadower::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::DropShadower::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::DropShadower::setOwner ( Component * componentToFollow)

Attaches the DropShadower to the component you want to shadow.

◆ updateParent()

void juce::DropShadower::updateParent ( )
private

◆ updateShadows()

void juce::DropShadower::updateShadows ( )
private

Member Data Documentation

◆ lastParentComp

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

◆ owner

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

◆ reentrant

bool juce::DropShadower::reentrant = false
private

◆ shadow

DropShadow juce::DropShadower::shadow
private

◆ shadowWindows

OwnedArray<Component> juce::DropShadower::shadowWindows
private

◆ visibilityChangedListener

std::unique_ptr<ParentVisibilityChangedListener> juce::DropShadower::visibilityChangedListener
private

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