wBrush

A brush is a drawing tool for filling in areas.

Superclass:wGdiObject
Seealso:wDC
Consts:
Font FamilyDescription
wBrushStyleSolidSolid.
wBrushStyleTransparentTransparent (no fill).
wBrushStyleMaskBrush style mask.
wBrushStyleBdiagonalHatchBackward diagonal hatch.
wBrushStyleCrossdiagHatchCross-diagonal hatch.
wBrushStyleFdiagonalHatchForward diagonal hatch.
wBrushStyleCrossHatchCross hatch.
wBrushStyleHorizontalHatchHorizontal hatch.
wBrushStyleVerticalHatchVertical hatch.
wBrushStyleMaskHatchBrush hatch style mask.

Types

wBrushError = object of wGdiObjectError
  
An error raised when wBrush creation failed.

Procs

proc init(self: wBrush; lb: var LOGBRUSH) {...}{.raises: [wBrushError], tags: [].}
Initializes a brush from LOGBRUSH struct. Used internally.
proc Brush(lb: var LOGBRUSH): wBrush {...}{.inline, discardable, raises: [wBrushError],
                                  tags: [].}
Constructor.
proc init(self: wBrush; color: wColor = wWHITE; style = wBrushStyleSolid) {...}{.
    raises: [wBrushError], tags: [].}
Initializes a brush from a color and style.
proc Brush(color: wColor = wWHITE; style = wBrushStyleSolid): wBrush {...}{.inline,
    discardable, raises: [wBrushError], tags: [].}
Constructor.
proc init(self: wBrush; hBrush: HANDLE; copy = true; shared = false) {...}{.
    raises: [wBrushError], tags: [].}
Initializes a brush from system brush handle. If copy is false, the function only wrap the handle to wBrush object. If shared is false, the handle will be destroyed together with wBrush object by the GC. Otherwise, the caller is responsible for destroying it.
proc Brush(hBrush: HANDLE; copy = true; shared = false): wBrush {...}{.inline, discardable,
    raises: [wBrushError], tags: [].}
Constructor.
proc init(self: wBrush; brush: wBrush) {...}{.raises: [wBrushError], tags: [].}
Initializes a brush from a wBrush object, aka. copy.
proc Brush(brush: wBrush): wBrush {...}{.inline, discardable, raises: [wBrushError], tags: [].}
Constructor.
proc getColor(self: wBrush): wColor {...}{.inline, raises: [], tags: [].}
Returns a reference to the brush color.
proc getStyle(self: wBrush): DWORD {...}{.inline, raises: [], tags: [].}
Returns the brush style.
proc setColor(self: wBrush; color: wColor) {...}{.raises: [wBrushError], tags: [].}
Sets the brush color.
proc setStyle(self: wBrush; style: DWORD) {...}{.raises: [wBrushError], tags: [].}
Sets the brush style.

Templates

template wBlackBrush(): untyped
Predefined black brush. Don't delete.
template wWhiteBrush(): untyped
Predefined white brush. Don't delete.
template wGreyBrush(): untyped
Predefined grey brush. Don't delete.
template wTransparentBrush(): untyped
Predefined transparent brush. Don't delete.
template wLightGreyBrush(): untyped
Predefined light grey brush. Don't delete.
template wMediumGreyBrush(): untyped
Predefined medium grey brush. Don't delete.
template wBlueBrush(): untyped
Predefined blue brush. Don't delete.
template wGreenBrush(): untyped
Predefined green brush. Don't delete.
template wCyanBrush(): untyped
Predefined cyan brush. Don't delete.
template wRedBrush(): untyped
Predefined red brush. Don't delete.
template wDefaultBrush(): untyped
Predefined default (white) brush. Don't delete.