Wt
4.11.0
|
A value class that defines the style for filling a path. More...
#include <Wt/WBrush.h>
Public Types | |
typedef BrushStyle | Style |
Typedef for enum Wt::BrushStyle. | |
Public Member Functions | |
WBrush () | |
Creates a brush. | |
WBrush (BrushStyle style) | |
Creates a brush with the given style. | |
WBrush (const WColor &color) | |
Creates a solid brush of a given color. | |
WBrush (StandardColor color) | |
Creates a solid brush with a standard color. | |
WBrush (const WGradient &gradient) | |
Creates a gradient brush. | |
~WBrush ()=default | |
Destructor. | |
WBrush (const WBrush &other) | |
Copy constructor. | |
bool | operator== (const WBrush &other) const |
Comparison operator. | |
bool | operator!= (const WBrush &other) const |
Comparison operator. | |
void | setStyle (BrushStyle style) |
Sets the brush style. | |
BrushStyle | style () const |
Returns the fill style. | |
void | setColor (const WColor &color) |
Sets the brush color. | |
const WColor & | color () const |
Returns the brush color. | |
void | setGradient (const WGradient &gradient) |
Sets the brush gradient. | |
const WGradient & | gradient () const |
Returns the brush gradient. | |
virtual std::string | jsValue () const override |
Returns a JavaScript representation of the value of this object. | |
Public Member Functions inherited from Wt::WJavaScriptExposableObject | |
bool | isJavaScriptBound () const |
Returns whether this object is JavaScript bound. | |
std::string | jsRef () const |
Returns a JavaScript reference to this object. | |
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.
A WBrush is JavaScript exposable. If a WBrush is JavaScript bound, it can be accessed in your custom JavaScript code through its handle's jsRef(). At the moment, only the color() property is exposed, e.g. a brush with the color WColor(10,20,30,255) will be represented in JavaScript as:
Wt::WBrush::WBrush | ( | ) |
Creates a brush.
Creates a brush with a BrushStyle::None fill style.
Creates a solid brush of a given color.
Creates a solid brush with the indicated color
.
Wt::WBrush::WBrush | ( | StandardColor | color | ) |
Creates a solid brush with a standard color.
Creates a solid brush with the indicated color
.
|
overridevirtual |
Returns a JavaScript representation of the value of this object.
Implements Wt::WJavaScriptExposableObject.
Comparison operator.
Returns true
if the brushes are different.
Comparison operator.
Returns true
if the brushes are exactly the same.
Sets the brush color.
If the current style is a gradient style, then it is reset to BrushStyle::Solid.
WException | if the brush is JavaScript bound |
Sets the brush gradient.
This also sets the style to BrushStyle::Gradient.
WException | if the brush is JavaScript bound |
void Wt::WBrush::setStyle | ( | BrushStyle | style | ) |
BrushStyle Wt::WBrush::style | ( | ) | const |
Returns the fill style.