TGraphicTool( unit KOL.pas ) TObj _TObj
TGraphicTool = object( TObj )
Incapsulates all GDI objects: Pen, Brush and Font.
type PGraphicTool = ^ TGraphicTool;
type TBrushStyle =( bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross );
Available brush styles.
type TPenStyle =( psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame );
Available pen styles. For more info see Delphi or Win32 help files.
type TPenMode =( pmBlack, pmNotMerge, pmMaskNotPen, pmNotCopy, pmMaskPenNot, pmNot, pmXor, pmNotMask, pmMask, pmNotXor, pmNop, pmMergePenNot, pmCopy, pmMergeNotPen, pmMerge, pmWhite );
Available pen modes. For more info see Delphi or Win32 help files.
type TPenEndCap =( pecRound, pecSquare, pecFlat );
Avalable (for geometric pen) end cap styles.
type TPenJoin =( pjRound, pjBevel, pjMiter );
Available (for geometric pen) join styles.
type TFontStyles =( fsBold, fsItalic, fsUnderline, fsStrikeOut );
Available font styles.
type TFontStyle = set of TFontStyles;
Font style is representing as a set of XFontStyles.
type TFontPitch =( fpDefault, fpFixed, fpVariable );
Availabe font pitch values.
Font name is represented as a string.
type TFontCharset = 0 . . 255;
Font charset is represented by number from 0 to 255.
type TFontQuality =( fqDefault, fqDraft, fqProof, fqNonAntialiased, fqAntialiased, fqClearType );
Font quality.
TGraphicTool properties
property Handle: THandle;
Every time, when accessed, real GDI object is created (if it is not yet created). So, to prevent creating of the handle, use HandleAllocated instead of comparing Handle with value 0.
property Color: TColor;
Color is the most common property for all Pen, Brush and Font objects, so it is placed in its common for all of them.
property BrushBitmap: HBitmap;
Brush bitmap. For more info about using brush bitmap, see Delphi or Win32 help files.
property BrushStyle: TBrushStyle;
Brush style.
property BrushLineColor: TColor;
Brush line color, used to represent lines in hatched brush. Default value is clBlack.
property FontHeight: Integer;
Font height. Value 0 (default) says to use system default value, negative values are to represent font height in "points", positive - in pixels. In XCL usually positive values (if not 0) are used to make appearance independent from different local settings.
property FontWidth: Integer;
Font width in logical units. If FontWidth = 0, then as it is said in Win32.hlp, "the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference."
property FontPitch: TFontPitch;
Font pitch. Change it very rare.
property FontStyle: TFontStyle;
Very useful property to control appearance.
property FontCharset: TFontCharset;
Do not change it if You do not know what You do.
property FontQuality: TFontQuality;
Font quality.
property FontOrientation: Integer;
It is possible to rotate text in KOL just by changing this property of a font (tenths of degree, i.e. value 900 represents 90 degree - text written from bottom to top).
property FontWeight: Integer;
Additional font weight for bold fonts (must be 0..1000). When set to value <> 0, fsBold is added to FontStyle. And otherwise, when set to 0, fsBold is removed from FontStyle. Value 700 corresponds to Bold, 400 to Normal.
property FontName: KOLString;
Font face name.
property PenWidth: Integer;
Value 0 means default pen width.
property PenStyle: TPenStyle;
Pen style.
property PenMode: TPenMode;
Pen mode.
property GeometricPen: Boolean;
True if Pen is geometric. Note, that under Win95/98 only pen styles psSolid, psNull, psInsideFrame are supported by OS.
property PenBrushStyle: TBrushStyle;
Brush style for hatched geometric pen.
property PenBrushBitmap: HBitmap;
Brush bitmap for geometric pen (if assigned Pen is functioning as its style = BS_PATTERN, regadless of PenBrushStyle value).
property PenEndCap: TPenEndCap;
Pen end cap mode - for GeometricPen only.
property PenJoin: TPenJoin;
Pen join mode - for GeometricPen only.
property LogFontStruct: TLogFont;
by Alex Pravdin: a property to change all font structure items at once.
TGraphicTool methods
function HandleAllocated: Boolean;
Returns True, if handle is allocated (i.e., if real GDI objet is created.
function ReleaseHandle: Integer;
Returns Handle value (if allocated), releasing it from the object (so, it is no more knows about this handle and its HandleAllocated function returns False.
function Assign( Value: PGraphicTool ): PGraphicTool;
Assigns properties of the same (only) type graphic object, excluding Handle. If assigning is really leading to change object, procedure Changed is called.
procedure AssignHandle( NewHandle: Integer );
Assigns value to Handle property.
function IsFontTrueType: Boolean;
Returns True, if font is True Type. Requires of creating of a Handle, if it is not yet created.
TGraphicTool events
property OnChange: TOnGraphicChange;
Called, when object is changed.