Visual CLX TTextBrowser Demo

This demonstrates a component called TTextBrowser, which allows browsing of simple HTML documents.

A related control, TTextViewer, loads an HTML file, but doesn't support jumping to links nor returning link info.

Link to second page...

Navigation Buttons

The Home, Back, and Forward buttons can be used to navigate through the pages that you have viewed and linked to. The Home button will return you to the first document viewed with the control. Note that the TTextBrowser component will not display HTTP-based URL's. It will only link and display files on the local machine.

Text Color

The "Red" and "Blue" radiobuttons allow the setting of the text color in the viewed document. This setting will give the selected color to all text in the document that is not already colored with a <FONT> tag or that is not a link.

Reload Button

The Reload button causes the document to be reloaded into the viewer. This calls the LoadFromFile method.

Link Color

The Link Color radiobuttons control whether the color setting is applied to links or other text. This causes the LinkColor property to be set. See Text Color.

Text

The Plain Text radiobutton causes the document to be viewed as plain text, thus showing HTML syntax. This is set by assigning tfPlainText to the TextFormat property. The Formatted radiobutton shows the text as formatted HTML.

Underline Links

The Underline Links checkbox causes the links in the document to be shown with underlines. This sets the UnderlineLink property, which is of type Boolean.

Source Path

The Link Source Path editbox tells the TTextBrowser control where to search for files referenced in links. This path setting is used by the Factory.FilePath property. By default, the demo application looks for files named index.html within the directory. Note that as you change the directory values, the TTextBrowser keeps these directories in the PathList file, which is stored in the Factory.FilePath property to maintain a list of places that you have been. Use the Button to the right to select a path.

Link Information

The Statusbar at the bottom of the form shows link references as the mouse moves over them in the document. These references are supplied by the OnHighlightText handler.