TPJHotLabel Component


Contents


Description

The unit hotlabel.pas contains the code for the TPJHotLabel component. The cursor resource required by the unit is contained in hotlabel.res.

TPJHotLabel is a simple component that is a descendent of TLabel. It provides a simple way to include clickable URLs on forms. You set the label's Caption property to the required URL and, when the program is executed, clicking the caption text launches the default browser or email client for the URL that forms the text. The component can also perform limited validation of URLs. The following protocols are supported:


Compatibility

TPJHotLabel is not suitable for use with Delphi 1. It has been tested Delphi 2, 3 and 4. It may work correctly in Delphi 5 but has not been tested.


Installation

In these instructions $(DELPHI) is to be taken to represent the path where the appropriate version of Delphi was installed. For example, if you have Delphi 2 installed on the default installation path then $(DELPHI) is equivalent to C:\Program Files\Borland\Delphi 2.0.

Installation with Delphi 2

  1. Unzip the file hotlabel.zip into a folder.
  2. Copy the files hotlabel.pas, hotlabel.res and hotlabel.dcr to the folder from where you wish to install the component into the Delphi Component Palette. This will probably be an existing folder where you keep the library components - say the default $(DELPHI)\lib folder.
  3. Copy the help file hotlabel.hlp and the keyword file hotlabel.kwf into the $(DELPHI)\help folder
  4. Make sure Delphi is not running. Merge the help keyword file with Delphi's help system by running helpinst.exe from the $(DELPHI)\help\tools folder. When helpinst.exe is running open the delphi.hdx file from the $(DELPHI)\bin folder, click the + button then add hotlabel.kwf from $(DELPHI)\help. Then click on the Save button.
  5. Start Delphi. Select the Components | Install menu option. Click the Add button, then the Browse button and navigate to the hotlabel.pas file in the folder where you placed it. Click OK to recompile the component library.
  6. You can now delete hotlabel.pas from the place where you copied it if you wish. The component will appear on a palette called PJ Stuff. You can move it to a different palette as required, or hack the source code (before installing the component) by finding the Register procedure at the end of the code and changing the string 'PJ stuff' to the name of the required palette.

Installation with Delphi 3 & Delphi 4

Note that although the provided help file gives information about using the component it cannot be linked into the Delphi 3 or Delphi 4 environments at present.

  1. Unzip the file hotlabel.zip into a folder.
  2. Copy the files hotlabel.pas, hotlabel.res and hotlabel.dcr to the folder from where you wish to install the component into the Delphi Component Palette. This will probably be a sub-folder of the $(DELPHI)\lib folder.
  3. Install the component into the palette by chosing the Component | Install Component menu option. The following instructions assume you are installing into the default "users components" package:
  4. You can now delete hotlabel.pas from the place where you copied it if you wish. The component will appear on a palette called PJ Stuff. You can move the component to a different palette as required, or hack the source code (before installing the program) by finding the Register procedure at the end of the code and changing the string 'PJ stuff' to the name of the required palette.


Update History

Release 1.0 of 25/10/1999
HotLabel v1.0 of 24/10/1999

Release 1.0.1 of 28/11/1999
HotLabel v1.0 of 24/10/1999


Known Issues

It is not at present possible to integrate the help file into the IDE with Delphi 3 and Delphi 4.


License & Disclaimer

The source code and help files for these components can be freely distributed on a not-for-profit basis providing that:

  1. the source code is not altered.
  2. this file is distributed with it unchanged

By not-for-profit I mean that you may recover out of pocket expenses incurred in distributing the code, but should not make a profit from this.

If you discover any bugs in this implementation, or if you have any update suggestions, please contact me on peter.johnson@openlink.org.

Please do modify the code for you own use. I'd like to see any changes you make - I could incorporate them into future versions. Please notify me of changes at the above e-mail address.

This software is provided as is - no warranty is given as to its suitability for any purposes to which you may wish to put it.


About the Author

I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales, UK. I write mainly in Delphi, but occasionally dabble in C, C++ and Java. My programs are available for download on my web-site: http://homepages.tesco.net/~p.d.johnson/

I can be contacted by e-mail on peter.johnson@openlink.org.