#
Hot Label Component
ReadMe

## Description

TPJHotLabel is a simple Delphi component that descends from TLabel. It provides a click-able label that can start the default browser or email client to access a specific URL. Key features of the component are:

- All properties of TLabel are supported, although the usage and default values of some of the inherited properties have been changed.
- The URL property is used for storing the URL to be accessed when the label is clicked and the Caption property can either store descriptive text or can reflect the URL, depending on the value of the CaptionIsURL property. The ability to link the Caption and URL makes it easy to display the URL without having to keep two properties synchronised.
- The URL can be validated to check for supported protocols. This validation is switched on and off using the ValidateURL property. Supported protocols are:
  - `http://`
  - `https://`
  - `mailto:`
  - `file:`
  - `ftp://`
- The label's Font property defaults to a navy blue to indicate a link.
- The label can be highlighted when the mouse passes over it. Highlighting is used if the HighlightURL property is True, and the font used for highlighting is set using the HighlightFont property.
- The label can also display in a different style when its "link" has been clicked successfully. The font to be used is specified via the VistedFont property. The user can switch the visited state on and off via the Visited property or the component can be enabled to track visits automatically using the TrackVisits property.
- The label displays the "hand point" cursor by default.
- The component's pop-up hints can be customised as follows, using the HintStyle property:
  - the hint text can come from the Hint property as normal,
    or
  - the hint text can come from the URL property with the Hint property being ignored,
    or
  - the hint text can be modified just before the hint is shown by handling the OnCustomHint event, which is useful for displaying dynamic information in the hint.

TPJHotLabel should work with Delphi versions 4 to 2010. .NET versions of Delphi are not supported.

## Compatibility

Release v2.2.0 was tested with all native 32 bit Windows Delphi compilers from Delphi 7 through to XE4, excluding Delphi 2005. It was also tested with the 64 bit compiler of Delphi XE2 through to XE4.

Releaae v2.2.1, which was just a simple bug fix, was tested only with Delphi 10 Seattle's Win32 personality, but should still work with Delphi 7 and later, along with 64 bit Windows targets.

It is possible that the component will also compile with Delphi 4, 5 and 6, but this has not been tested for a long time.

This is a VCL component and so is not compatible with the FireMonkey framework.

## Installation

The Hot Label Component unit and accompanying files are supplied in a zip file. Before installing you need to extract the files, preserving the directory structure. The following files will be extracted:

- `PJHotLabel.pas` – Component source code.
- `PJHotLabel.dcr` – Component palette glyph.
- `ReadMe.htm` – This read-me file.
- `ChangeLog.txt` – The project change log.
- `MPL-2.txt` – The Mozilla Public License v2.0.
- `Documentation.url` – Short-cut to the component's online documentation.

In addition to the above files you will find the source code of the demo project the `Demo` sub-directory.

You can now install the components into the Delphi IDE. To do this, the files `PJHotLabel.pas` and `PJHotLabel.dcr` should be added to a design time package. If you need help doing this see here.

## Documentation

The component is fully documented online.

## Demo Program

Source code for a program that demonstrates the component is included in the download. Most of the demo's functionality depends on the properties of the various hot label components it uses – there is very little code.

The demo requires Delphi 7 or later.

## Update History

A complete change log is provided in a text file that is included in the download.

## License

The Hot Label Component is released under the terms of the Mozilla Public License v2.0.

All relevant trademarks are acknowledged.

## Bugs and Feature Requests

Bugs can be reported or new features requested via the Issue Tracker.

If no similar report or request has been recorded already, use the New Issue link to add a new issue. Please select the most appropriate template from the Templates drop down list.

## About the Author

I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs and code are available from http://www.delphidabbler.com/.

I can be contacted via the website.

Please let me know if you have any comments about the component, but please use the Issue Tracker noted above to report bugs and request new features.
This document is copyright © 2007-2014, P D Johnson, www.delphidabbler.com.