A value class that defines the style for filling a path. More...
#include <Wt/WBrush>
Public Member Functions | |
WBrush () | |
Creates a brush. More... | |
WBrush (BrushStyle style) | |
Creates a brush with the given style. | |
WBrush (const WColor &color) | |
Creates a solid brush of a given color. More... | |
WBrush (GlobalColor color) | |
Creates a solid brush with a standard color. More... | |
WBrush (const WGradient &gradient) | |
Creates a gradient brush. | |
bool | operator== (const WBrush &other) const |
Comparison operator. More... | |
bool | operator!= (const WBrush &other) const |
Comparison operator. More... | |
void | setStyle (BrushStyle style) |
Sets the brush style. More... | |
BrushStyle | style () const |
Returns the fill style. More... | |
void | setColor (const WColor &color) |
Sets the brush color. More... | |
const WColor & | color () const |
Returns the brush color. More... | |
void | setGradient (const WGradient &gradient) |
Sets the brush gradient. More... | |
const WGradient & | gradient () const |
Returns the brush gradient. | |
Related Functions | |
(Note that these are not member functions.) | |
enum | BrushStyle { NoBrush, SolidPattern, GradientPattern } |
Enumeration that indicates a fill style. More... | |
A value class that defines the style for filling a path.
A brush defines the properties of how areas (the interior of shapes) are filled. A brush is defined either as a solid color or a gradient.
Wt::WBrush::WBrush | ( | ) |
Creates a brush.
Creates a brush with a NoBrush fill style.
Wt::WBrush::WBrush | ( | const WColor & | color | ) |
Creates a solid brush of a given color.
Creates a solid brush with the indicated color
.
Wt::WBrush::WBrush | ( | GlobalColor | color | ) |
Creates a solid brush with a standard color.
Creates a solid brush with the indicated color
.
bool Wt::WBrush::operator!= | ( | const WBrush & | other | ) | const |
Comparison operator.
Returns true
if the brushes are different.
bool Wt::WBrush::operator== | ( | const WBrush & | other | ) | const |
Comparison operator.
Returns true
if the brushes are exactly the same.
void Wt::WBrush::setColor | ( | const WColor & | color | ) |
Sets the brush color.
If the current style is a gradient style, then it is reset to SolidPattern.
void Wt::WBrush::setGradient | ( | const WGradient & | gradient | ) |
Sets the brush gradient.
This also sets the style to GradientPattern.
void Wt::WBrush::setStyle | ( | BrushStyle | style | ) |
Sets the brush style.
BrushStyle Wt::WBrush::style | ( | ) | const |
Returns the fill style.