1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <title>TextTrayIcon, ver. 1.2.1</title>
|
---|
5 |
|
---|
6 | <style type='text/css'>
|
---|
7 | /* body { font-family: MS Sans Serif; font-size: 12pt; } */
|
---|
8 | h1 { font: bold 14pt Arial; margin-bottom: 10px; }
|
---|
9 | h2 { font: bold 12pt Arial; margin-bottom: 10px; margin-top: 40px; }
|
---|
10 | td.name { background-color: #C0E0FF; width: 120px; font-weight: bold; }
|
---|
11 | td.desc { background-color: #F0F0F0; }
|
---|
12 | td.default { background-color: #F0F0F0; }
|
---|
13 | ul { margin-left: 15px; margin-top: 5px; }
|
---|
14 | li { margin-bottom: 10px; }
|
---|
15 | .declaration { font-weight: bold; }
|
---|
16 | </style>
|
---|
17 |
|
---|
18 | </head>
|
---|
19 |
|
---|
20 |
|
---|
21 | <body topmargin='15' bottommargin='15' leftmargin='10' rightmargin='10'>
|
---|
22 |
|
---|
23 | <a name='Top'><h1>TextTrayIcon, ver. 1.2.1</h1>
|
---|
24 |
|
---|
25 |
|
---|
26 | <a href='#Properties'>[Properties]</a> <a href='#Methods'>[Methods]</a> <a href='#Events'>[Events]</a>
|
---|
27 | <br>
|
---|
28 | <a href='#Hints'>[Hints]</a> <a href='#Bugs'>[Known Bugs]</a> <a href='#Comments'>[Comments]</a>
|
---|
29 | <br>
|
---|
30 |
|
---|
31 |
|
---|
32 | <p>
|
---|
33 | TextTrayIcon is a tray icon component. It is an extended version of the CoolTrayIcon
|
---|
34 | component, so you need CoolTrayIcon to make it work.
|
---|
35 | </p>
|
---|
36 |
|
---|
37 | <p>
|
---|
38 | TextTrayIcon allows you to easily show custom text inside the tray icon. If you need
|
---|
39 | tray icons with just regular icons I suggest you use CoolTrayIcon in stead.
|
---|
40 | </p>
|
---|
41 |
|
---|
42 | <p>
|
---|
43 | This document describes <i>only</i> the added features of TextTrayIcon. For an explanation of
|
---|
44 | all the standard features of this tray icon component, see the CoolTrayIcon documentation.
|
---|
45 | </p>
|
---|
46 |
|
---|
47 |
|
---|
48 | <a name='Properties'></a><h2>Properties</h2>
|
---|
49 |
|
---|
50 | <table cellpadding='2' cellspacing='2' border='0' width='100%' bgcolor='white'>
|
---|
51 | <tr>
|
---|
52 | <td class='name' valign='top'>Text</td>
|
---|
53 | <td class='desc' valign='top'><span class='declaration'>property Text: String;</span><br>
|
---|
54 | The text to show in the tray icon. The text is always centered horizontally and vertically.<br>
|
---|
55 | <b>NOTE:</b> You can have multiple lines of text. Separate the lines with
|
---|
56 | #13 (CR).</td>
|
---|
57 | <td class='default' valign='top' nowrap><br></td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td class='name' valign='top'>Font</td>
|
---|
61 | <td class='desc' valign='top'><span class='declaration'>property Font: TFont;</span><br>
|
---|
62 | The font to use when drawing the text.</td>
|
---|
63 | <td class='default' valign='top' nowrap><br></td>
|
---|
64 | </tr>
|
---|
65 | <tr>
|
---|
66 | <td class='name' valign='top'>Color</td>
|
---|
67 | <td class='desc' valign='top'><span class='declaration'>property Color: TColor;</span><br>
|
---|
68 | The (background) color of the tray icon. Use clBtnFace to show it in the color of
|
---|
69 | the task bar.</td>
|
---|
70 | <td class='default' valign='top' nowrap>Default clBtnFace</td>
|
---|
71 | </tr>
|
---|
72 | <tr>
|
---|
73 | <td class='name' valign='top'>Border</td>
|
---|
74 | <td class='desc' valign='top'><span class='declaration'>property Border: Boolean;</span><br>
|
---|
75 | Whether to draw a border at the edges of the tray icon.
|
---|
76 | This is a rectangle 1 px. wide using the color specified by BorderColor.</td>
|
---|
77 | <td class='default' valign='top' nowrap>Default false</td>
|
---|
78 | </tr>
|
---|
79 | <tr>
|
---|
80 | <td class='name' valign='top'>BorderColor</td>
|
---|
81 | <td class='desc' valign='top'><span class='declaration'>property BorderColor: TColor;</span><br>
|
---|
82 | The color of the tray icon's border rectangle.</td>
|
---|
83 | <td class='default' valign='top' nowrap>Default clBlack</td>
|
---|
84 | </tr>
|
---|
85 | <tr>
|
---|
86 | <td class='name' valign='top'>BackgroundIcon</td>
|
---|
87 | <td class='desc' valign='top'><span class='declaration'>property BackgroundIcon: TIcon;</span><br>
|
---|
88 | If no background icon is specified the tray icon will be rendered using the text,
|
---|
89 | font, color, and border properties you've specified.
|
---|
90 | If a background icon is specified then it will be rendered beneath the text as if the
|
---|
91 | tray icon was transparent. In other words: the background color is ignored and the
|
---|
92 | background icon is shown in stead.</td>
|
---|
93 | <td class='default' valign='top' nowrap>Default true</td>
|
---|
94 | </tr>
|
---|
95 | <tr>
|
---|
96 | <td class='name' valign='top'>Options</td>
|
---|
97 | <td class='desc' valign='top'>You will likely prefer to adjust the text inside the
|
---|
98 | tray icon. Use the following layout options for that purpose:<br>
|
---|
99 | <table cellpadding='3' cellspacing='0' border='0' width='100%' bgcolor='white'>
|
---|
100 | <tr>
|
---|
101 | <td class='name' valign='top'>OffsetX</td>
|
---|
102 | <td class='desc' valign='top'><span class='declaration'>property OffsetX: Integer;</span><br>
|
---|
103 | Adjusts the text X pixels horizontally.</td>
|
---|
104 | </tr>
|
---|
105 | <tr>
|
---|
106 | <td class='name' valign='top'>OffsetY</td>
|
---|
107 | <td class='desc' valign='top'><span class='declaration'>property OffsetY: Integer;</span><br>
|
---|
108 | Adjusts the text Y pixels vertically.</td>
|
---|
109 | </tr>
|
---|
110 | <tr>
|
---|
111 | <td class='name' valign='top'>LineDistance</td>
|
---|
112 | <td class='desc' valign='top'><span class='declaration'>property LineDistance: Integer;</span><br>
|
---|
113 | Adds or delete Y pixels between multiple lines of text.
|
---|
114 | A value of -2 is a good idea in most cases of multiline text.</td>
|
---|
115 | </tr>
|
---|
116 | </table>
|
---|
117 | </td>
|
---|
118 | <td class='default' valign='top' nowrap><br></td>
|
---|
119 | </tr>
|
---|
120 | </table>
|
---|
121 |
|
---|
122 |
|
---|
123 |
|
---|
124 | <a name='Methods'></a><h2>Methods</h2>
|
---|
125 |
|
---|
126 | <table cellpadding='2' cellspacing='2' border='0' width='100%'>
|
---|
127 | <tr>
|
---|
128 | <td class='name' valign='top'>Draw</td>
|
---|
129 | <td class='desc' valign='top'><span class='declaration'>procedure Draw;</span><br>
|
---|
130 | Redraws the tray icon using the current colors, font, and
|
---|
131 | border properties described above.<br>
|
---|
132 | <b>NOTE:</b> The tray icon is automatically redrawn when one of those
|
---|
133 | properties change.<br>
|
---|
134 | <b>NOTE:</b> Calling draw directly (or by assigning to one of the
|
---|
135 | properties mentioned) will set CycleIcons to false, as it doesn't make
|
---|
136 | sense to draw an icon and then immediately replace it with a new one.</td>
|
---|
137 | </tr>
|
---|
138 | </table>
|
---|
139 |
|
---|
140 |
|
---|
141 |
|
---|
142 | <a name='Events'></a><h2>Events</h2>
|
---|
143 |
|
---|
144 | <ul>
|
---|
145 | <li>No new events.
|
---|
146 | </li>
|
---|
147 | </ul>
|
---|
148 |
|
---|
149 |
|
---|
150 |
|
---|
151 | <a name='Hints'></a><h2>Hints</h2>
|
---|
152 |
|
---|
153 | <ul>
|
---|
154 | <li><b>What are some good rules for showing text in a tray icon?</b><br>
|
---|
155 | You only have 16x16 pixels to draw inside, so use only 1 or 2 lines of text. Use
|
---|
156 | high contrast colors, like white background and black text, perhaps with a border.
|
---|
157 | Don't use fonts with serifs. For multiline text I think the font 'Small Fonts'
|
---|
158 | approx. size 6 looks best. Set OffsetY to -1 and LineDistance to -2.
|
---|
159 | NOTE: It's easy to experiment if you enable the DesignPreview property.
|
---|
160 | </li>
|
---|
161 |
|
---|
162 | <li><b>How do I start my app. with the tray icon visible and the main form invisible?</b><br>
|
---|
163 | At design time set IconVisible to true and set the form's Visible property to false.
|
---|
164 | Set the ShowMainForm parameter to false in the OnStartup event. See the StartHidden demo.
|
---|
165 | </li>
|
---|
166 |
|
---|
167 | <li><b>What is the proper way to restore the form?</b><br>
|
---|
168 | ALWAYS use the method ShowMainForm! This method contains important calls that affect
|
---|
169 | how the form and the application display themselves. Simply setting the form visible
|
---|
170 | or calling Application.Restore is not enough. A common symptom is the form with tabpages
|
---|
171 | that don't update themselves because ShowMainForm wasn't used.
|
---|
172 | </li>
|
---|
173 | </ul>
|
---|
174 |
|
---|
175 |
|
---|
176 |
|
---|
177 | <a name='Bugs'></a><h2>Known Bugs</h2>
|
---|
178 |
|
---|
179 | <ul>
|
---|
180 | <!--
|
---|
181 | <li>If you select a background icon that is partially transparent the transparent
|
---|
182 | part may not be rendered as it should. This is because the transparent part is
|
---|
183 | substituted with the task bar's color (clBtnFace). However, since a tray icon
|
---|
184 | can only contain 16 colors, the color that is supposed to be transparent will
|
---|
185 | show if the user's task bar color is outside the common 16 colors. I'm trying to
|
---|
186 | find a way out of this so you get true transparency, but so far without success.
|
---|
187 | </li>
|
---|
188 | -->
|
---|
189 | <li>No known bugs at this point.
|
---|
190 | </li>
|
---|
191 | </ul>
|
---|
192 |
|
---|
193 |
|
---|
194 |
|
---|
195 | <a name='Comments'></a><h2>Comments</h2>
|
---|
196 |
|
---|
197 | The TextTrayIcon component is <i>freeware</i> (along with the CoolTrayIcon
|
---|
198 | component). Feel free to use and improve it, but <i>please include all original
|
---|
199 | files if you redistribute the zip-file</i>.
|
---|
200 | If you have any comments or corrections to the component I would very much like
|
---|
201 | to hear them.
|
---|
202 | </p>
|
---|
203 |
|
---|
204 | <p>
|
---|
205 | The component should work on any Windows platform (Win9x, ME, NT, 2000, XP).
|
---|
206 | If you experience any problems related to the operating system you use, please tell me.
|
---|
207 | Also, it should work in Delphi 3 and up (Delphi 2?) and C++Builder 3 and up.
|
---|
208 | Again, tell me if I'm wrong.
|
---|
209 | </p>
|
---|
210 |
|
---|
211 | <p>
|
---|
212 | Get the latest version from <a href='http://www3.brinkster.com/troels/delphi.asp' target='_blank'>
|
---|
213 | http://www3.brinkster.com/troels/delphi.asp</a>.
|
---|
214 | </p>
|
---|
215 |
|
---|
216 | <p>
|
---|
217 | Troels Jakobsen<br>
|
---|
218 | <a href='mailto:delphiuser@get2net.dk'>delphiuser@get2net.dk</a>
|
---|
219 | </p>
|
---|
220 |
|
---|
221 | </body>
|
---|
222 | </html>
|
---|