Win32Forth


GdiPen -- Class for GDI Pens


Version 1.0

This GDI class library was written and placed in the Public Domain in 2005 by Dirk Busch

gdiPen class

:class gdiPen <super gdiObject

Class for cosmetic pen's

:M ClassInit:   ( -- )

Init the class

:M SetStyle:    ( style -- )

Set Syle of the pen. Possible values are:

PS_SOLID The pen is solid.
PS_DASH The pen is dashed. This style is valid only when the pen width is one or less in device units.
PS_DOT The pen is dotted. This style is valid only when the pen width is one or less in device units.
PS_DASHDOT The pen has alternating dashes and dots. This style is valid only when the pen width is one or less in device units.
PS_DASHDOTDOT The pen has alternating dashes and double dots. This style is valid only when the pen width is one or less in device units.
PS_NULL The pen is invisible.
PS_INSIDEFRAME The pen is solid. When this pen is used the dimensions of the figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. Only for geometric pens.
:M SetWidth:    ( width -- )

Set the width of the pen in logical units. If Width is zero, the pen is a single pixel wide, regardless of the current transformation.

:M SetRValue:   ( r -- )

Set the red component of the pen color.

:M SetGValue:   ( g -- )

Set the green component of the pen color.

:M SetBValue:   ( b -- )

Set the blue component of the pen color.

:M SetRGB:      ( r g b -- )

Set the red, green and blue component of the pen color.

:M SetColor:    ( colorref -- )

Set color of the pen.

:M SetSysColor: ( n -- )

Set the color of the pen to a system color.

:M ChooseColor: ( hWnd -- f )

Open a dialog to choose the color of the pen.

:M GetStyle:    ( -- style )

Get Syle of the pen. Possible values are:

PS_SOLID The pen is solid.
PS_DASH The pen is dashed. This style is valid only when the pen width is one or less in device units.
PS_DOT The pen is dotted. This style is valid only when the pen width is one or less in device units.
PS_DASHDOT The pen has alternating dashes and dots. This style is valid only when the pen width is one or less in device units.
PS_DASHDOTDOT The pen has alternating dashes and double dots. This style is valid only when the pen width is one or less in device units.
PS_NULL The pen is invisible.
PS_INSIDEFRAME The pen is solid. When this pen is used the dimensions of the figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies only to geometric pens.
:M GetWidth:    ( -- width )

Get the width of the pen in logical units. If the width is zero, the pen is a single pixel wide, regardless of the current transformation.

:M GetRValue:   ( -- r )

Get the red component of the pen color.

:M GetGValue:   ( -- g )

Get the green component of the pen color.

:M GetBValue:   ( -- b )

Get the blue component of the pen color.

:M GetColor:    ( -- colorref )

Get the color of the pen as a windows COLORREF value.

:M Create:      ( -- f )

Create the pen with the current style, color and width.

:M CreateIndirect: ( pLogpen -- f )

The CreateIndirect function creates a logical cosmetic pen that has the style, width, and color specified in a structure.

;class

End of class

gdiGeometricPen class

:class gdiGeometricPen <super gdiObject

Class for geometric pen's   
Note: this class isn't implemented yet

:M ClassInit:   ( -- )

Init the class

;class

End of class


Document $Id: gdiPen.htm,v 1.14 2007/05/26 10:24:13 dbu_de Exp $