Class TPGGlyphEngine (unit PGGlyph)

Inherits from

TComponent

Constructors


constructor Create(AOwner: TComponent);

Return the total size.


Functions

procedure ApplyStateEffect(const AState: TPGGlyphState; const Bmp: TBitmap);

Now refresh the drawings.

function CalculateDrawingSize(const AState: TPGGlyphState; var CaptionWidth,CaptionHeight,BmpWidth,BmpHeight: Integer): TPoint;

Returns the size of a drawing, which consists of a graphic and text

procedure CreateDrawing(const AState: TPGGlyphState);

Responsible for creating and initially painting a new drawing.

destructor Destroy;


procedure Draw(const Canvas: TCanvas; const AState: TPGGlyphState; const DestRect: TRect);

Draw the bitmap transparently, merging it with whatever was on the background.

procedure DrawDrawing(const Canvas: TCanvas; const AState: TPGGlyphState; const DestRect: TRect; const SourceRect: TRect);

Used to draw the glyph on a destination canvas.

function DrawingExists(AState: TPGGlyphState): Boolean;


function DrawingRect: TRect;


function DrawingSize: TPoint;


function GlyphExists(AState: TPGGlyphState): Boolean;

Returns information about the current glyph.

function GlyphRect(const AState: TPGGlyphState): TRect;

Refresh the drawing.

function GlyphSize: TPoint;


function PreferredRect: TRect;


function PreferredSize: TPoint;

Refresh the glyph width and height.

procedure Refresh;

Rebuilds all of the drawings.

procedure RefreshDrawing(const AState: TPGGlyphState);

Refresh all of the drawings that currently exist.

procedure RefreshDrawings;

Refreshes drawings that exist.

procedure RefreshGlyphDrawings;

Refreshes drawings that exist.

procedure RefreshGlyphSize;

Reset the number of glyphs that the bitmap has in it.

procedure RefreshNumGlyphs;

Assign the new Picture.

procedure SetFont(Value: TFont);


procedure SetPicture(Value: TBitmap);


Properties

property BevelWidth : Integer


property Button : Boolean


property ButtonStyle : TButtonStyle


property Caption : string


property Font : TFont


property Layout : TButtonLayout


property Margin : Integer


property NumGlyphs : Integer


property Picture : TBitmap


property Spacing : Integer


property State : TPGGlyphState


property Transparent : Boolean


property TransparentColor : TColor


Events

event OnRefreshDrawings : TNotifyEvent


Variables

FBevelWidth : Integer;


FButton : Boolean;


FButtonStyle : TButtonStyle;


FCaption : string;


FDrawingExists : array [TPGGlyphState] of Boolean;


FDrawings : array [TPGGlyphState] of TBitmap;


FFont : TFont;


FGlyphSize : TPoint;


FLayout : TButtonLayout;


FMargin : Integer;


FNumGlyphs : Integer;


FOnRefreshDrawings : TNotifyEvent;


FPicture : TBitmap;


FSpacing : Integer;


FState : TPGGlyphState;


FTransparent : Boolean;


FTransparentColor : TColor;



Constructors


constructor Create(AOwner: TComponent);

Return the total size.


Functions


procedure ApplyStateEffect(const AState: TPGGlyphState; const Bmp: TBitmap);

Now refresh the drawings. Note that since the Up drawing is } { always the first drawing to be created, then if it doesn't exist } { then none of the drawings exist.


function CalculateDrawingSize(const AState: TPGGlyphState; var CaptionWidth,CaptionHeight,BmpWidth,BmpHeight: Integer): TPoint;

Returns the size of a drawing, which consists of a graphic and text


procedure CreateDrawing(const AState: TPGGlyphState);

Responsible for creating and initially painting a new drawing.

Add the glyph to the drawing.


destructor Destroy;


procedure Draw(const Canvas: TCanvas; const AState: TPGGlyphState; const DestRect: TRect);

Draw the bitmap transparently, merging it with whatever was on the background.


procedure DrawDrawing(const Canvas: TCanvas; const AState: TPGGlyphState; const DestRect: TRect; const SourceRect: TRect);

Used to draw the glyph on a destination canvas.

This procedure is an internal routine used to draw an already existing drawing } { onto a destination canvas. It is used by the "Draw" method.


function DrawingExists(AState: TPGGlyphState): Boolean;


function DrawingRect: TRect;


function DrawingSize: TPoint;


function GlyphExists(AState: TPGGlyphState): Boolean;

Returns information about the current glyph.


function GlyphRect(const AState: TPGGlyphState): TRect;

Refresh the drawing.


function GlyphSize: TPoint;


function PreferredRect: TRect;


function PreferredSize: TPoint;

Refresh the glyph width and height.


procedure Refresh;

Rebuilds all of the drawings.


procedure RefreshDrawing(const AState: TPGGlyphState);

Refresh all of the drawings that currently exist.


procedure RefreshDrawings;

Refreshes drawings that exist.


procedure RefreshGlyphDrawings;

Refreshes drawings that exist.


procedure RefreshGlyphSize;

Reset the number of glyphs that the bitmap has in it.


procedure RefreshNumGlyphs;

Assign the new Picture.


procedure SetFont(Value: TFont);


procedure SetPicture(Value: TBitmap);


Properties


property BevelWidth : Integer


property Button : Boolean


property ButtonStyle : TButtonStyle


property Caption : string


property Font : TFont


property Layout : TButtonLayout


property Margin : Integer


property NumGlyphs : Integer


property Picture : TBitmap


property Spacing : Integer


property State : TPGGlyphState


property Transparent : Boolean


property TransparentColor : TColor


Events


event OnRefreshDrawings : TNotifyEvent


Variables


FBevelWidth : Integer;


FButton : Boolean;


FButtonStyle : TButtonStyle;


FCaption : string;


FDrawingExists : array [TPGGlyphState] of Boolean;


FDrawings : array [TPGGlyphState] of TBitmap;


FFont : TFont;


FGlyphSize : TPoint;


FLayout : TButtonLayout;


FMargin : Integer;


FNumGlyphs : Integer;


FOnRefreshDrawings : TNotifyEvent;


FPicture : TBitmap;


FSpacing : Integer;


FState : TPGGlyphState;


FTransparent : Boolean;


FTransparentColor : TColor;