Server Framework - Class Methods

THTMLCanvas.OpenDocument

Creates a device context for a new Html document.

Use OpenDocument() to create a new Html document device context.

Defined in: SystemControls

Procedure OpenDocument;

TPDFCanvas.OpenDocument

Creates a device context for a new PDF document.

Use OpenDocument() to create a new PDF document device context.

PARAMETERS:- PageSize determines the paper size (e.g. A4, Letter, Folio, etc.)Typical values:psA2, psA3, psA4, psA5, psLetter, psLedger, psFolio, psExecutive, psLegal- Orientation determines if the page should be portrait or landscapePossible values:poPortrait, poLandscape- PageWidth is the actual width of the page- PageHeight is the actual height of the page

Defined in: SystemControls

Procedure OpenDocument(aPageSize : TReportPageType;
                       aOrientation : TReportPageOrientation;
                       aPageWidth : Integer;
                       aPageHeight : Integer);

TWebCanvas.ClearClipRectStack

Clears all ClipRects.

Use ClearClipRectStack() to remove (pop) all pushed ClipRects fromthe ClipRect stack.

Defined in: SystemControls

Procedure ClearClipRectStack;

TWebCanvas.Create

Creates an instance of the class.

Use the constructor Create() to construct and initialize aninstance of the class.

Defined in: SystemControls

Constructor Create(aHTTPServer : THttpServer; aTopDocument : TWebDocument): TWebCanvas;

TWebCanvas.CurrentClipRect

Returns the current ClipRect.

Use CurrentClipRect() to get access to the ClipRect currently atthe top of the ClipRect stack.

Defined in: SystemControls

Function CurrentClipRect: TRect;

TWebCanvas.Destroy

Disposes of an instance of the classThe destructor Destroy() should NOT be called directly. It is calledindirectly when an object is freed.

To free an object instance call the Free() method.

Defined in: SystemControls

Destructor Destroy;

TWebCanvas.DrawText

Renders a string to the canvas in the specified rectangle.

Use DrawText() to write a string within a defined clipping region.

PARAMETERS:- X1, Y1 are the Left and Top coordinates of the bounding rectangle- X2, Y2 are the Right and Bottom coordinates determining the extent of the bounding rectangle- Alignment determines the horizontal alignment behavior for therendered text within the specified clipping region.

Possible values: taLeftJustify, taCenter, taRightJustify- VertAlignment determines the vertical alignment behavior for therendered text within the specified clipping region.

Possible values: vaTopJustify, vaBottomJustify, vaCenterJustify- Text is the string to be rendered to the canvas.

Defined in: SystemControls

Procedure DrawText(X1 : Integer;
                   Y1 : Integer;
                   X2 : Integer;
                   Y2 : Integer;
                   aAlignment : TAlignment;
                   aVertAlignment : TVertAlignment;
                   Text : String);

TWebCanvas.FillRect

Fills the specified rectangle by rendering the background with theselected brush.

Use FillRect() to render the background of a region bound by the specifiedrectangle coordinates.

PARAMETERS:- X1, Y1 are the Left and Top coordinates of the bounding rectangle- X2, Y2 are the Right and Bottom coordinates determining the extent of the bounding rectangleNOTE:Use SelectBrush() to specify what the fill color should be.

Defined in: SystemControls

Procedure FillRect(X1 : Integer; Y1 : Integer; X2 : Integer; Y2 : Integer);

TWebCanvas.Frame3D

Renders a 3D Frame to the canvas.

Use 3DFrame() to draw a 3D rectangle of the with the specified colorsand using the selected brush as the background color. The position,height and width are determined by the specified coordinates.

PARAMETERS:- L, T are the Left and Top coordinates of the bounding rectangle- R, B are the Right and Bottom coordinates determining the extent of the bounding rectangle- TopColor and BottomColor are the colors used to create the 3D effect.

- BWidth determines the border width.

NOTE:Use SelectBrush() to specify what the fill color should be.

Defined in: SystemControls

Procedure Frame3D(L : Integer;
                  T : Integer;
                  R : Integer;
                  B : Integer;
                  TopColor : TCOlor;
                  BottomColor : TCOlor;
                  BWidth : Integer);

TWebCanvas.GetBlockTextHeight

Returns the height of a string for the current font settings.

Use GetBlockTextHeight() to request the value of the text heightbased on the current font settings.

PARAMETERS:- Width, BorderStyle and BorderWidth affect the calculation of thetext height and are therefore required,- Value is the text string used to calculate the text height

Defined in: SystemControls

Function GetBlockTextHeight(Width : Integer;
                            BorderStyle : TBorderStyle;
                            BorderSides : THTMLBorderSides;
                            BorderWidth : Integer;
                            Value : String): Integer;

TWebCanvas.HorizontalLine

Draws a horizontal line of a defined width, starting at the specifiedcoordinates.

Use HorizontalLine() to draw a horizontal line from the positionspecified by the X and Y coordinates. The W parameter determines thelength of the horizontal line.

PARAMETERS:- X1, Y1 are the coordinates of the line's starting point- W is the width of the horizontal line being drawn.

NOTE:Use SelectPen() to select the line color and style

Defined in: SystemControls

Procedure HorizontalLine(X1 : Integer; Y1 : Integer; W : Integer);

TWebCanvas.LineTo

Draws a line from the current pen position to the specified coordinates.

Use LineTo() to draw a line from the current drawing position to the pointspecified by the X and Y coordinates.

PARAMETERS:- X1, Y1 are the target coordinates of the line's ending pointNOTE:Use SelectPen() to select the line color and styleThis method is used often in conjunction with MoveTo()

Defined in: SystemControls

Procedure LineTo(X1 : Integer; Y1 : Integer);

TWebCanvas.MoveTo

Changes the current pen position to the coordinates specified.

Use MoveTo() to set the pen position to the point specified by theX and Y coordinates.

PARAMETERS:- X1, Y1 are the target coordinates of the new positionNOTE:This method is used often in conjunction with LineTo()

Defined in: SystemControls

Procedure MoveTo(X1 : Integer; Y1 : Integer);

TWebCanvas.Point

Renders a point the size of a pixel to the canvas at the specified coordinates.

Use Point() to paint a single pixel to the point specified by theX and Y coordinates.

PARAMETERS:- X1, Y1 are the target coordinates of the point to be rendered.

Defined in: SystemControls

Procedure Point(X1 : Integer; Y1 : Integer);

TWebCanvas.PopClipRect

Disposes of the current ClipRect.

Use PopClipRect() to remove the current ClipRect from the ClipRectstack making the next ClipRect item on the stack the top.

Defined in: SystemControls

Procedure PopClipRect;

TWebCanvas.PushClipRect

Makes the ClipRect passed in TRect record the current ClipRect.

Use PushClipRect() to add a passed in TRect record to the top of theClipRect stack, making that the current ClipRect.

Defined in: SystemControls

Procedure PushClipRect(R : TRect);

TWebCanvas.Rectangle

Renders a rectangle to the canvas.

Use Rectangle() to draw a rectangle of the selected pen color and usingthe selected brush as the background color. The position,height and width are determined by the specified coordinates.

PARAMETERS:- X1, Y1 are the Left and Top coordinates of the bounding rectangle- X2, Y2 are the Right and Bottom coordinates determining the extent of the bounding rectangleNOTE:Use SelectPen() to select the rectangle color and SelectBrush() tospecify what the fill color should be.

Defined in: SystemControls

Procedure Rectangle(X1 : Integer; Y1 : Integer; X2 : Integer; Y2 : Integer);

TWebCanvas.RectangleExt

Renders a rectangle containing text to the canvas.

Use RectangleExt() to draw a rectangle containing text, with thespecified border and fill colors. The position, height and width aredetermined by the specified coordinates.

PARAMETERS:- Left, Top are the Left and Top coordinates of the bounding rectangle- Width, Height are the Right and Bottom coordinates determining the extent of the bounding rectangle- BorderStyle determines the pen style used to draw the rectangle- BorderWidth determines the line thickness used to draw the rectangle- Color determines the fill color- Value is the text to be contained by the rectangle- Alignment determines how the text is aligned within the rectangle

Defined in: SystemControls

Procedure RectangleExt(Left : Integer;
                       Top : Integer;
                       Width : Integer;
                       Height : Integer;
                       BorderStyle : TBorderStyle;
                       BorderSides : THTMLBorderSides;
                       BorderWidth : Integer;
                       BorderColor : TCOlor;
                       Color : TCOlor;
                       Value : String;
                       Alignment : TAlignment;
                       VertAlignment : TVertAlignment);

TWebCanvas.SelectBrush

Selects the background color and style for the drawing methods.

Use SelectBrush() to specify the background color and style to use whendrawing or filling.

PARAMETERS:- Color determines the background color- Style determines the background stylePossible values:bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross

Defined in: SystemControls

Procedure SelectBrush(BColor : TCOlor; BStyle : TBrushStyle);

TWebCanvas.SelectFont

Selects the Font characteristics for the text rendering methodsUse SelectFont() to specify the font attributes for writing text to thecanvas.

PARAMETERS:- Name determines the typeface of the font- Color determines the font color- Bold, when true the font is boldfaced- Italic, when true the font is italicized- Underline, when true the font is underlined- StrikeThrough, when true the font has a horizontal line through it.

Defined in: SystemControls

Procedure SelectFont(FName : String;
                     FColor : TCOlor;
                     FSize : Integer;
                     FBold : Boolean;
                     FItalic : Boolean;
                     FUnderLine : Boolean;
                     FStrikeThrough : Boolean);

TWebCanvas.SelectPen

Selects the pen width, color and style for the drawing methods.

Use SelectPen() to specify the drawing width, color and style to use whendrawing lines and shapes.

PARAMETERS:- Width determines the maximum thickness of the pen when drawing- Color determines the pen drawing color- Style determines the pen drawing stylePossible values:psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrameNOTE:The value of Width influences which values of Style are valid.

Defined in: SystemControls

Procedure SelectPen(PWidth : Integer; PColor : TCOlor; PStyle : TPenStyle);

TWebCanvas.SetFontStyle

Assigns the canvas font from the WebControl.

Use SetFontStyle() to update the canvas font attributes to thosespecified in the passed in WebControl.

PARAMETERS:- WebControl contains the font attributes to which the canvas fontwill be assigned.

Defined in: SystemControls

Procedure SetFontStyle(WebControl : TWebControl);

TWebCanvas.StretchDraw

Renders an image to the canvas.

Use StretchDraw() to display an image within the region defined by therectangle coordinates specified. If the image size does not match thedefined region size, it will be scaled to fit.

PARAMETERS:- L, T are the Left and Top coordinates of the bounding rectangle- R, B are the Right and Bottom coordinates determining the extent of the bounding rectangle

Defined in: SystemControls

Procedure StretchDraw(L : Integer;
                      T : Integer;
                      R : Integer;
                      B : Integer;
                      Graphic : TDeviceGraphic);

TWebCanvas.VerticalLine

Draws a vertical of a defined height, starting at the specifiedcoordinates.

Use VericalLine() to draw a vertical line from the positionspecified by the X and Y coordinates. The W parameter determines theheight of the vertical line.

PARAMETERS:- X1, Y1 are the coordinates of the line's starting point- W is the length of the horizontal line being drawn.

NOTE:Use SelectPen() to select the line color and style

Defined in: SystemControls

Procedure VerticalLine(X1 : Integer; Y1 : Integer; W : Integer);

TWebCanvas.WritelnString

Renders raw text to the canvas and appends a new line.

Use WritelnString() to render raw text with existing pen and brush settingsto the canvas. A New line is appended automatically.

PARAMETERS:S is the text string to be written to the canvas.

Defined in: SystemControls

Procedure WritelnString(S : String);

TWebCanvas.WriteString

Renders raw text to the canvasUse WriteString() to render raw text with existing pen and brush settingsto the canvas.

PARAMETERS:S is the text string to be written to the canvas.

Defined in: SystemControls

Procedure WriteString(S : String);

TWebControl.absBoundingRect

Returns the absolute bounding rectangle of the web control.

Read absBoundingRect to obtain the absolute screen coordinates of arectangle that encloses the web control.

Defined in: SystemControls

Function absBoundingRect: TRect;

TWebControl.Destroy

Disposes of the web control and its owned child web controls.

Defined in: SystemControls

Destructor Destroy;

TWebControl.DoOnAfterPrint

Generates an OnAfterPrint event.

The Draw method calls DoOnAfterPrint to generate the OnAfterPrint eventafter a web control has been rendered.

WARNING:Do not change web control properties that would force the web control tobe re-rendered.

This may cause recursion and endless re-rendering !

Defined in: SystemControls

Procedure DoOnAfterPrint(Canvas : TWebCanvas);

TWebControl.DoOnBeforePrint

Generates an OnBeforePrint event.

The Draw method calls DoOnBeforePrint to generate the OnBeforePrint eventbefore a web control is about to be rendered.

WARNING:Do not change web control properties that would force the web control tobe re-rendered.

This may cause recursion and endless re-rendering !

Defined in: SystemControls

Function DoOnBeforePrint(Canvas : TWebCanvas): Boolean;

TWebControl.Draw

Renders the web control and all it's children.

Draw generates the OnBeforePrint and OnAfterPrint events.

Defined in: SystemControls

Procedure Draw(Canvas : TWebCanvas);

TWebControl.SetBorder

Controls the attributes of the border for a web control.

Defined in: SystemControls

Procedure SetBorder(bStyle : TBorderStyle;
                    bWidth : Integer;
                    bColor : TCOlor;
                    bSides : THTMLBorderSides);

TWebControl.SetBounds

Sets the Left, Top, Width, and Height properties all at once.

Use SetBounds to change all of the web control's boundary properties at one time.

The same effect can be achieved by setting the Left, Top, Width, and Heightproperties separately, but SetBounds changes all four properties at onceensuring that the web control will not redraw between changes.

Defined in: SystemControls

Procedure SetBounds(l : Integer; t : Integer; w : Integer; h : Integer);

TWebControl.SetFont

Controls the attributes of text written on or in the web control.

Defined in: SystemControls

Procedure SetFont(FName : String;
                  FSize : Integer;
                  FStyle : TFontStyles;
                  FColor : TCOlor);


Related Topics