Wt  3.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Related Functions | List of all members
Wt::WPen Class Reference

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 particular standard 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 WLengthwidth () const
 Returns the pen width. More...
 
void setColor (const WColor &color)
 Sets the pen color. More...
 
const WColorcolor () const
 Returns the pen color. More...
 

Related Functions

(Note that these are not member functions.)

enum  PenStyle {
  NoPen, SolidLine, DashLine, DotLine,
  DashDotLine, DashDotDotLine
}
 Enumeration that indicates a pen style. More...
 
enum  PenCapStyle { FlatCap, SquareCap, RoundCap }
 Enumeration that indicates how line end points are rendered. More...
 
enum  PenJoinStyle { MiterJoin, BevelJoin, RoundJoin }
 Enumeration that indicates how line joins are rendered. More...
 

Detailed Description

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.

See Also
WPainter::setPen(), WBrush

Constructor & Destructor Documentation

Wt::WPen::WPen ( )

Creates a black cosmetic pen.

Constructs a black solid pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

Wt::WPen::WPen ( PenStyle  style)

Creates a black pen with a particular style.

Constructs a black pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

The line style is set to style.

Wt::WPen::WPen ( const WColor color)

Creates a solid pen of a particular color.

Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

The pen color is set to color.

Wt::WPen::WPen ( GlobalColor  color)

Creates a solid pen of a particular standard color.

Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with SquareCap line ends and BevelJoin line join style.

The pen color is set to color.

Member Function Documentation

PenCapStyle Wt::WPen::capStyle ( ) const

Returns the style for rendering line ends.

See Also
setCapStyle(PenCapStyle)
const WColor& Wt::WPen::color ( ) const

Returns the pen color.

See Also
color()
PenJoinStyle Wt::WPen::joinStyle ( ) const

Returns the style for rendering line joins.

See Also
setJoinStyle(PenJoinStyle)
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.

See Also
capStyle()
void Wt::WPen::setColor ( const WColor color)

Sets the pen color.

See Also
color()
void Wt::WPen::setJoinStyle ( PenJoinStyle  style)

Sets the style for rendering line joins.

See Also
joinStyle()
void Wt::WPen::setStyle ( PenStyle  style)

Sets the pen style.

See Also
style()
void Wt::WPen::setWidth ( const WLength width)

Sets the pen width.

A pen width must be specified using WLength::Pixel units.

See Also
width()
PenStyle Wt::WPen::style ( ) const

Returns the pen style.

See Also
setStyle(PenStyle)
const WLength& Wt::WPen::width ( ) const

Returns the pen width.

See Also
setWidth(const WLength&)

Generated on Wed Oct 23 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.4