Documents > BPS V2 Script API

A wrapper for QPen. More...

Public Types

enum  PenCapStyle {
  FlatCap = 0,
  SquareCap = 0x10,
  RoundCap = 0x20
}
 Pen cap styles. More...
enum  PenJoinStyle {
  MiterJoin = 0,
  BevelJoin = 0x40,
  RoundJoin = 0x80,
  SvgMiterJoin = 0x100
}
 Pen join styles. More...
enum  PenStyle {
  NoPen = 0,
  SolidLine = 1,
  DashLine = 2,
  DotLine = 3,
  DashDotLine = 4,
  DashDotDotLine = 5
}
 Pen styles. More...

Public Member Functions

 Pen ()
 Default constructor.
String toString () const

Properties

Brush brush
 The pen brush.
PenCapStyle capStyle
 The pen cap style.
Color color
 The pen color.
Boolean cosmetic
 Pen is cosmetic.
PenJoinStyle joinStyle
 The pen join style.
Number miterLimit
 The miter limit.
PenStyle style
 The pen style.
Number width
 The pen width.

Detailed Description

A wrapper for QPen.

Example use within a report:

// change rectangle pen
var p = section.item('rect').pen; // copy current
p.color = new bps.Color(200,100,20);
p.style = bps.Pen.DashDotLine;
section.item('rect').pen = p; // set new pen

Member Enumeration Documentation

Pen cap styles.

Enumerator:
FlatCap 

A square line end that does not cover the end point of the line.

SquareCap 

A square line end that covers the end point and extends beyond it by half the line width.

RoundCap 

A rounded line end.

Pen join styles.

Enumerator:
MiterJoin 

The outer edges of the lines are extended to meet at an angle, and this area is filled.

BevelJoin 

The triangular notch between the two lines is filled.

RoundJoin 

A circular arc between the two lines is filled.

SvgMiterJoin 

A miter join corresponding to the definition of a miter join in the SVG 1.2 Tiny specification.

Pen styles.

Enumerator:
NoPen 

No line at all.

SolidLine 

A plain line.

DashLine 

Dashes separated by a few pixels.

DotLine 

Dots separated by a few pixels.

DashDotLine 

Alternate dots and dashes.

DashDotDotLine 

One dash, two dots, one dash, two dots.

Member Function Documentation

String bps::Pen::toString ( ) const
Returns
Returns "Pen"

Property Documentation

Brush bps::Pen::brush
readwrite

The pen brush.

 

PenCapStyle bps::Pen::capStyle
readwrite

The pen cap style.

 

Color bps::Pen::color
readwrite

The pen color.

 

Boolean bps::Pen::cosmetic
readwrite

Pen is cosmetic.

 

PenJoinStyle bps::Pen::joinStyle
readwrite

The pen join style.

 

Number bps::Pen::miterLimit
readwrite

The miter limit.

 

PenStyle bps::Pen::style
readwrite

The pen style.

 

Number bps::Pen::width
readwrite

The pen width.