Adds a drop-shadow to a component. More...
Inherits ComponentListener.
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. | |
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).
| DropShadower::DropShadower | ( | float | alpha = 0.5f, |
| int | xOffset = 1, |
||
| int | yOffset = 5, |
||
| float | blurRadius = 10.0f |
||
| ) |
Creates a DropShadower.
| alpha | the opacity of the shadows, from 0 to 1.0 |
| xOffset | the horizontal displacement of the shadow, in pixels |
| yOffset | the vertical displacement of the shadow, in pixels |
| blurRadius | the radius of the blur to use for creating the shadow |
| virtual DropShadower::~DropShadower | ( | ) | [virtual] |
Destructor.
| 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.
| 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 ComponentListener.
| void DropShadower::componentBroughtToFront | ( | Component & | component ) | [virtual] |
Called when the component is brought to the top of the z-order.
| component | the component that was moved |
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).
| component | the component that this listener is registered with |
Reimplemented from ComponentListener.
| void DropShadower::componentVisibilityChanged | ( | Component & | component ) | [virtual] |
Called when the component is made visible or invisible.
| component | the component that changed |
Reimplemented from ComponentListener.