Wt::WPen Class Reference
[Painting system]

Class that defines the style for pen strokes. More...

#include <Wt/WPen>

List of all members.

Public Member Functions

 WPen ()
 Default constructor.
 WPen (PenStyle style)
 Construct a black pen with a particular style.
 WPen (const WColor &color)
 Construct a solid pen of a particular color.
 WPen (GlobalColor color)
 Construct a solid pen of a particular standard color.
bool operator== (const WPen &other) const
 Comparison operator.
bool operator!= (const WPen &other) const
 Comparison operator.
void setStyle (PenStyle style)
 Change the pen style.
PenStyle style () const
 Return the pen style.
void setCapStyle (PenCapStyle style)
 Change the style for rendering line ends.
PenCapStyle capStyle () const
 Returns the style for rendering line ends.
void setJoinStyle (PenJoinStyle style)
 Change the style for rendering line joins.
PenJoinStyle joinStyle () const
 Returns the style for rendering line joins.
void setWidth (const WLength &width)
 Change the pen width.
const WLengthwidth () const
 Returns the pen width.
void setColor (const WColor &color)
 Change the pen color.
const WColorcolor () const
 Returns the pen color.

Related Functions

(Note that these are not member functions.)

enum  PenStyle {
  NoPen = 0x0, SolidLine = 0x1, DashLine = 0x2, DotLine = 0x3,
  DashDotLine = 0x4, DashDotDotLine = 0x5
}
 Enumeration that indicates a pen style. More...
enum  PenCapStyle { FlatCap = 0x00, SquareCap = 0x10, RoundCap = 0x20 }
 Enumeration that indicates how line end points are rendered. More...
enum  PenJoinStyle { MiterJoin = 0x00, BevelJoin = 0x40, RoundJoin = 0x80 }
 Enumeration that indicates how line joins are rendered. More...


Detailed Description

Class that defines the style for pen strokes.

A pen defines the properties of how lines (that may surround shapes) are rendered.

A pen of width 0 is a cosmetic pen, and is always rendered as 1 pixel width.

See also:
WPainter::setPen(), WBrush

Constructor & Destructor Documentation

Wt::WPen::WPen (  ) 

Default constructor.

Constructs a black solid pen of 0 width, with SquareCap line ends and BevelJoin line join style.

Wt::WPen::WPen ( PenStyle  style  ) 

Construct a black pen with a particular style.

Constructs a black pen of 0 width, with SquareCap line ends and BevelJoin line join style.

The line style is set to style.

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

Construct a solid pen of a particular color.

Constructs a solid pen of 0 width, with SquareCap line ends and BevelJoin line join style.

The pen color is set to color.

Wt::WPen::WPen ( GlobalColor  color  ) 

Construct a solid pen of a particular standard color.

Constructs a solid pen of 0 width, with SquareCap line ends and BevelJoin line join style.

The pen color is set to color.


Member Function Documentation

bool Wt::WPen::operator== ( const WPen other  )  const

Comparison operator.

Returns true if the pens are exactly the same.

bool Wt::WPen::operator!= ( const WPen other  )  const

Comparison operator.

Returns true if the pens are different.

void Wt::WPen::setStyle ( PenStyle  style  ) 

Change the pen style.

See also:
style()

PenStyle Wt::WPen::style (  )  const [inline]

Return the pen style.

See also:
setStyle(PenStyle)

void Wt::WPen::setCapStyle ( PenCapStyle  style  ) 

Change the style for rendering line ends.

See also:
capStyle()

PenCapStyle Wt::WPen::capStyle (  )  const [inline]

Returns the style for rendering line ends.

See also:
setCapStyle(PenCapStyle)

void Wt::WPen::setJoinStyle ( PenJoinStyle  style  ) 

Change the style for rendering line joins.

See also:
joinStyle()

PenJoinStyle Wt::WPen::joinStyle (  )  const [inline]

Returns the style for rendering line joins.

See also:
setJoinStyle(PenJoinStyle)

void Wt::WPen::setWidth ( const WLength width  ) 

Change the pen width.

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

See also:
width()

const WLength& Wt::WPen::width (  )  const [inline]

Returns the pen width.

See also:
setWidth(const WLength&)

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

Change the pen color.

See also:
color()

const WColor& Wt::WPen::color (  )  const [inline]

Returns the pen color.

See also:
color()


Generated on Fri Jul 25 17:56:38 2008 for Wt by doxygen 1.5.3