wPen

A pen is a drawing tool for drawing outlines.

Superclass:wGdiObject
Seealso:wDC
Consts:
Pen StylesDescription
wPenJoinBevelJoins are beveled.
wPenJoinMiterJoins are mitered.
wPenJoinRoundJoins are round.
wPenJoinMaskJoins mask.
wPenCapRoundEnd caps are round.
wPenCapProjectingEnd caps are square.
wPenCapButtEnd caps are flat.
wPenCapMaskEnd caps mask.
wPenStyleSolidSolid style.
wPenStyleDotDotted style.
wPenStyleDashDashed style.
wPenStyleDotDashDot and dash style.
wPenStyleInsideFrameDrawing inside frame.
wPenStyleTransparentNo pen is used.
wPenStyleMaskPen style mask.
wPenStyleBdiagonalHatchBackward diagonal hatch.
wPenStyleCrossdiagHatchCross-diagonal hatch.
wPenStyleFdiagonalHatchForward diagonal hatch.
wPenStyleCrossHatchCross hatch.
wPenStyleHorizontalHatchHorizontal hatch.
wPenStyleVerticalHatchVertical hatch.
wPenStyleMaskHatchHatch style mask.

Types

wPenError = object of wGdiObjectError
  
An error raised when wPen creation failed.

Procs

proc init(self: wPen; elp: EXTLOGPEN) {...}{.raises: [wPenError], tags: [].}
Initializes a pen from EXTLOGPEN struct. Used internally.
proc Pen(elp: EXTLOGPEN): wPen {...}{.inline, discardable, raises: [wPenError], tags: [].}
Constructor.
proc init(self: wPen; color = wBlack; style = 0; width = 1) {...}{.raises: [wPenError], tags: [].}
Initializes a pen from color, width, and style.
proc Pen(color = wBlack; style = 0; width = 1): wPen {...}{.inline, discardable,
    raises: [wPenError], tags: [].}
Constructor.
proc init(self: wPen; hPen: HANDLE; copy = true; shared = false) {...}{.raises: [wPenError],
    tags: [].}
Initializes a pen from system pen handle. If copy is false, the function only wrap the handle to wPen object. If shared is false, the handle will be destroyed together with wPen object by the GC. Otherwise, the caller is responsible for destroying it.
proc Pen(hPen: HANDLE; copy = true; shared = false): wPen {...}{.inline, discardable,
    raises: [wPenError], tags: [].}
Constructor.
proc init(self: wPen; pen: wPen) {...}{.raises: [wNilAccess, wPenError], tags: [].}
Initializes a pen from a wPen object, aka. copy.
proc Pen(pen: wPen): wPen {...}{.inline, discardable, raises: [wNilAccess, wPenError],
                        tags: [].}
Constructor.
proc getColor(self: wPen): wColor {...}{.inline, raises: [], tags: [].}
Returns a reference to the pen color.
proc getStyle(self: wPen): DWORD {...}{.inline, raises: [], tags: [].}
Returns the pen style.
proc getWidth(self: wPen): int {...}{.inline, raises: [], tags: [].}
Returns the pen width.
proc setColor(self: wPen; color: wColor) {...}{.raises: [wPenError], tags: [].}
Set the pen color.
proc setStyle(self: wPen; style: DWORD) {...}{.raises: [wPenError], tags: [].}
Set the pen style.
proc setWidth(self: wPen; width: int) {...}{.raises: [wPenError], tags: [].}
Sets the pen width.

Templates

template wBlackPen(): untyped
Predefined black pen. Don't delete.
template wWhitePen(): untyped
Predefined white pen. Don't delete.
template wTransparentPen(): untyped
Predefined transparent pen. Don't delete.
template wRedPen(): untyped
Predefined red pen. Don't delete.
template wCyanPen(): untyped
Predefined cyan pen. Don't delete.
template wGreenPen(): untyped
Predefined green pen. Don't delete.
template wGreyPen(): untyped
Predefined grey pen. Don't delete.
template wMediumGreyPen(): untyped
Predefined medium grey pen. Don't delete.
template wLightGreyPen(): untyped
Predefined light grey pen. Don't delete.
template wBlackDashedPen(): untyped
Predefined black dashed pen. Don't delete.
template wDefaultPen(): untyped
Predefined default (black) pen. Don't delete.