Public Member Functions

DropShadower Class Reference

Adds a drop-shadow to a component. More...

Inherits ComponentListener.

List of all members.

Public Member Functions

 DropShadower (float alpha=0.5f, int xOffset=1, int yOffset=5, float blurRadius=10.0f)
 Creates a DropShadower.
virtual ~DropShadower ()
 Destructor.
void setOwner (Component *componentToFollow)
 Attaches the DropShadower to the component you want to shadow.
void componentMovedOrResized (Component &component, bool wasMoved, bool wasResized)
 Called when the component's position or size changes.
void componentBroughtToFront (Component &component)
 Called when the component is brought to the top of the z-order.
void componentParentHierarchyChanged (Component &component)
 Called to indicate that the component's parents have changed.
void componentVisibilityChanged (Component &component)
 Called when the component is made visible or invisible.

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).


Constructor & Destructor Documentation

DropShadower::DropShadower ( float  alpha = 0.5f,
int  xOffset = 1,
int  yOffset = 5,
float  blurRadius = 10.0f 
)

Creates a DropShadower.

Parameters:
alphathe opacity of the shadows, from 0 to 1.0
xOffsetthe horizontal displacement of the shadow, in pixels
yOffsetthe vertical displacement of the shadow, in pixels
blurRadiusthe radius of the blur to use for creating the shadow
virtual DropShadower::~DropShadower (  ) [virtual]

Destructor.


Member Function Documentation

void DropShadower::setOwner ( Component componentToFollow )

Attaches the DropShadower to the component you want to shadow.

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

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

Reimplemented from ComponentListener.

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

void DropShadower::componentVisibilityChanged ( Component component ) [virtual]

Called when the component is made visible or invisible.

Parameters:
componentthe component that changed
See also:
Component::setVisible

Reimplemented from ComponentListener.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines