wxHtmlWindow

wxHtmlWindow

wxHtmlWindow
Functions for wxHtmlWindow class

wxHtmlWindow is probably the only class you will directly use unless you want to do something special (like adding new tag handlers or MIME filters).

The purpose of this class is to display rich content pages (either local file or downloaded via HTTP protocol) in a window based on a subset of the HTML standard. The width of the window is constant, given in the constructor and virtual height is changed dynamically depending on page size. Once the window is created you can set its content by calling setPage/2 with raw HTML, loadPage/2 with a wxFileSystem (not implemented in wx) location or loadFile/2 with a filename.

Note: If you want complete HTML/CSS support as well as a Javascript engine, consider using wxWebView instead.

wxHtmlWindow uses the wxImage class for displaying images, so you need to initialize the handlers for any image formats you use before loading a page. See ?wxInitAllImageHandlers and wxImage::AddHandler (not implemented in wx).

Styles

This class supports the following styles:

See: wxHtmlLinkEvent, wxHtmlCellEvent (not implemented in wx)

This class is derived (and can use functions) from: wxScrolledWindow wxPanel wxWindow wxEvtHandler

wxWidgets docs: wxHtmlWindow

Event types emitted from this class: html_cell_clicked, html_cell_hover, command_html_link_clicked

Types

Appends HTML fragment to currently displayed text and refreshes the window.

Return: false if an error occurred, true otherwise.

Types

Returns full location of the opened page.

If no page is opened or if the displayed page wasn't produced by call to loadPage/2, empty string is returned.

Types

Returns title of the opened page or wxEmptyString if the current page does not contain <TITLE> tag.

Types

Clears history.

Types

Returns the current selection as plain text.

Returns an empty string if no text is currently selected.

Types

This function sets the space between border of window and HTML contents.

See image:

Types

Normal_face = Fixed_face = unicode:chardata()
Option = {sizes, [integer()]}

This function sets font sizes and faces.

See wxHtmlDCRenderer::SetFonts (not implemented in wx) for detailed description.

See: SetSize()

Types

Sets the source of a page and displays it, for example:

If you want to load a document from some location use loadPage/2 instead.

Return: false if an error occurred, true otherwise.

Types

Sets the frame in which page title will be displayed.

format is the format of the frame title, e.g. "HtmlHelp : %s". It must contain exactly one s. This s is substituted with HTML page title.

Types

Index = integer()

After calling setRelatedFrame/3, this sets statusbar slot where messages will be displayed.

(Default is -1 = no messages.)

Types

Option = {index, integer()}

Sets the associated statusbar where messages will be displayed.

Call this instead of setRelatedFrame/3 if you want statusbar updates only, no changing of the frame title.

Since: 2.9.0