Main class of the library. Used to create and display HTML documents
Properties
Surface: TSurfaceReference to TSurface objects handling grahics procedures
Changed: booleanChange flag, Indicates that styles calculation is needed (CalcStyles)
Styles: TStylesStyle Sheets
NeedRepaint: booleanIndicates that document repaint is needed (Repaint)
NeedRecalcIndicates that document calculation is needed (Recalc)
SubscribedtoAnimation: booleanAnimation subscription flag. Indicates that document receives animation events
DestCanvas: TCanvasLast destination canvas
Control: TControl;Link to VCL TControl. Used by control tag elements
Selection: TDocSelectionDocument selection object
DrawRect: TRect;Last output rectangle on DestCanvas
Methods
procedure Parse(html: string)Parses HTML text and builds element tree
procedure Draw(Canvas: TCanvas; const R: TRect);Calculate CSS Styles (CalcStyle), calculate document (Recalc) and paints document to Canvas in R region
procedure CalcSize(FixedWidth: integer=0)Calculates document size (height/width) Returns sizes in CalcWidth and CalcHeight properties You can specify fixed width and calculate height only
function CalcStyle(Styles: TStyles): booleanCalculates document styles
procedure OnMouseMove(x, y: integer; State: TShiftState)Raises document MouseMove event
procedure OnMouseDown(x, y: integer; Down: boolean)Raises document MouseDown event
procedure RecalcCalculate document
function SelectedText: stringDocument selected text
procedure Repaint;Paints document to last canvas provided by Draw
Events
property OnClick: TNotifyEventLink click event
property BeforePaint: TNotifyEventBefore paint event
property OnGetUrl: TGetUrlEventUsed bi img elements to get image data img
property OnRepaint: TNotifyEvent
Global container for HtDocument styles and events
Properties
property Styles: TStrings;Global style sheet for project
property OnGetURL: TGetURLEvent read fOnGetURL write fOnGetURL;Global OnGetUrl handler
Current document selection
Properties
StartElement, EndElement: TElementFirst/Last selected elements
StartPos, EndPos: integerPosition of selection in first and last elements
Methods
function InSelection(E: TElement): boolean;Checks if E is in selection
function Empty: boolean;Checks selection os not empty
function Inverted: boolean;Indicates inverted selection (First>Last)
procedure Clear;Clears selection
Document style
Properties
Margin: array[0..3] of TMeasure;Element Margins (outer space)
Padding: array[0..3] of TMeasure;Element Paddings (inner space)
Border: array[0..3] of THtBorderStyle;Element borders (top, right, bottom, left)
Background: TElementBackground;Element background; Contains color, gradients, blur, image
HAlign: THAlign;Horizontal alignment
VAlign: TVAlign;Vertical alignment
FontSize: TMeasure;Size of the font
Display: TDisplayStyle;Display type (none, inline, block...)
Left, Top: TMeasure;Fixed position of the element
Width, Height: TMeasure;Fixed width and height
Float: TFloat;Float type (left, right)
Position: TElementPosition;Position type (absolute, relative...)
BoxShadow: TElementShadow;Box shadow (color, position, blur)
BorderSpacingX, BorderSpacingY: TMeasure;Border spacing
ZIndex: integer;Z Index of the element
Clear: set of TElementClear;Clear type (left, right, both)
Opacity: single;Opacity (0..1)
TextColor: cardinal;Element text color
TextStyle: TFontStyles;Element text style (bold, italic...)
FontName: string;Font family
Zoom: single;Zoom index
Transform: TTransform;Transform type (rotate...)
WhiteSpace: TWhiteSpace;White space
ListStyleType: TListStyleType;List type (none, circle...)
CurrentPC: set of TCSSPseudoclass;List of current pseudoclasses
property Element: TElement
Base class for HTML elements
Properties
Id: string;Element ID
StyleClass: string;Element classes (class attribute)
Tag: string;Tag name
Content: string;Element content (for text elements contains text, for image and elements - src, for a elements - href)
Style: TElementStyle;Style object
OuterRect, BorderRect, InnerRect: TRect;Element rectangles (see CSS box model)
Parent: TElement;Element parent
Container: TElement;Element container (first non-inline parent)
CalcWidth, CalcHeight : integer;Calculated outer width and height
InnerWidth, InnerHeight : integer;Calculated inner width and height
RealLeft, RealTop: integer;Real position of the element
ContentWidth, ContentHeight: integer;Element content width and height
SelfStyle: string;style attribute
SelfRects: array of TRect;All element rectangles
Drawed: boolean;Indicates than element was painted
Index: currency;Global index of the element
SelfFlow: TFlow;TFlow object for non-inline elements
StartLine, EndLine: integer;First and last line in Container.Flow
Before, After, Master: TElement;:before and :after elements property Elements: TElementList read getElements; Child elements property Document: THtDocument read GetDocument; Document
Methods
Text element class
Properties
Methods
Class for img tag fot img
Properties
Methods
Class for input tag
Properties
Methods
VCL control container class
Properties
Methods
Class for fieldset tag
Properties
Methods
Table element class
Properties
Methods