A button that contains a filled shape.
More...
Inherits Button.
List of all members.
Public Member Functions |
| | ShapeButton (const String &name, const Colour &normalColour, const Colour &overColour, const Colour &downColour) |
| | Creates a ShapeButton.
|
| | ~ShapeButton () |
| | Destructor.
|
| void | setShape (const Path &newShape, bool resizeNowToFitThisShape, bool maintainShapeProportions, bool hasDropShadow) |
| | Sets the shape to use.
|
| void | setColours (const Colour &normalColour, const Colour &overColour, const Colour &downColour) |
| | Set the colours to use for drawing the shape.
|
| void | setOutline (const Colour &outlineColour, float outlineStrokeWidth) |
| | Sets up an outline to draw around the shape.
|
Protected Member Functions |
| void | paintButton (Graphics &g, bool isMouseOverButton, bool isButtonDown) |
| | Subclasses should override this to actually paint the button's contents.
|
Detailed Description
A button that contains a filled shape.
- See also:
- Button, ImageButton, TextButton, ArrowButton
Constructor & Destructor Documentation
| ShapeButton::ShapeButton |
( |
const String & |
name, |
|
|
const Colour & |
normalColour, |
|
|
const Colour & |
overColour, |
|
|
const Colour & |
downColour |
|
) |
| |
Creates a ShapeButton.
- Parameters:
-
| name | a name to give the component - see Component::setName() |
| normalColour | the colour to fill the shape with when the mouse isn't over |
| overColour | the colour to use when the mouse is over the shape |
| downColour | the colour to use when the button is in the pressed-down state |
| ShapeButton::~ShapeButton |
( |
) |
|
Member Function Documentation
| void ShapeButton::setShape |
( |
const Path & |
newShape, |
|
|
bool |
resizeNowToFitThisShape, |
|
|
bool |
maintainShapeProportions, |
|
|
bool |
hasDropShadow |
|
) |
| |
Sets the shape to use.
- Parameters:
-
| newShape | the shape to use |
| resizeNowToFitThisShape | if true, the button will be resized to fit the shape's bounds |
| maintainShapeProportions | if true, the shape's proportions will be kept fixed when the button is resized |
| hasDropShadow | if true, the button will be given a drop-shadow effect |
| void ShapeButton::setColours |
( |
const Colour & |
normalColour, |
|
|
const Colour & |
overColour, |
|
|
const Colour & |
downColour |
|
) |
| |
Set the colours to use for drawing the shape.
- Parameters:
-
| normalColour | the colour to fill the shape with when the mouse isn't over |
| overColour | the colour to use when the mouse is over the shape |
| downColour | the colour to use when the button is in the pressed-down state |
| void ShapeButton::setOutline |
( |
const Colour & |
outlineColour, |
|
|
float |
outlineStrokeWidth |
|
) |
| |
Sets up an outline to draw around the shape.
- Parameters:
-
| outlineColour | the colour to use |
| outlineStrokeWidth | the thickness of line to draw |
| void ShapeButton::paintButton |
( |
Graphics & |
g, |
|
|
bool |
isMouseOverButton, |
|
|
bool |
isButtonDown |
|
) |
| [protected, virtual] |
Subclasses should override this to actually paint the button's contents.
It's better to use this than the paint method, because it gives you information about the over/down state of the button.
- Parameters:
-
| g | the graphics context to use |
| isMouseOverButton | true if the button is either in the 'over' or 'down' state |
| isButtonDown | true if the button should be drawn in the 'down' position |
Implements Button.
The documentation for this class was generated from the following file: