HtPanel

<< Click to Display Table of Contents >>

Navigation:  Controls >

HtPanel

THtPanel

Main HTML control, supports scrolling, zoom, gestures, lazy and delayed image loading, text selection, autoheight.

 

Published Properties:

Active                : boolean - enable or disable mouse event processing. Disable for faster scrolling and resize.

AdaptiveZoom: boolean - switch between proportional zoom and browser-like (fit to widow) mode.

AllowFocus        : boolean - allow/disallow focus.

AllowScaling        : boolean - allow zoom using Ctrl+Wheel.

AutoHeight        : boolean - automatic height calculation.

BackgroundImageLoading: boolean - load images in separate thread.

ClearHTMLAftrerLoad: boolean - clear HTML property after document is loaded to reduce memory consumption

CurrentFile        : string - full name of file loaded to panel, used to expand path of images referenced by document.

EnableSelection: boolean - enable/disable text selection

HorizontalScrollBar - horizontal scrollbar mode

HTML                : TStrings - set HTML content

Images                : TImageList - linked Image list. Images from this list can be referenced by index: src="1"

LazyImageLoading: boolean - load image only when it is scrolled into view

HighlightTextColor - color of highlighted text

PreservePositionOnHTMLChange - do not reset scroll offsets when HTML is changed.

QuircksModeSelector - select how to handledocuments without DOCTYPE, see Quicks mode section.

Scale                : integer - zoom in percents

ScaleFromCenter: boolean - switch between scaling from left top and mouse cursor

ScaleMin        : integer - minimum scale value

ScaleMax        : integer - maximim scale value

Script                : TStrings - additional pascal scripts

SelectHandleStyle - style of selection handles (on touch-enabled devices)

ShowHing        - show hints in elements (title attribute)

Styles                : TStrings - additional CSS styles

TouchScroll        : boolean - enable scroll by pressing and moving mouse.

VerticalScrollBar - vertical scrollbar mode

WebLoading        - enable loading images and styles from web.

 

Public properties:

Doc                : THtDocument - HTML document.

Document        : THtDocument - HTML document - same as Doc

CanvasClass        - canvas class used for displaying document

ScriptAdapter        - document script adapter (see Scripter manual)

 

Events

AfterControlCreated - called after creating Delphi control

AfterPaint        - called after paint (after EndScene)

AfterTableColumnMoved - called after HTML table column was moved

OnGetParam        - get parameter for templates in comments (THtTemplatePanel)

OnGetURL        - custom handling of CSS stylesheets, font and image URLs.

OnGetImage        - custom handling of image URLs

OnURLCLick        - called when <a> element is clicked. Use Sender['href'] to get URL.

OnURLEnter        - called when mouse enters <a> element. Use Sender['href'] to get URL.

OnURLExit        - called when mouse leaves <a> element. Use Sender['href'] to get URL.

OnElementEnter - called when mouse enter any element

OnElementExit - called when mouse leaves any element

OnMouseWheel - called on mouse wheel

OnAnimationEnd - called after animation is finished

OnElementDragEnd - called when element is dropped

OnElementResizeEnd - called when element is resized

OnElementClick - called when element is clicked

OnElementClickEx - same as OnElementClick but with additional parameters

OnAfterImageLoaded - called after image load (lazy or background mode)

OnImageLoadFailed - called if image load was failed

OnScrollBarPaint - paint event for vertical scrollbar

OnCreateControl - custom handling of Delphi controls creation

OnShowResizeHint - custom resize hint handling

OnScroll        - called after scroll

 

Methods

Scroll(DX, DY)        - scroll content

ScrollIntoView(Element) - scroll element into view

ScrollIntoCenter - scroll element into window center

ScrollIntoTop        - scroll element to window top

ScrollRectIntoView - scroll document rect into view

ScrollCanvasRectIntoView - scroll canvas rectangle into view

CopySelectiontoClipboard - copy selected content to clipboard

CopytoClipboard - copy whole document to clipboard

LoadfromFile        - load document from file

LoadfromURL         - load document from URL

LoadfromString - load document from string

LoadfromResource - load document from resource

Print                - print document

FindDialog        - execute find dialog

ReplaceDialog - execute replace dialog

ShowFloatHint - show hint for element

HideFloatHint        - hide hint

ScalefromPoint - scale document from point

SetTargetPosition - set target position for smooth scrolling

SetTargetScale - set target scale for smooth zoom