UserGuide

Desktop HTML Viewer

From Xojo Documentation

The HTMLViewer control renders HTML (similarly to a web browser) and provides basic navigation methods. Via methods you can pass it an HTML file, the HTML text itself, or tell it to load the HMTL specified by a URL. If the HTML is valid, it renders it. As an example, the Xojo Language Reference window uses the HTML Viewer control.

HTML Viewer Library Icon

Events

CancelLoad - Return True to cancel loading the page.

DocumentBegin - Called when the HTML page starts to load.

DocumentComplete - Called when the HTML page has finished loading.

DocumentProgressChanged - Called when the progress has been updated.

NewWindow - Called when the user clicks a link that would normally open a new window (or a new tab). Return an instance of an HTML Viewer to use to display the link. Use this code to display the link in the current HTML Viewer:

// Use the current HTMLViewer (Me)
// to display the new window.
Return Me

SecurityChanged - Called when the security of the page has changed (from HTTP to HTTPS, for example).

StatusChanged - Called when the Status text has changed.

TitleChanged - Called when the title of the web page has changed.

Properties

CanGoBack, CanGoForward - Indicates if there is a prior or next page in the navigation history.

UserAgent - Allows you to get or set the user agent sent to the server.

Methods

Cancel - Cancels any current operations.

GoBack, GoForward - Used to navigate back or forward in the page history.

LoadPage - Used to load a page either by supplying a string or file containing the HTML.

LoadURL - Loads a page using the supplied URL.

Print - Prints the contents of the HTML Viewer. Requires WebKit 1.1.5 or newer on Linux.

ZoomTextIn, ZoomTextOut - Used to zoom the text in the HTML Viewer in or out.

See Also

DesktopHTMLViewer class