Unit
UrlHighlight
Declaration (partial)
type
TURLHighlighter = class(TPlusHighlighter);
Description
TUrlHighlighter is a non-visual component to dynamically highlight Internet urls in a TPlusMemo. Urls of all kinds are highlighted, including short forms of web and email urls (ex: www.ecmqc.com is the short form of http://www.ecmqc.com/). You can control the highlighting of different kinds of urls individually, for example email urls are controlled separately from web urls.
Highlighted urls can optionnally be clickable, whereby they are launched by a mouse click or a double click. In the case of a web url, the default web browser is launched. For an email url, the default mail client is started. By default, the mouse cursor when over a highlighted url is a hand pointer, to indicate visually the clickable behavior.
To use this component, place a TUrlHighlighter on a form or datamodule, set your TPlusMemo.Highlighter property to point to it, et voilà, urls are colored the way you want. And they can be launched automatically.
Key properties
Run-time only
| BaseContext | An Integer property that controls the context number assigned to highlighted urls. | |
| DblClickLaunch | A Boolean property that determines if urls are launched by double clicking or just a simple click. | |
| EmailURL | A THighlightInfo object to control highlighting of email urls (mailto://...). | |
| FileURL | A THighlightInfo object to control highlighting of file urls (ftp://...). | |
| LaunchURLs | A Boolean property that determines if clicking a highlighted url has any effect. | |
| NNTP_URL | A THighlightInfo object to control highlighting of usenet urls (nntp://...) | |
| OtherURL | A THighlightInfo object to control highlighting of other kind of urls, namely gopher, telnet, wais, prospero. | |
| Priority | An Boolean property telling if urls should be highlighted even if already inside of dynamically formatted section. | |
| Scope | An Integer property to control in which section urls will be highlighted. | |
| WebURL | A THighlightInfo object to control highlighting of web urls (http://, https://...). |
Key events
| OnURL | Triggered every time a url is found, letting your application decide if it should be highlighted or not. |