TextTrayIcon, ver. 1.2.1

[Properties] [Methods] [Events]
[Hints] [Known Bugs] [Comments]

TextTrayIcon is a tray icon component. It is an extended version of the CoolTrayIcon component, so you need CoolTrayIcon to make it work.

TextTrayIcon allows you to easily show custom text inside the tray icon. If you need tray icons with just regular icons I suggest you use CoolTrayIcon in stead.

This document describes only the added features of TextTrayIcon. For an explanation of all the standard features of this tray icon component, see the CoolTrayIcon documentation.

Properties

Text property Text: String;
The text to show in the tray icon. The text is always centered horizontally and vertically.
NOTE: You can have multiple lines of text. Separate the lines with #13 (CR).

Font property Font: TFont;
The font to use when drawing the text.

Color property Color: TColor;
The (background) color of the tray icon. Use clBtnFace to show it in the color of the task bar.
Default clBtnFace
Border property Border: Boolean;
Whether to draw a border at the edges of the tray icon. This is a rectangle 1 px. wide using the color specified by BorderColor.
Default false
BorderColor property BorderColor: TColor;
The color of the tray icon's border rectangle.
Default clBlack
BackgroundIcon property BackgroundIcon: TIcon;
If no background icon is specified the tray icon will be rendered using the text, font, color, and border properties you've specified. If a background icon is specified then it will be rendered beneath the text as if the tray icon was transparent. In other words: the background color is ignored and the background icon is shown in stead.
Default true
Options You will likely prefer to adjust the text inside the tray icon. Use the following layout options for that purpose:
OffsetX property OffsetX: Integer;
Adjusts the text X pixels horizontally.
OffsetY property OffsetY: Integer;
Adjusts the text Y pixels vertically.
LineDistance property LineDistance: Integer;
Adds or delete Y pixels between multiple lines of text. A value of -2 is a good idea in most cases of multiline text.

Methods

Draw procedure Draw;
Redraws the tray icon using the current colors, font, and border properties described above.
NOTE: The tray icon is automatically redrawn when one of those properties change.
NOTE: Calling draw directly (or by assigning to one of the properties mentioned) will set CycleIcons to false, as it doesn't make sense to draw an icon and then immediately replace it with a new one.

Events

Hints

Known Bugs

Comments

The TextTrayIcon component is freeware (along with the CoolTrayIcon component). Feel free to use and improve it, but please include all original files if you redistribute the zip-file. If you have any comments or corrections to the component I would very much like to hear them.

The component should work on any Windows platform (Win9x, ME, NT, 2000, XP). If you experience any problems related to the operating system you use, please tell me. Also, it should work in Delphi 3 and up (Delphi 2?) and C++Builder 3 and up. Again, tell me if I'm wrong.

Get the latest version from http://www3.brinkster.com/troels/delphi.asp.

Troels Jakobsen
delphiuser@get2net.dk