Wt
3.3.8
|
A value class that defines the style for pen strokes. More...
#include <Wt/WPen>
Public Member Functions | |
WPen () | |
Creates a black cosmetic pen. More... | |
WPen (PenStyle style) | |
Creates a black pen with a particular style. More... | |
WPen (const WColor &color) | |
Creates a solid pen of a particular color. More... | |
WPen (GlobalColor color) | |
Creates a solid pen of a standard color. More... | |
WPen (const WGradient &gradient) | |
Creates a solid pen with a gradient color. More... | |
bool | operator== (const WPen &other) const |
Comparison operator. More... | |
bool | operator!= (const WPen &other) const |
Comparison operator. More... | |
void | setStyle (PenStyle style) |
Sets the pen style. More... | |
PenStyle | style () const |
Returns the pen style. More... | |
void | setCapStyle (PenCapStyle style) |
Sets the style for rendering line ends. More... | |
PenCapStyle | capStyle () const |
Returns the style for rendering line ends. More... | |
void | setJoinStyle (PenJoinStyle style) |
Sets the style for rendering line joins. More... | |
PenJoinStyle | joinStyle () const |
Returns the style for rendering line joins. More... | |
void | setWidth (const WLength &width) |
Sets the pen width. More... | |
const WLength & | width () const |
Returns the pen width. More... | |
void | setColor (const WColor &color) |
Sets the pen color. More... | |
const WColor & | color () const |
Returns the pen color. More... | |
void | setGradient (const WGradient &gradient) |
Sets the pen color as a gradient. More... | |
const WGradient & | gradient () const |
Returns the pen color gradient. More... | |
virtual std::string | jsValue () const WT_CXX11ONLY(override) |
Returns a JavaScript representation of the value of this object. More... | |
Public Member Functions inherited from Wt::WJavaScriptExposableObject | |
bool | isJavaScriptBound () const |
Returns whether this object is JavaScript bound. More... | |
std::string | jsRef () const |
Returns a JavaScript reference to this object. More... | |
Related Functions | |
(Note that these are not member functions.) |
A value class that defines the style for pen strokes.
A pen defines the properties of how lines (that may surround shapes) are rendered.
A pen with width 0 is a cosmetic pen, and is always rendered as 1 pixel width, regardless of transformations. Otherwized, the pen width is modified by the transformation set on the painter.
A WPen is JavaScript exposable. If a WPen 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 pen with the color WColor(10,20,30,255) will be represented in JavaScript as:
Wt::WPen::WPen | ( | ) |
Wt::WPen::WPen | ( | PenStyle | style | ) |
Wt::WPen::WPen | ( | const WColor & | color | ) |
Wt::WPen::WPen | ( | GlobalColor | color | ) |
Wt::WPen::WPen | ( | const WGradient & | gradient | ) |
PenCapStyle Wt::WPen::capStyle | ( | ) | const |
Returns the style for rendering line ends.
const WColor& Wt::WPen::color | ( | ) | const |
Returns the pen color.
const WGradient& Wt::WPen::gradient | ( | ) | const |
Returns the pen color gradient.
PenJoinStyle Wt::WPen::joinStyle | ( | ) | const |
Returns the style for rendering line joins.
|
overridevirtual |
Returns a JavaScript representation of the value of this object.
Implements Wt::WJavaScriptExposableObject.
bool Wt::WPen::operator!= | ( | const WPen & | other | ) | const |
Comparison operator.
Returns true
if the pens are different.
bool Wt::WPen::operator== | ( | const WPen & | other | ) | const |
Comparison operator.
Returns true
if the pens are exactly the same.
void Wt::WPen::setCapStyle | ( | PenCapStyle | style | ) |
Sets the style for rendering line ends.
The cap style configures how line ends are rendered.
WException | if the pen is JavaScript bound |
void Wt::WPen::setColor | ( | const WColor & | color | ) |
void Wt::WPen::setGradient | ( | const WGradient & | gradient | ) |
Sets the pen color as a gradient.
WException | if the pen is JavaScript bound |
void Wt::WPen::setJoinStyle | ( | PenJoinStyle | style | ) |
Sets the style for rendering line joins.
The join style configures how corners are rendered between different segments of a poly-line, rectange or painter path.
WException | if the pen is JavaScript bound |
void Wt::WPen::setStyle | ( | PenStyle | style | ) |
Sets the pen style.
The pen style determines the pattern with which the pen is rendered.
WException | if the pen is JavaScript bound |
void Wt::WPen::setWidth | ( | const WLength & | width | ) |
Sets the pen width.
A pen width must
be specified using WLength::Pixel units.
WException | if the pen is JavaScript bound |
PenStyle Wt::WPen::style | ( | ) | const |
Returns the pen style.
const WLength& Wt::WPen::width | ( | ) | const |
Returns the pen width.