initial commit
[rofl0r-KOL.git] / kol_pas.htm
blob082c7a05927d54d9f1402532577749d77dbac5ef
1 <html>
3 <head>
4 <title>KOL Help: unit KOL.pas</title>
5 </head>
7 <body bgcolor="#FFFFEF" text="#000000" link="#008080" vlink="#008000" alink="#808000">
9 <h1 align="center">
10 &nbsp;&nbsp;<a href="cplxmath_pas.htm"><font face="Webdings" size=7>&#55;</font></a>&nbsp;&nbsp;
11 &nbsp;&nbsp;<a href="err_pas.htm"><font face="Webdings" size=7>&#56;</font></a>&nbsp;&nbsp;
12 <font face="Arial" color="#FF8080">unit KOL.pas</font>
13 </h1>
14 <hr>
15 <p>
16 Please note, that KOL does not use keyword 'class'. Instead,
17 poor Pascal 'object' is the base of our objects. So, remember,
18 how we worked earlier with such Object Pascal's objects:
19 <br>
20 - to create objects dynamically, use P&lt;objname&gt; instead of
21 T&lt;objname&gt; to allocate a pointer for dynamically created
22 object instance;
23 <br>
24 - remember, that constructors of objects can not be virtual.
25 Override procedure Init instead in your own derived objects;
26 <br>
27 - rather then call constructors of objects, call global procedures
28 New&lt;objname&gt; (e.g. <a href=#newlabel>NewLabel</a>). If not, first (for virtualally
29 created objects) call New( ); then call constructor Create
30 (which calls Init) - but this is possible only if the constructor
31 is overriden by a new one.
32 <br>
33 - the operator 'is' is not applicable to objects. And operator 'as'
34 is not necessary (and is not applicable too), use typecast to desired
35 object type, e.g.: &quot;PSomeObjectType( C )&quot; inplace of &quot;C as TSomeClassType&quot;.
36 <br>
37 <hr>
38 Also remember, that IF [ MyObj: PMyObj ] THEN
39 NOT[ with MyObj do ] BUT[ with MyObj^ do ]
40 Though it is possible to skip '^' symbol when accessing member
41 fields, methods, properties, e.g. [ MyObj.Execute; ]
42 <hr>
43 <table border=1 cellpadding=6 width=100%>
44 <colgroup valign=top span=2>
45 <tr>
46 <td> objects </td> <td> functions by category </td>
47 </tr>
48 <td>
49 <a href="_TObj.htm">_TObj</a>
51 <a href="TObj.htm">TObj</a><br>
53 <a href="TList.htm">TList</a>
55 <a href="TListEx.htm">TListEx</a>
57 <a href="TStrList.htm">TStrList</a>
59 <a href="TStrListEx.htm">TStrListEx</a><br>
61 <a href="TTree.htm">TTree</a>
63 <a href="TDirList.htm">TDirList</a>
65 <a href="TIniFile.htm">TIniFile</a>
67 <a href="TCabFile.htm">TCabFile</a>
69 <a href="TStream.htm">TStream</a><br>
71 <a href="TControl.htm">TControl</a><br>
73 <a href="TGraphicTool.htm">TGraphicTool</a>
75 <a href="TCanvas.htm">TCanvas</a>
77 <a href="TImageList.htm">TImageList</a>
79 <a href="TIcon.htm">TIcon</a>
81 <a href="TBitmap.htm">TBitmap</a>
83 <a href="TGif.htm">TGif</a>
85 <a href="TGifDecoder.htm">TGifDecoder</a>
87 <a href="TJpeg.htm">TJpeg</a><br>
89 <a href="TTimer.htm">TTimer</a>
91 <a href="TThread.htm">TThread</a>
93 <a href="TTrayIcon.htm">TTrayIcon</a>
95 <a href="TDirChange.htm">TDirChange</a>
97 <a href="TMediaPlayer.htm">TMediaPlayer</a><br>
99 <a href="TMenu.htm">TMenu</a>
101 <a href="TOpenSaveDialog.htm">TOpenSaveDialog</a>
103 <a href="TOpenDirDialog.htm">TOpenDirDialog</a>
105 <a href="TColorDialog.htm">TColorDialog</a><br>
107 <a href="TAction.htm">TAction</a>
109 <a href="TActionList.htm">TActionList</a><br>
111 <a href="Exception.htm">Exception</a><br>
113 </td>
114 <td>
115 <a href="kol_pas.htm#visual_objects_constructors">
116 Visual objects constructing functions
117 </a><br><br>
118 &nbsp;&nbsp;&nbsp;<a href="#Working with null-terminated and ansi strings">Working with null-terminated and ansi strings</a><br>
120 &nbsp;&nbsp;&nbsp;<a href="#Small bit arrays (max 32 bits in array)">Small bit arrays (max 32 bits in array)</a><br>
122 &nbsp;&nbsp;&nbsp;<a href="#Arithmetics, geometry and other utility functions">Arithmetics, geometry and other utility functions</a><br>
124 &nbsp;&nbsp;&nbsp;<a href="#Data sorting (quicksort implementation)">Data sorting (quicksort implementation)</a><br>
126 &nbsp;&nbsp;&nbsp;<a href="#String to number and number to string conversions">String to number and number to string conversions</a><br>
128 &nbsp;&nbsp;&nbsp;<a href="#64-bit integer numbers">64-bit integer numbers</a><br>
130 &nbsp;&nbsp;&nbsp;<a href="#Floating point numbers">Floating point numbers</a><br>
132 &nbsp;&nbsp;&nbsp;<a href="#Date and time handling">Date and time handling</a><br>
134 &nbsp;&nbsp;&nbsp;<a href="#File and directory routines">File and directory routines</a><br>
136 &nbsp;&nbsp;&nbsp;<a href="#System functions and working with windows">System functions and working with windows</a><br>
138 &nbsp;&nbsp;&nbsp;<a href="#Text in clipboard operations">Text in clipboard operations</a><br>
140 &nbsp;&nbsp;&nbsp;<a href="#Wrappers to registry API functions">Wrappers to registry API functions</a><br>
142 </td>
143 </table>
144 Several conditional symbols can be used in a project
145 (Project &brvbar; Options &brvbar; Directories/Conditional Defines)
146 to change code generated a bit. There are following:
147 <pre>
148 PAS_VERSION - to use Pascal version of the code.
149 PARANOIA - to force short versions of asm instructions (for D5
150 and below, D6 and higher use those instructions always).
151 USE_CONSTRUCTORS - to use constructors like in VCL.
152 USE_CUSTOMEXTENSIONS - to extend TControl with custom additions.
153 UNICODE_CTRLS - to use Unicode versions of controls (WM_XXXXW messages,
154 etc.)
155 USE_MHTOOLTIP - to use MHTOOLTIP.
156 NOT_USE_OnIdle - to stop using OnIdle event (to make code smaller
157 if it is not used actually).
158 USE_ASM_DODRAG - to use assembler version of code for DoDrag.
159 ENUM_DYN_HANDLERS_AFTER_RUN - to allow all the events handling even when
160 <a href=#appletterminated>AppletTerminated</a> become TRUE.
161 ALL_BUTTONS_RESPOND_TO_ENTER - obvious (by default, buttons respond to key
162 SPACE, since those are working this way in Windows).
163 ESC_CLOSE_DIALOGS - to allow closing all dialogs with ESCAPE.
164 OpenSaveDialog_Extended - to allow using custom extensions for OpenSaveDialog.
165 AUTO_CONTEXT_HELP - to use automatic respond to WM_CONTEXTMENU to call
166 context help.
167 NOT_FIX_CURINDEX - to use old version of TControl.SetItems, which could
168 lead to loose CurIndex value (e.g. for Combobox)
169 NEW_MODAL - to use extended madalness.
170 USE_SETMODALRESULT - to guarantee ModalResult property assigninig handling.
171 USE_MENU_CURCTL - to use CurCtl property in popup menu to detect which
172 control initiated a pop-up.
173 NEW_MENU_ACCELL - to use another menu accelerators handling, without
174 AcceleratorTable
175 USE_DROPDOWNCOUNT - to force setting combobox dropdown count.
176 NOT_UNLOAD_RICHEDITLIB - to stop unload Rich Edit library in finalization
177 section (to economy several byte of code).
178 DEBUG_GDIOBJECTS - to allow counting all the GDI objects used.
179 CHK_BITBLT - to check BitBlt operations.
180 DEBUG_ENDSESSION - to allow debugging WM_ENDSESSION handling.
181 DEBUG_CREATEWINDOW - to debug CreateWindow.
182 TEST_CLOSE - to debug Close.
183 DEBUG_MENU - to debug menu.
184 DEBUG_DBLBUFF - to debug DoubleBuffered.
185 DEBUG - other debugging.
186 </pre>
187 </p>
188 <h2 align="center"><font face="Arial" color="#FF8080">Content</font></h2>
189 <a name="pobj"></a>
191 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PObj</b></font> = ^ <a href=#tobj>TObj</a>;</font>
192 <br>
193 </p>
194 <a name="plist"></a>
196 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PList</b></font> = ^ <a href=#tlist>TList</a>;</font>
197 <br>
198 </p>
199 <a name="tobjectmethod"></a>
201 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TObjectMethod</b></font> = <b>procedure</b> <b>of</b> <b>object</b>;</font>
202 <br>
203 </p>
204 <a name="tonevent"></a>
206 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnEvent</b></font> = <b>procedure</b>( Sender: <a href=#pobj>PObj</a> ) <b>of</b> <b>object</b>;</font>
207 <br>
208 This type of event is the most common - event handler when called can
209 know only what object was a sender of this call. Replaces good known
210 VCL TNotifyEvent event type.
211 </p>
212 <a name="newlist"></a>
214 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewList</b></font>: <a href=#plist>PList</a>;</font>
215 <br>
216 Returns pointer to newly created <a href=#tlist>TList</a> object. Use it instead usual
217 <a href=tlist.htm#create>TList.Create</a> as it is done in VCL or XCL.
218 </p>
219 <a name="fastincnum2elements"></a>
221 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>FastIncNum2Elements</b></font>( List: <a href=#tlist>TList</a>; FromIdx, Count, Value: <b>Integer</b> );</font>
222 <br>
223 Very fast adds Value to List elements from List[FromIdx] to List[FromIdx+Count-1].
224 Given elements must exist. Count must be &gt; 0.
225 </p>
226 <a name="free_and_nil"></a>
228 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Free_And_Nil</b></font>( <b>var</b> Obj );</font>
229 <br>
230 Obj.Free and Obj := nil, where Obj *MUST* be <a href=#tobj>TObj</a> or its descendant
231 (TControl, <a href=#tmenu>TMenu</a>, etc.) This procedure is not compatible with VCL's
232 FreeAndNil, which works with TObject, since this it has another name.
233 </p>
234 <a name="newlistex"></a>
236 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewListEx</b></font>: PListEx;</font>
237 <br>
238 Creates extended list.
239 </p>
240 <a name="newtree"></a>
242 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewTree</b></font>( AParent: PTree; <b>const</b> AName: <b>String</b> ): PTree;</font>
243 <br>
244 Constructs tree node, adding it to the end of children list of
245 the AParent. If AParent is nil, new root tree node is created.
246 </p>
247 <a name="tonthreadexecute"></a>
249 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnThreadExecute</b></font> = <b>function</b>( Sender: PThread ): <b>Integer</b> <b>of</b> <b>object</b>;</font>
250 <br>
251 Event to be called when Execute method is called for <a href=#tthread>TThread</a>
252 </p>
253 <a name="newthread"></a>
255 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewThread</b></font>: PThread;</font>
256 <br>
257 Creates thread object (always suspended). After creating, set event
258 OnExecute and perform Resume operation.
259 </p>
260 <a name="newthreadex"></a>
262 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewThreadEx</b></font>( <b>const</b> Proc: <a href=#tonthreadexecute>TOnThreadExecute</a> ): PThread;</font>
263 <br>
264 Creates thread object, assigns Proc to its OnExecute event and runs
266 </p>
267 <a name="newthreadautofree"></a>
269 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewThreadAutoFree</b></font>( <b>const</b> Proc: <a href=#tonthreadexecute>TOnThreadExecute</a> ): PThread;</font>
270 <br>
271 Creates thread object similar to <a href=#newthreadex>NewThreadEx</a>, but freeing automatically
272 when executing of such thread finished. Be sure that a thread is resumed
273 at least to provide its object keeper freeing.
274 </p>
275 <a name="_newstream"></a>
277 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>_NewStream</b></font>( <b>const</b> StreamMethods: TStreamMethods ): PStream;</font>
278 <br>
279 Use this method only to define your own stream type. See also declared
280 below (in KOL.pas) methods used to implement standard KOL streams. You can use it in
281 your code to create streams, which are partially based on standard
282 methods.
283 </p>
284 <a name="newfilestream"></a>
286 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewFileStream</b></font>( <b>const</b> FileName: <b>String</b>; Options: <b>DWORD</b> ): PStream;</font>
287 <br>
288 Creates file stream for read and write. Exact set of open attributes
289 should be passed through Options parameter (see <a href=#filecreate>FileCreate</a> where those
290 flags are listed).
291 </p>
292 <a name="newreadfilestream"></a>
294 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewReadFileStream</b></font>( <b>const</b> FileName: <b>String</b> ): PStream;</font>
295 <br>
296 Creates file stream for read only.
297 </p>
298 <a name="newwritefilestream"></a>
300 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewWriteFileStream</b></font>( <b>const</b> FileName: <b>String</b> ): PStream;</font>
301 <br>
302 Creates file stream for write only. Truncating of file (if needed)
303 is provided automatically.
304 </p>
305 <a name="newreadwritefilestream"></a>
307 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewReadWriteFileStream</b></font>( <b>const</b> FileName: <b>String</b> ): PStream;</font>
308 <br>
309 Creates stream for read and write file. To truncate file, if it is
310 necessary, change Size property.
311 </p>
312 <a name="newmemorystream"></a>
314 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMemoryStream</b></font>: PStream;</font>
315 <br>
316 Creates memory stream (read and write).
317 </p>
318 <a name="newexmemorystream"></a>
320 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewExMemoryStream</b></font>( ExistingMem: <b>Pointer</b>; Size: <b>DWORD</b> ): PStream;</font>
321 <br>
322 Creates memory stream on base of existing memory. It is not possible
323 to write out of top bound given by Size (i.e. memory can not be resized,
324 or reallocated. When stream object is destroyed this memory is not freed.
325 </p>
326 <a name="stream2stream"></a>
328 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Stream2Stream</b></font>( Dst, Src: PStream; Count: <b>DWORD</b> ): <b>DWORD</b>;</font>
329 <br>
330 Copies Count (or less, if the rest of Src is not sufficiently long)
331 bytes from Src to Dst, but with optimizing in cases, when Src or/and
332 Dst are memory streams (intermediate buffer is not allocated).
333 </p>
334 <a name="stream2streamex"></a>
336 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Stream2StreamEx</b></font>( Dst, Src: PStream; Count: <b>DWORD</b> ): <b>DWORD</b>;</font>
337 <br>
338 Copies Count bytes from Src to Dst, but without any optimization.
339 Unlike <a href=#stream2stream>Stream2Stream</a> function, it can be applied to very large streams.
340 See also <a href=#stream2streamexbufsz>Stream2StreamExBufSz</a>.
341 </p>
342 <a name="stream2streamexbufsz"></a>
344 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Stream2StreamExBufSz</b></font>( Dst, Src: PStream; Count, BufSz: <b>DWORD</b> ): <b>DWORD</b>;</font>
345 <br>
346 Copies Count bytes from Src to Dst using buffer of given size, but without
347 other optimizations.
348 Unlike <a href=#stream2stream>Stream2Stream</a> function, it can be applied to very large streams
349 </p>
350 <a name="resource2stream"></a>
352 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Resource2Stream</b></font>( DestStrm: PStream; Inst: HInst; ResName: <b>PChar</b>; ResType: <b>PChar</b> ): <b>Integer</b>;</font>
353 <br>
354 Loads given resource to DestStrm. Useful for non-standard
355 resources to load it into memory (use memory stream for such
356 purpose). Use one of following resource types to pass as ResType:
357 <pre>
358 RT_ACCELERATOR Accelerator table
359 RT_ANICURSOR Animated cursor
360 RT_ANIICON Animated icon
361 RT_BITMAP Bitmap resource
362 RT_CURSOR Hardware-dependent cursor resource
363 RT_DIALOG Dialog box
364 RT_FONT Font resource
365 RT_FONTDIR Font directory resource
366 RT_GROUP_CURSOR Hardware-independent cursor resource
367 RT_GROUP_ICON Hardware-independent icon resource
368 RT_ICON Hardware-dependent icon resource
369 RT_MENU Menu resource
370 RT_MESSAGETABLE Message-table entry
371 RT_RCDATA Application-defined resource (raw data)
372 RT_STRING String-table entry
373 RT_VERSION Version resource
374 </pre>
375 <br>For example:
376 <p align=left><font face="Courier" color="008080"><b><pre>
377 <font color="800000"><b>var</b></font> MemStrm: PStream;
378 JpgObj: PJpeg;
379 ......
380 MemStrm := <a href="kol_pas.htm#newmemorystream target="_top""><font color="008080">NewMemoryStream</font></a>;
381 JpgObj := NewJpeg;
382 ......
383 Resource2Stream( MemStrm, hInstance, <font color="A08020">'MYJPEG'</font>, RT_RCDATA );
384 MemStrm.Position := 0;
385 JpgObj.LoadFromStream( MemStrm );
386 MemStrm.Free;
387 ......
388 </pre></b></font></p>
389 </p>
390 <a name="newbits"></a>
392 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewBits</b></font>: PBits;</font>
393 <br>
394 Creates variable-length bits array object.
395 </p>
396 <a name="newstrlist"></a>
398 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewStrList</b></font>: PStrList;</font>
399 <br>
400 Creates string list object.
401 </p>
402 <a name="getfilelist"></a>
404 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetFileList</b></font>( <b>const</b> dir: <b>string</b> ): PStrList;</font>
405 <br>
406 By Alexander Shakhaylo. Returns list of file names of the given directory.
407 </p>
408 <a name="newstrlistex"></a>
410 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewStrListEx</b></font>: PStrListEx;</font>
411 <br>
412 Creates extended string list object.
413 </p>
414 <a name="pwstrlist"></a>
416 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PWStrList</b></font> = ^ TWstrList;</font>
417 <br>
418 </p>
419 <a name="newwstrlist"></a>
421 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewWStrList</b></font>: <a href=#pwstrlist>PWStrList</a>;</font>
422 <br>
423 Creates new <a href=#twstrlist>TWStrList</a> object and returns a pointer to it.
424 </p>
425 <a name="newwstrlistex"></a>
427 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewWStrListEx</b></font>: PWStrListEx;</font>
428 <br>
429 Creates new <a href=#twstrlistex>TWStrListEx</a> objects and returns a pointer to it.
430 </p>
431 <a name="tgraphictooltype"></a>
433 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TGraphicToolType</b></font> =( gttBrush, gttFont, gttPen );</font>
434 <br>
435 Graphic object types, mainly for internal use.
436 </p>
437 <a name="pgraphictool"></a>
439 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PGraphicTool</b></font> = ^ <a href=#tgraphictool>TGraphicTool</a>;</font>
440 <br>
441 </p>
442 <a name="tongraphicchange"></a>
444 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnGraphicChange</b></font> = <b>procedure</b>( Sender: <a href=#pgraphictool>PGraphicTool</a> ) <b>of</b> <b>object</b>;</font>
445 <br>
446 An event mainly for internal use.
447 </p>
448 <a name="tbrushstyle"></a>
450 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TBrushStyle</b></font> =( bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross );</font>
451 <br>
452 Available brush styles.
453 </p>
454 <a name="tfontstyles"></a>
456 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontStyles</b></font> =( fsBold, fsItalic, fsUnderline, fsStrikeOut );</font>
457 <br>
458 Available font styles.
459 </p>
460 <a name="tfontstyle"></a>
462 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontStyle</b></font> = <b>set</b> <b>of</b> <a href=#tfontstyles>TFontStyles</a>;</font>
463 <br>
464 Font style is representing as a set of XFontStyles.
465 </p>
466 <a name="tfontpitch"></a>
468 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontPitch</b></font> =( fpDefault, fpFixed, fpVariable );</font>
469 <br>
470 Availabe font pitch values.
471 </p>
472 <a name="tfontname"></a>
474 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontName</b></font> = <b>type</b> <b>string</b>;</font>
475 <br>
476 Font name is represented as a string.
477 </p>
478 <a name="tfontcharset"></a>
480 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontCharset</b></font> = 0 . . 255;</font>
481 <br>
482 Font charset is represented by number from 0 to 255.
483 </p>
484 <a name="tfontquality"></a>
486 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFontQuality</b></font> =( fqDefault, fqDraft, fqProof, fqNonAntialiased, fqAntialiased );</font>
487 <br>
488 Font quality.
489 </p>
490 <a name="tpenstyle"></a>
492 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TPenStyle</b></font> =( psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame );</font>
493 <br>
494 Available pen styles. For more info see Delphi or Win32 help files.
495 </p>
496 <a name="tpenmode"></a>
498 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TPenMode</b></font> =( pmBlack, pmNotMerge, pmMaskNotPen, pmNotCopy, pmMaskPenNot, pmNot, pmXor, pmNotMask, pmMask, pmNotXor, pmNop, pmMergePenNot, pmCopy, pmMergeNotPen, pmMerge, pmWhite );</font>
499 <br>
500 Available pen modes. For more info see Delphi or Win32 help files.
501 </p>
502 <a name="tpenendcap"></a>
504 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TPenEndCap</b></font> =( pecRound, pecSquare, pecFlat );</font>
505 <br>
506 Avalable (for geometric pen) end cap styles.
507 </p>
508 <a name="tpenjoin"></a>
510 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TPenJoin</b></font> =( pjRound, pjBevel, pjMiter );</font>
511 <br>
512 Available (for geometric pen) join styles.
513 </p>
514 <a name="color2rgb"></a>
516 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Color2RGB</b></font>( Color: TColor ): TColor;</font>
517 <br>
518 Function to get RGB color from system color. Parameter can be also RGB
519 color, in that case result is just equal to a parameter.
520 </p>
521 <a name="colorsmix"></a>
523 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ColorsMix</b></font>( Color1, Color2: TColor ): TColor;</font>
524 <br>
525 Returns color, which RGB components are build as an (approximate)
526 arithmetic mean of correspondent RGB components of both source
527 colors (these both are first converted from system to RGB, and
528 result is always RGB color). Please note: this function is fast,
529 but can be not too exact.
530 </p>
531 <a name="color2rgbquad"></a>
533 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Color2RGBQuad</b></font>( Color: TColor ): TRGBQuad;</font>
534 <br>
535 Converts color to RGB, used to represent RGB values in palette entries
536 (actually swaps R and B bytes).
537 </p>
538 <a name="color2color16"></a>
540 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Color2Color16</b></font>( Color: TColor ): <b>WORD</b>;</font>
541 <br>
542 Converts Color to RGB, packed to word (as it is used in format pf16bit).
543 </p>
544 <a name="deffontcolor"></a>
546 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>DefFontColor</b></font>: TColor = clWindowText;</font>
547 <br>
548 Default font color.
549 </p>
550 <a name="globalgraphics_usefontorient"></a>
552 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>GlobalGraphics_UseFontOrient</b></font>: <b>Boolean</b>;</font>
553 <br>
554 Global flag. If stays False (default), Orientation property of Font
555 objects is ignored. This flag is set to True automatically in
556 RotateFonts add-on.
557 </p>
558 <a name="newfont"></a>
560 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewFont</b></font>: <a href=#pgraphictool>PGraphicTool</a>;</font>
561 <br>
562 Creates and returns font graphic tool object.
563 </p>
564 <a name="newbrush"></a>
566 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewBrush</b></font>: <a href=#pgraphictool>PGraphicTool</a>;</font>
567 <br>
568 Creates and returns new brush object.
569 </p>
570 <a name="newpen"></a>
572 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewPen</b></font>: <a href=#pgraphictool>PGraphicTool</a>;</font>
573 <br>
574 Creates and returns new pen object.
575 </p>
576 <a name="tfillstyle"></a>
578 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFillStyle</b></font> =( fsSurface, fsBorder );</font>
579 <br>
580 Available filling styles. For more info see Win32 or Delphi help files.
581 </p>
582 <a name="tfillmode"></a>
584 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFillMode</b></font> =( fmAlternate, fmWinding );</font>
585 <br>
586 Available filling modes. For more info see Win32 or Delphi help files.
587 </p>
588 <a name="tcopymode"></a>
590 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TCopyMode</b></font> = <b>Integer</b>;</font>
591 <br>
592 Available copying modes are following:
593 cmBlackness<br>
594 cmDstInvert<br>
595 cmMergeCopy<br>
596 cmMergePaint<br>
597 cmNotSrcCopy<br>
598 cmNotSrcErase<br>
599 cmPatCopy<br>
600 cmPatInvert<br>
601 cmPatPaint<br>
602 cmSrcAnd<br>
603 cmSrcCopy<br>
604 cmSrcErase<br>
605 cmSrcInvert<br>
606 cmSrcPaint<br>
607 cmWhiteness<br>&nbsp;&nbsp;&nbsp;
608 Also it is possible to use any other available ROP2 modes. For more info,
609 see Win32 help files.
610 </p>
611 <a name="pcanvas"></a>
613 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PCanvas</b></font> = ^ <a href=#tcanvas>TCanvas</a>;</font>
614 <br>
615 </p>
616 <a name="tongethandle"></a>
618 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnGetHandle</b></font> = <b>function</b>( Canvas: <a href=#pcanvas>PCanvas</a> ): HDC <b>of</b> <b>object</b>;</font>
619 <br>
620 For internal use mainly.
621 </p>
622 <a name="tontextarea"></a>
624 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTextArea</b></font> = <b>procedure</b>( Sender: <a href=#pcanvas>PCanvas</a>; <b>var</b> Size: TSize; <b>var</b> P0: TPoint );</font>
625 <br>
626 Event to calculate actual area, occupying by a text. It is used
627 to optionally extend calculating of TextArea taking into considaration
628 font Orientation property.
629 </p>
630 <a name="globalcanvas_ontextarea"></a>
632 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>GlobalCanvas_OnTextArea</b></font>: <a href=#tontextarea>TOnTextArea</a>;</font>
633 <br>
634 Global event to extend Canvas with possible add-ons, applied
635 when rotated fonts are used only (to take into consideration
636 Font.Orientation property in TextArea method).
637 </p>
638 <a name="newcanvas"></a>
640 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewCanvas</b></font>( DC: HDC ): <a href=#pcanvas>PCanvas</a>;</font>
641 <br>
642 Use to construct Canvas on base of memory DC.
643 </p>
644 <a name="timagelistcolors"></a>
646 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TImageListColors</b></font> =( ilcColor, ilcColor4, ilcColor8, ilcColor16, ilcColor24, ilcColor32, ilcColorDDB, ilcDefault );</font>
647 <br>
648 ImageList color schemes available.
649 </p>
650 <a name="tdrawingstyles"></a>
652 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDrawingStyles</b></font> =( dsBlend25, dsBlend50, dsMask, dsTransparent );</font>
653 <br>
654 ImageList drawing styles available.
655 </p>
656 <a name="tdrawingstyle"></a>
658 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDrawingStyle</b></font> = <b>Set</b> <b>of</b> <a href=#tdrawingstyles>TDrawingStyles</a>;</font>
659 <br>
660 Style of drawing is a combination of all available drawing styles.
661 </p>
662 <a name="timagetype"></a>
664 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TImageType</b></font> =( itBitmap, itIcon, itCursor );</font>
665 <br>
666 ImageList types available.
667 </p>
668 <a name="pimagelist"></a>
670 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PImageList</b></font> = ^ <a href=#timagelist>TImageList</a>;</font>
671 <br>
672 </p>
673 <a name="tpixelformat"></a>
675 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TPixelFormat</b></font> =( pfDevice, pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit, pf32bit, pfCustom );</font>
676 <br>
677 Available pixel formats.
678 </p>
679 <a name="tbitmaphandletype"></a>
681 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TBitmapHandleType</b></font> =( bmDIB, bmDDB );</font>
682 <br>
683 Available bitmap handle types.
684 </p>
685 <a name="newbitmap"></a>
687 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewBitmap</b></font>( W, H: <b>Integer</b> ): PBitmap;</font>
688 <br>
689 Creates bitmap object of given size. If it is possible, do not change its
690 size (Width and Heigth) later - this can economy code a bit. See <a href=#tbitmap>TBitmap</a>.
691 </p>
692 <a name="newdibbitmap"></a>
694 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewDIBBitmap</b></font>( W, H: <b>Integer</b>; PixelFormat: <a href=#tpixelformat>TPixelFormat</a> ): PBitmap;</font>
695 <br>
696 Creates DIB bitmap object of given size and pixel format. If it is possible,
697 do not change its size (Width and Heigth) later - this can economy code a bit.
698 See <a href=#tbitmap>TBitmap</a>.
699 </p>
700 <a name="calcscanlinesize"></a>
702 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CalcScanLineSize</b></font>( Header: PBitmapInfoHeader ): <b>Integer</b>;</font>
703 <br>
704 May be will be useful.
705 </p>
706 <a name="loadmappedbitmap"></a>
708 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LoadMappedBitmap</b></font>( hInst: THandle; BmpResID: <b>Integer</b>; <b>const</b> Map: <b>array</b> <b>of</b> TColor ): HBitmap;</font>
709 <br>
710 This function can be used to load bitmap and replace some it colors to
711 desired ones. This function especially useful when loaded by the such way
712 bitmap is used as toolbar bitmap - to replace some original colors to
713 system default colors. To use this function properly, the bitmap shoud
714 be prepared as 16-color bitmap, which uses only system colors. To do so,
715 create a new 16-color bitmap with needed dimensions in Borland Image Editor
716 and paste a bitmap image, copyed in another graphic tool, and then save it.
717 If this is not done, bitmap will not be loaded correctly!
718 </p>
719 <a name="loadmappedbitmapex"></a>
721 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LoadMappedBitmapEx</b></font>( MasterObj: <a href=#pobj>PObj</a>; hInst: THandle; BmpResName: <b>PChar</b>; <b>const</b> Map: <b>array</b> <b>of</b> TColor ): HBitmap;</font>
722 <br>
723 Like <a href=#loadmappedbitmap>LoadMappedBitmap</a>, but much powerful. It uses <a href=#createmappedbitmapex>CreateMappedBitmapEx</a>
724 by Alex Pravdin, so it understands any bitmap color format, including
725 pf24bit. Also, LoadMappedBitmapEx provides auto-destroying loaded resource
726 when MasterObj is destroyed.
727 </p>
728 <a name="createmappedbitmap"></a>
730 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CreateMappedBitmap</b></font>( Instance: THandle; Bitmap: <b>Integer</b>; Flags: UINT; ColorMap: PColorMap; NumMaps: <b>Integer</b> ): HBitmap; stdcall;</font>
731 <br>
732 Creates mapped bitmap replacing colors correspondently to the
733 ColorMap (each pare of colors defines color replaced and a color
734 used for replace it in the bitmap). See also <a href=#createmappedbitmapex>CreateMappedBitmapEx</a>.
735 </p>
736 <a name="createmappedbitmapex"></a>
738 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CreateMappedBitmapEx</b></font>( Instance: THandle; BmpRsrcName: <b>PChar</b>; Flags: Cardinal; ColorMap: PColorMap; NumMaps: <b>Integer</b> ): HBitmap;</font>
739 <br>
740 By Alex Pravdin.
741 Creates mapped bitmap independently from bitmap color format (works
742 correctly with bitmaps having format deeper than 8bit per pixel).
743 </p>
744 <a name="saveicons2stream"></a>
746 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SaveIcons2Stream</b></font>( <b>const</b> Icons: <b>array</b> <b>of</b> PIcon; Strm: PStream );</font>
747 <br>
748 Saves several icons (of different dimentions) to stream.
749 </p>
750 <a name="saveicons2streamex"></a>
752 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SaveIcons2StreamEx</b></font>( <b>const</b> BmpHandles: <b>array</b> <b>of</b> HBitmap; Strm: PStream ): <b>Boolean</b>;</font>
753 <br>
754 Saves icons creating it from pairs of bitmaps and their masks.
755 BmpHandles array must contain pairs of bitmap handles, each pair
756 of color bitmap and mask bitmap of the same size.
757 </p>
758 <a name="saveicons2file"></a>
760 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SaveIcons2File</b></font>( <b>const</b> Icons: <b>array</b> <b>of</b> PIcon; <b>const</b> FileName: <b>String</b> );</font>
761 <br>
762 Saves several icons (of different dimentions) to file. (Single file
763 with extension .ico can contain several different sized icon images
764 to use later one with the most appropriate size).
765 </p>
766 <a name="newicon"></a>
768 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewIcon</b></font>: PIcon;</font>
769 <br>
770 Creates new icon object, setting its Size to 32 by default. Created icon
771 is Empty.
772 </p>
773 <a name="getfileiconcount"></a>
775 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetFileIconCount</b></font>( <b>const</b> FileName: <b>String</b> ): <b>Integer</b>;</font>
776 <br>
777 Returns number of icon resources stored in given (executable) file.
778 </p>
779 <a name="loadimgicon"></a>
781 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LoadImgIcon</b></font>( RsrcName: <b>PChar</b>; Size: <b>Integer</b> ): HIcon;</font>
782 <br>
783 Loads icon of specified size from the resource.
784 </p>
785 <a name="newmetafile"></a>
787 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMetafile</b></font>: PMetafile;</font>
788 <br>
789 Creates metafile object.
790 </p>
791 <a name="id_self"></a>
793 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ID_SELF</b></font>: array[ 0 . . 5 ] <b>of</b> <b>Char</b> =( 'S', 'E', 'L', 'F', '_', #0 );</font>
794 <br>
795 Identifier for window property &quot;Self&quot;, stored directly in window, when
796 it is created. This property is used to [fast] find TControl object,
797 correspondent to given window handle (using API call GetProp).
798 </p>
799 <a name="id_prevproc"></a>
801 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ID_PREVPROC</b></font>: array[ 0 . . 9 ] <b>of</b> <b>Char</b> =( 'P', 'R', 'E', 'V', '_', 'P', 'R', 'O', 'C', #0 );</font>
802 <br>
803 </p>
804 <a name="pcontrol"></a>
806 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PControl</b></font> = ^ TControl;</font>
807 <br>
808 Type of pointer to TControl visual object. All
809 <a href="kol_pas.htm#visual_objects_constructors">
810 constructing functions
811 </a>
812 New[ControlName] are returning
813 pointer of this type. Do not forget about some difference
814 of using objects from using classes. Identifier Self for
815 methods of object is not of pointer type, and to pass
816 pointer to Self, it is necessary to pass @Self instead.
817 At the same time, to use pointer to object in 'WITH' operator,
818 it is necessary to apply suffix '^' to pointer to get know
819 to compiler, what do You want.
820 </p>
821 <a name="twindowfunc"></a>
823 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWindowFunc</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; <b>var</b> Msg: TMsg; <b>var</b> Rslt: <b>Integer</b> ): <b>Boolean</b>;</font>
824 <br>
825 Event type to define custom extended message handlers (as pointers to
826 procedure entry points). Such handlers are usually defined like add-ons,
827 extending behaviour of certain controls and attached using AttachProc
828 method of TControl. If the handler detects, that it is necessary to stop
829 further message processing, it should return True.
830 </p>
831 <a name="tmousebutton"></a>
833 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMouseButton</b></font> =( mbNone, mbLeft, mbRight, mbMiddle );</font>
834 <br>
835 Available mouse buttons. mbNone is useful to get know, that
836 there were no mouse buttons pressed.
837 </p>
838 <a name="tmouseeventdata"></a>
840 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMouseEventData</b></font> = <b>packed</b> <b>Record</b></font>
841 <br>
842 Record to pass it to mouse handling routines, assigned to OnMouseXXXX
843 events.
844 <table border="0" cellpadding="0" cellspacing="0" width="100%">
845 <tr>
846 <td width="32">&nbsp;</td>
847 <td valign="top">
848 <font face="Courier" color="#800080">Button: <a href=#tmousebutton>TMouseButton</a>;</font>
849 </td>
850 <td valign="top">
851 </td>
852 </tr>
853 <tr>
854 <td width="32">&nbsp;</td>
855 <td valign="top">
856 <font face="Courier" color="#800080">StopHandling: <b>Boolean</b>;</font>
857 </td>
858 <td valign="top">
859 Set it to True in OnMouseXXXX event handler to
860 </td>
861 </tr>
862 <tr>
863 <td width="32">&nbsp;</td>
864 <td valign="top">
865 <font face="Courier" color="#800080">R1, R2: <b>Byte</b>;</font>
866 </td>
867 <td valign="top">
868 Not used
869 </td>
870 </tr>
871 <tr>
872 <td width="32">&nbsp;</td>
873 <td valign="top">
874 <font face="Courier" color="#800080">Shift : <b>DWORD</b>;</font>
875 </td>
876 <td valign="top">
877 HiWord( Shift ) = zDelta in WM_MOUSEWHEEL
878 </td>
879 </tr>
880 <tr>
881 <td width="32">&nbsp;</td>
882 <td valign="top">
883 <font face="Courier" color="#800080">X, Y : SmallInt;</font>
884 </td>
885 <td valign="top">
886 </td>
887 </tr>
888 </table>
889 <font face="Courier" color="#800080"><b>end</b>;</font>
890 </p>
891 <a name="tonmouse"></a>
893 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnMouse</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; <b>var</b> Mouse: <a href=#tmouseeventdata>TMouseEventData</a> ) <b>of</b> <b>object</b>;</font>
894 <br>
895 Common mouse handling event type.
896 </p>
897 <a name="tonkey"></a>
899 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnKey</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; <b>var</b> Key: Longint; Shift: <b>DWORD</b> ) <b>of</b> <b>object</b>;</font>
900 <br>
901 Key events. Shift is a combination of flags MK_SHIFT, MK_CONTROL, MK_ALT.
902 (See GetShiftState funtion).
903 </p>
904 <a name="tonchar"></a>
906 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnChar</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; <b>var</b> Key: <b>Char</b>; Shift: <b>DWORD</b> ) <b>of</b> <b>object</b>;</font>
907 <br>
908 Char event. Shift is a combination of flags MK_SHIFT, MK_CONTROL, MK_ALT.
909 </p>
910 <a name="ttabkey"></a>
912 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTabKey</b></font> =( tkTab, tkLeftRight, tkUpDown, tkPageUpPageDn );</font>
913 <br>
914 Available tabulating key groups.
915 </p>
916 <a name="ttabkeys"></a>
918 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTabKeys</b></font> = <b>Set</b> <b>of</b> <a href=#ttabkey>TTabKey</a>;</font>
919 <br>
920 Set of tabulating key groups, allowed to be used in with a control
921 (are installed by TControl.LookTabKey property).
922 </p>
923 <a name="tonmessage"></a>
925 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnMessage</b></font> = <b>function</b>( <b>var</b> Msg: TMsg; <b>var</b> Rslt: <b>Integer</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
926 <br>
927 Event type for events, which allows to extend behaviour of windowed controls
928 descendants using add-ons.
929 </p>
930 <a name="toneventaccept"></a>
932 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnEventAccept</b></font> = <b>procedure</b>( Sender: <a href=#pobj>PObj</a>; <b>var</b> Accept: <b>Boolean</b> ) <b>of</b> <b>object</b>;</font>
933 <br>
934 Event type for OnClose event.
935 </p>
936 <a name="tclosequeryreason"></a>
938 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TCloseQueryReason</b></font> =( qClose, qShutdown, qLogoff );</font>
939 <br>
940 Request reason type to call OnClose and OnQueryEndSession.
941 </p>
942 <a name="twindowstate"></a>
944 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWindowState</b></font> =( wsNormal, wsMinimized, wsMaximized );</font>
945 <br>
946 Avalable states of TControl's window object.
947 </p>
948 <a name="tonsplit"></a>
950 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnSplit</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; NewSize1, NewSize2: <b>Integer</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
951 <br>
952 Event type for OnSplit event handler, designed specially for splitter
953 control. Event handler must return True to accept new size of previous
954 (to splitter) control and new size of the rest of client area of parent.
955 </p>
956 <a name="tontvbegindrag"></a>
958 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVBeginDrag</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle ) <b>of</b> <b>object</b>;</font>
959 <br>
960 Event type for OnTVBeginDrag event (defined for tree view control).
961 </p>
962 <a name="tontvbeginedit"></a>
964 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVBeginEdit</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
965 <br>
966 Event type for OnTVBeginEdit event (for tree view control).
967 </p>
968 <a name="tontvendedit"></a>
970 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVEndEdit</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle; <b>const</b> NewTxt: <b>String</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
971 <br>
972 Event type for TOnTVEndEdit event.
973 </p>
974 <a name="tontvexpanding"></a>
976 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVExpanding</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle; Expand: <b>Boolean</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
977 <br>
978 Event type for TOnTVExpanding event.
979 </p>
980 <a name="tontvexpanded"></a>
982 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVExpanded</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle; Expand: <b>Boolean</b> ) <b>of</b> <b>object</b>;</font>
983 <br>
984 Event type for OnTVExpanded event.
985 </p>
986 <a name="tontvdelete"></a>
988 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVDelete</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Item: THandle ) <b>of</b> <b>object</b>;</font>
989 <br>
990 Event type for OnTVDelete event.
991 </p>
992 <a name="tontvselchanging"></a>
994 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTVSelChanging</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; oldItem, newItem: THandle ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
995 <br>
996 When the handler returns False, selection is not changed.
997 </p>
998 <a name="tondrag"></a>
1000 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnDrag</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; ScrX, ScrY: <b>Integer</b>; <b>var</b> CursorShape: <b>Integer</b>; <b>var</b> Stop: <b>Boolean</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
1001 <br>
1002 Event, called during dragging operation (it is initiated
1003 with method Drag, where callback function of type TOnDrag is
1004 passed as a parameter). Callback function receives Stop parameter True,
1005 when operation is finishing. Otherwise, it can set it to True to force
1006 finishing the operation (in such case, returning False means cancelling
1007 drag operation, True - successful drag and in this last case callback is
1008 no more called). During the operation, when input Stop value is False,
1009 callback function can control Cursor shape, and return True, if the operation
1010 can be finished successfully at the given ScrX, ScrY position.
1011 ScrX, ScrY are screen coordinates of the mouse cursor.
1012 </p>
1013 <a name="tcreateparams"></a>
1015 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TCreateParams</b></font> = <b>packed</b> <b>record</b></font>
1016 <br>
1017 Record to pass it through CreateSubClass method.
1018 <table border="0" cellpadding="0" cellspacing="0" width="100%">
1019 <tr>
1020 <td width="32">&nbsp;</td>
1021 <td valign="top">
1022 <font face="Courier" color="#800080">Caption: <b>PChar</b>;</font>
1023 </td>
1024 <td valign="top">
1025 </td>
1026 </tr>
1027 <tr>
1028 <td width="32">&nbsp;</td>
1029 <td valign="top">
1030 <font face="Courier" color="#800080">Style: cardinal;</font>
1031 </td>
1032 <td valign="top">
1033 </td>
1034 </tr>
1035 <tr>
1036 <td width="32">&nbsp;</td>
1037 <td valign="top">
1038 <font face="Courier" color="#800080">ExStyle: cardinal;</font>
1039 </td>
1040 <td valign="top">
1041 </td>
1042 </tr>
1043 <tr>
1044 <td width="32">&nbsp;</td>
1045 <td valign="top">
1046 <font face="Courier" color="#800080">X, Y: <b>Integer</b>;</font>
1047 </td>
1048 <td valign="top">
1049 </td>
1050 </tr>
1051 <tr>
1052 <td width="32">&nbsp;</td>
1053 <td valign="top">
1054 <font face="Courier" color="#800080">Width, Height: <b>Integer</b>;</font>
1055 </td>
1056 <td valign="top">
1057 </td>
1058 </tr>
1059 <tr>
1060 <td width="32">&nbsp;</td>
1061 <td valign="top">
1062 <font face="Courier" color="#800080">WndParent: HWnd;</font>
1063 </td>
1064 <td valign="top">
1065 </td>
1066 </tr>
1067 <tr>
1068 <td width="32">&nbsp;</td>
1069 <td valign="top">
1070 <font face="Courier" color="#800080">Param: <b>Pointer</b>;</font>
1071 </td>
1072 <td valign="top">
1073 </td>
1074 </tr>
1075 <tr>
1076 <td width="32">&nbsp;</td>
1077 <td valign="top">
1078 <font face="Courier" color="#800080">WindowClass: TWndClass;</font>
1079 </td>
1080 <td valign="top">
1081 </td>
1082 </tr>
1083 <tr>
1084 <td width="32">&nbsp;</td>
1085 <td valign="top">
1086 <font face="Courier" color="#800080">WinClassName: array[0.array.63] <b>of</b> <b>Char</b>;</font>
1087 </td>
1088 <td valign="top">
1089 </td>
1090 </tr>
1091 </table>
1092 <font face="Courier" color="#800080"><b>end</b>;</font>
1093 </p>
1094 <a name="ttextalign"></a>
1096 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTextAlign</b></font> =( taLeft, taRight, taCenter );</font>
1097 <br>
1098 Text alignments available.
1099 </p>
1100 <a name="trichtextalign"></a>
1102 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichTextAlign</b></font> =( raLeft, raRight, raCenter, raJustify, raInterLetter, raScaled, raGlyphs, raSnapGrid );</font>
1103 <br>
1104 Text alignment styles, available for RichEdit control.
1105 </p>
1106 <a name="tverticalalign"></a>
1108 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TVerticalAlign</b></font> =( vaCenter, vaTop, vaBottom );</font>
1109 <br>
1110 Vertical alignments available.
1111 </p>
1112 <a name="tcontrolalign"></a>
1114 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TControlAlign</b></font> =( caNone, caLeft, caTop, caRight, caBottom, caClient );</font>
1115 <br>
1116 Control alignments available.
1117 </p>
1118 <a name="tbitbtnoption"></a>
1120 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TBitBtnOption</b></font> =( bboImageList, bboNoBorder, bboNoCaption, bboFixed );</font>
1121 <br>
1122 Options available for <a href=#newbitbtn>NewBitBtn</a>.
1123 </p>
1124 <a name="tbitbtnoptions"></a>
1126 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TBitBtnOptions</b></font> = <b>set</b> <b>of</b> <a href=#tbitbtnoption>TBitBtnOption</a>;</font>
1127 <br>
1128 Set of options, available for <a href=#newbitbtn>NewBitBtn</a>.
1129 </p>
1130 <a name="tglyphlayout"></a>
1132 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TGlyphLayout</b></font> =( glyphLeft, glyphTop, glyphRight, glyphBottom, glyphOver );</font>
1133 <br>
1134 Layout of glyph (for <a href=#newbitbtn>NewBitBtn</a>). Layout glyphOver means that text is
1135 drawn over glyph.
1136 </p>
1137 <a name="tonbitbtndraw"></a>
1139 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnBitBtnDraw</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; BtnState: <b>Integer</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
1140 <br>
1141 Event type for TControl.OnBitBtnDraw event (which is called just before
1142 drawing the BitBtn). If handler returns True, there are no drawing occure.
1143 BtnState, passed to a handler, determines current button state and can
1144 be following: 0 - not pressed, 1 - pressed, 2 - disabled, 3 - focused.
1145 Value 4 is reserved for highlight state (then mouse is over it), but
1146 highlighting is provided only if property Flat is set to True (or one
1147 of events OnMouseEnter / OnMouseLeave is assigned to something).
1148 </p>
1149 <a name="tlistviewstyle"></a>
1151 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TListViewStyle</b></font> =( lvsIcon, lvsSmallIcon, lvsList, lvsDetail, lvsDetailNoHeader );</font>
1152 <br>
1153 Styles of view for ListView control (see NewListVew).
1154 </p>
1155 <a name="toneditlvitem"></a>
1157 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnEditLVItem</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; Idx, Col: <b>Integer</b>; NewText: <b>PChar</b> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
1158 <br>
1159 Event type for OnEndEditLVItem. Return True in handler to accept new text value.
1160 </p>
1161 <a name="tondeletelvitem"></a>
1163 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnDeleteLVItem</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Idx: <b>Integer</b> ) <b>of</b> <b>object</b>;</font>
1164 <br>
1165 Event type for OnDeleteLVItem event.
1166 </p>
1167 <a name="tonlvdata"></a>
1169 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVData</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Idx, SubItem: <b>Integer</b>; <b>var</b> Txt: <b>String</b>; <b>var</b> ImgIdx: <b>Integer</b>; <b>var</b> State: <b>DWORD</b>; <b>var</b> Store: <b>Boolean</b> ) <b>of</b> <b>object</b>;</font>
1170 <br>
1171 Event type for OnLVData event. Used to provide virtual list view control
1172 (i.e. having lvoOwnerData style) with actual data on request. Use parameter
1173 Store as a flag if control should store obtained data by itself or not.
1174 </p>
1175 <a name="tonlvdataw"></a>
1177 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVDataW</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Idx, SubItem: <b>Integer</b>; <b>var</b> Txt: WideString; <b>var</b> ImgIdx: <b>Integer</b>; <b>var</b> State: <b>DWORD</b>; <b>var</b> Store: <b>Boolean</b> ) <b>of</b> <b>object</b>;</font>
1178 <br>
1179 Event type for OnLVDataW event (the same as OnLVData, but for unicode verion
1180 of the control OnLVDataW allows to return WideString text in the event
1181 handler). Used to provide virtual list view control
1182 (i.e. having lvoOwnerData style) with actual data on request. Use parameter
1183 Store as a flag if control should store obtained data by itself or not.
1184 </p>
1185 <a name="toncomparelvitems"></a>
1187 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnCompareLVItems</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; Idx1, Idx2: <b>Integer</b> ): <b>Integer</b> <b>of</b> <b>object</b>;</font>
1188 <br>
1189 Event type to compare two items of the list view (while sorting it).
1190 </p>
1191 <a name="tonlvcolumnclick"></a>
1193 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVColumnClick</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Idx: <b>Integer</b> ) <b>of</b> <b>object</b>;</font>
1194 <br>
1195 Event type for OnColumnClick event.
1196 </p>
1197 <a name="tonlvstatechange"></a>
1199 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVStateChange</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; IdxFrom, IdxTo: <b>Integer</b>; OldState, NewState: <b>DWORD</b> ) <b>of</b> <b>object</b>;</font>
1200 <br>
1201 Event type for OnLVStateChange event, called in responce to select/unselect
1202 a single item or items range in list view control).
1203 </p>
1204 <a name="tonlvdelete"></a>
1206 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVDelete</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; Idx: <b>Integer</b> ) <b>of</b> <b>object</b>;</font>
1207 <br>
1208 Event type for OnLVDelete event, called when an item is been deleting.
1209 </p>
1210 <a name="tdrawstates"></a>
1212 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDrawStates</b></font> =( odsSelected, odsGrayed, odsDisabled, odsChecked, odsFocused, odsDefault, odsHotlist, odsInactive, odsNoAccel, odsNoFocusRect, ods400reserved, ods800reserved, odsComboboxEdit, odsMarked, odsIndeterminate );</font>
1213 <br>
1214 Possible draw states.
1215 <br>odsSelected - The menu item's status is selected.
1216 <br>odsGrayed - The item is to be grayed. This bit is used only in a menu.
1217 <br>odsDisabled - The item is to be drawn as disabled.
1218 <br>odsChecked - The menu item is to be checked. This bit is used only in
1219 a menu.
1220 <br>odsFocused - The item has the keyboard focus.
1221 <br>odsDefault - The item is the default item.
1222 <br>odsHotList - <b>Windows 98, Windows 2000:</b> The item is being
1223 hot-tracked, that is, the item will be highlighted when
1224 the mouse is on the item.
1225 <br>odsInactive - <b>Windows 98, Windows 2000:</b> The item is inactive
1226 and the window associated with the menu is inactive.
1227 <br>odsNoAccel - <b>Windows 2000:</b> The control is drawn without the
1228 keyboard accelerator cues.
1229 <br>odsNoFocusRect - <b>Windows 2000:</b> The control is drawn without
1230 focus indicator cues.
1231 <br>odsComboboxEdit - The drawing takes place in the selection field
1232 (edit control) of an owner-drawn combo box.
1233 <br>odsMarked - for Common controls only. The item is marked. The meaning
1234 of this is up to the implementation.
1235 <br>odsIndeterminate - for Common Controls only. The item is in an
1236 indeterminate state.
1237 </p>
1238 <a name="tdrawstate"></a>
1240 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDrawState</b></font> = <b>Set</b> <b>of</b> <a href=#tdrawstates>TDrawStates</a>;</font>
1241 <br>
1242 Set of possible draw states.
1243 </p>
1244 <a name="tondrawitem"></a>
1246 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnDrawItem</b></font> = <b>function</b>( Sender: <a href=#pobj>PObj</a>; DC: HDC; <b>const</b> Rect: TRect; ItemIdx: <b>Integer</b>; DrawAction: TDrawAction; ItemState: <a href=#tdrawstate>TDrawState</a> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
1247 <br>
1248 Event type for OnDrawItem event (applied to list box, combo box, list view).
1249 </p>
1250 <a name="tonmeasureitem"></a>
1252 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnMeasureItem</b></font> = <b>function</b>( Sender: <a href=#pobj>PObj</a>; Idx: <b>Integer</b> ): <b>Integer</b> <b>of</b> <b>object</b>;</font>
1253 <br>
1254 Event type for OnMeasureItem event. The event handler must return height of list box
1255 item as a result.
1256 </p>
1257 <a name="tgetlvitempart"></a>
1259 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TGetLVItemPart</b></font> =( lvipBounds, lvipIcon, lvipLabel, lvupIconAndLabel );</font>
1260 <br>
1261 </p>
1262 <a name="twhereposlvitem"></a>
1264 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWherePosLVItem</b></font> =( lvwpOnIcon, lvwpOnLabel, lvwpOnStateIcon, lvwpOnColumn, lvwpOnItem );</font>
1265 <br>
1266 </p>
1267 <a name="tonlvcustomdraw"></a>
1269 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnLVCustomDraw</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a>; DC: HDC; Stage: <b>DWORD</b>; ItemIdx, SubItemIdx: <b>Integer</b>; <b>const</b> Rect: TRect; ItemState: <a href=#tdrawstate>TDrawState</a>; <b>var</b> TextColor, BackColor: TColor ): <b>DWORD</b> <b>of</b> <b>object</b>;</font>
1270 <br>
1271 Event type for OnLVCustomDraw event.
1272 </p>
1273 <a name="tgradientstyle"></a>
1275 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TGradientStyle</b></font> =( gsVertical, gsHorizontal, gsRectangle, gsElliptic, gsRombic );</font>
1276 <br>
1277 Gradient fill styles. See also <a href=#tgradientlayout>TGradientLayout</a>.
1278 </p>
1279 <a name="tgradientlayout"></a>
1281 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TGradientLayout</b></font> =( glTopLeft, glTop, glTopRight, glLeft, glCenter, glRight, glBottomLeft, glBottom, glBottomRight );</font>
1282 <br>
1283 Position of starting line / point for gradient filling. Depending on
1284 <a href=#tgradientstyle>TGradientStyle</a>, means either position of first line of first rectangle
1285 (ellipse) to be expanded in a loop to fit entire gradient panel area.
1286 </p>
1287 <a name="teditoption"></a>
1289 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TEditOption</b></font> =( eoNoHScroll, eoNoVScroll, eoLowercase, eoMultiline, eoNoHideSel, eoOemConvert, eoPassword, eoReadonly, eoUpperCase, eoWantReturn, eoWantTab, eoNumber );</font>
1290 <br>
1291 Available edit options.
1292 <br> Please note, that eoWantTab option just removes TAB key from a list
1293 of keys available to tabulate from the edit control. To provide insertion
1294 of tabulating key, do so in TControl.OnChar event handler. Sorry for
1295 inconvenience, but this is because such behaviour is not must in all cases.
1296 See also TControl.EditTabChar property.
1297 </p>
1298 <a name="teditoptions"></a>
1300 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TEditOptions</b></font> = <b>Set</b> <b>of</b> <a href=#teditoption>TEditOption</a>;</font>
1301 <br>
1302 Set of available edit options.
1303 </p>
1304 <a name="trichfmtarea"></a>
1306 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichFmtArea</b></font> =( raSelection, raWord, raAll );</font>
1307 <br>
1308 Characters formatting area for RichEdit.
1309 </p>
1310 <a name="tretextformat"></a>
1312 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRETextFormat</b></font> =( reRTF, reText, rePlainRTF, reRTFNoObjs, rePlainRTFNoObjs, reTextized );</font>
1313 <br>
1314 Available formats for transfer RichEdit text using property
1315 TControl.RE_Text.
1316 <pre>
1317 reRTF - normal rich text (no transformations)
1318 reText - plain text only (without OLE objects)
1319 reTextized - plain text with text representation of OLE objects
1320 rePlainRTF - reRTF without language-specific keywords
1321 reRTFNoObjs - reRTF without OLE objects
1322 rePlainRTFNoObjs - rePlainRTF without OLE objects
1323 </pre>
1324 </p>
1325 <a name="trichunderline"></a>
1327 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichUnderline</b></font> =( ruSingle, ruWord, ruDouble, ruDotted, ruDash, ruDashDot, ruDashDotDot, ruWave, ruThick, ruHairLine );</font>
1328 <br>
1329 Rich text exteded underline styles (available only for RichEdit v2.0,
1330 and even for RichEdit v2.0 additional styles can not displayed - but
1331 ruDotted under Windows2000 is working).
1332 </p>
1333 <a name="trichtextsizes"></a>
1335 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichTextSizes</b></font> =( rtsNoUseCRLF, rtsNoPrecise, rtsClose, rtsBytes );</font>
1336 <br>
1337 Options to calculate size of rich text. Available only for RichEdit2.0
1338 or higher.
1339 </p>
1340 <a name="trichtextsize"></a>
1342 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichTextSize</b></font> = <b>set</b> <b>of</b> <a href=#trichtextsizes>TRichTextSizes</a>;</font>
1343 <br>
1344 Set of all available optioins to calculate rich text size using
1345 property TControl.RE_TextSize[ options ].
1346 </p>
1347 <a name="trichnumbering"></a>
1349 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichNumbering</b></font> =( rnNone, rnBullets, rnArabic, rnLLetter, rnULetter, rnLRoman, rnURoman );</font>
1350 <br>
1351 Advanced numbering styles for paragraph (RichEdit).
1352 <pre>
1353 rnNone - no numbering
1354 rnBullets - bullets only
1355 rnArabic - 1, 2, 3, 4, ...
1356 rnLLetter - a, b, c, d, ...
1357 rnULetter - A, B, C, D, ...
1358 rnLRoman - i, ii, iii, iv, ...
1359 rnURoman - I, II, III, IV, ...
1360 rnNoNumber - do not show any numbers (but numbering is taking place).
1361 </pre>
1362 </p>
1363 <a name="trichnumbrackets"></a>
1365 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TRichNumBrackets</b></font> =( rnbRight, rnbBoth, rnbPeriod, rnbPlain, rnbNoNumber );</font>
1366 <br>
1367 Brackets around number:
1368 <pre>
1369 rnbRight - 1) 2) 3) - this is default !
1370 rnbBoth - (1) (2) (3)
1371 rnbPeriod - 1. 2. 3.
1372 rnbPlain - 1 2 3
1373 </pre>
1374 </p>
1375 <a name="tborderedge"></a>
1377 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TBorderEdge</b></font> =( beLeft, beTop, beRight, beBottom );</font>
1378 <br>
1379 Borders of rectangle.
1380 </p>
1381 <a name="tontestmouseover"></a>
1383 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTestMouseOver</b></font> = <b>function</b>( Sender: <a href=#pcontrol>PControl</a> ): <b>Boolean</b> <b>of</b> <b>object</b>;</font>
1384 <br>
1385 Event type for TControl.OnTestMouseOver event. The handler should
1386 return True, if it dectects, that mouse is over control.
1387 </p>
1388 <a name="tedgestyle"></a>
1390 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TEdgeStyle</b></font> =( esRaised, esLowered, esNone );</font>
1391 <br>
1392 Edge styles (for panel - see <a href=#newpanel>NewPanel</a>).
1393 </p>
1394 <a name="tlistoption"></a>
1396 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TListOption</b></font> =( loNoHideScroll, loNoExtendSel, loMultiColumn, loMultiSelect, loNoIntegralHeight, loNoSel, loSort, loTabstops, loNoStrings, loNoData, loOwnerDrawFixed, loOwnerDrawVariable );</font>
1397 <br>
1398 Options for ListBox (see <a href=#newlistbox>NewListbox</a>).
1399 </p>
1400 <a name="tlistoptions"></a>
1402 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TListOptions</b></font> = <b>Set</b> <b>of</b> <a href=#tlistoption>TListOption</a>;</font>
1403 <br>
1404 Set of available options for Listbox.
1405 </p>
1406 <a name="tcombooption"></a>
1408 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TComboOption</b></font> =( coReadOnly, coNoHScroll, coAlwaysVScroll, coLowerCase, coNoIntegralHeight, coOemConvert, coSort, coUpperCase, coOwnerDrawFixed, coOwnerDrawVariable, coSimple );</font>
1409 <br>
1410 Options for combobox.
1411 </p>
1412 <a name="tcombooptions"></a>
1414 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TComboOptions</b></font> = <b>Set</b> <b>of</b> <a href=#tcombooption>TComboOption</a>;</font>
1415 <br>
1416 Set of options available for combobox.
1417 </p>
1418 <a name="tprogressbaroption"></a>
1420 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TProgressbarOption</b></font> =( pboVertical, pboSmooth );</font>
1421 <br>
1422 Options for progress bar.
1423 </p>
1424 <a name="tprogressbaroptions"></a>
1426 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TProgressbarOptions</b></font> = <b>set</b> <b>of</b> <a href=#tprogressbaroption>TProgressbarOption</a>;</font>
1427 <br>
1428 Set of options available for progress bar.
1429 </p>
1430 <a name="ttreeviewoption"></a>
1432 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTreeViewOption</b></font> =( tvoNoLines, tvoLinesRoot, tvoNoButtons, tvoEditLabels, tvoHideSel, tvoDragDrop, tvoNoTooltips, tvoCheckBoxes, tvoTrackSelect, tvoSingleExpand, tvoInfoTip, tvoFullRowSelect, tvoNoScroll, tvoNonEvenHeight );</font>
1433 <br>
1434 Tree view options.
1435 </p>
1436 <a name="ttreeviewoptions"></a>
1438 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTreeViewOptions</b></font> = <b>set</b> <b>of</b> <a href=#ttreeviewoption>TTreeViewOption</a>;</font>
1439 <br>
1440 Set of tree view options.
1441 </p>
1442 <a name="ttabcontroloption"></a>
1444 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTabControlOption</b></font> =( tcoButtons, tcoFixedWidth, tcoFocusTabs, tcoIconLeft, tcoLabelLeft, tcoMultiline, tcoMultiselect, tcoFitRows, tcoScrollOpposite, tcoBottom, tcoVertical, tcoFlat, tcoHotTrack, tcoBorder, tcoOwnerDrawFixed );</font>
1445 <br>
1446 Options, available for TabControl.
1447 </p>
1448 <a name="ttabcontroloptions"></a>
1450 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTabControlOptions</b></font> = <b>set</b> <b>of</b> <a href=#ttabcontroloption>TTabControlOption</a>;</font>
1451 <br>
1452 Set of options, available for TAbControl during its creation (by
1453 <a href=#newtabcontrol>NewTabControl</a> function).
1454 </p>
1455 <a name="ttoolbaroption"></a>
1457 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TToolbarOption</b></font> =( tboTextRight, tboTextBottom, tboFlat, tboTransparent, tboWrapable, tboNoDivider, tbo3DBorder );</font>
1458 <br>
1459 Toolbar options. When tboFlat is set and toolbar is placed onto panel,
1460 set its property Transparent to TRUE to provide its correct view.
1461 </p>
1462 <a name="ttoolbaroptions"></a>
1464 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TToolbarOptions</b></font> = <b>Set</b> <b>of</b> <a href=#ttoolbaroption>TToolbarOption</a>;</font>
1465 <br>
1466 Set of toolbar options.
1467 </p>
1468 <a name="tontoolbarbuttonclick"></a>
1470 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnToolbarButtonClick</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; BtnID: <b>Integer</b> ) <b>of</b> <b>object</b>;</font>
1471 <br>
1472 Special event type to handle separate toolbar buttons click events.
1473 </p>
1474 <a name="tdatetimepickeroption"></a>
1476 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDateTimePickerOption</b></font> =( dtpoTime, dtpoDateLong, dtpoUpDown, dtpoRightAlign, dtpoShowNone, dtpoParseInput );</font>
1477 <br>
1478 </p>
1479 <a name="tdatetimepickeroptions"></a>
1481 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDateTimePickerOptions</b></font> = <b>set</b> <b>of</b> <a href=#tdatetimepickeroption>TDateTimePickerOption</a>;</font>
1482 <br>
1483 </p>
1484 <a name="tdtparseinputevent"></a>
1486 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDTParseInputEvent</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; <b>const</b> UserString: <b>string</b>; <b>var</b> DateAndTime: TDateTime; <b>var</b> AllowChange: <b>Boolean</b> ) <b>of</b> <b>object</b>;</font>
1487 <br>
1488 </p>
1489 <a name="tdatetimerange"></a>
1491 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDateTimeRange</b></font> = array[ 0 . . 1 ] <b>of</b> TDateTime;</font>
1492 <br>
1493 </p>
1494 <a name="tondropfiles"></a>
1496 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnDropFiles</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; <b>const</b> FileList: <b>String</b>; <b>const</b> Pt: TPoint ) <b>of</b> <b>object</b>;</font>
1497 <br>
1498 An event type for OnDropFiles event. When the event is occur, FileList
1499 parameter contains a list of files dropped. File names in a list are
1500 separated with #13 character. This allows You to assign it to <a href=#tstrlist>TStrList</a>
1501 object using its property Text (for example):
1502 <p align=left><font face="Courier" color="008080"><b><pre>
1503 <font color="800000"><b>procedure</b></font> TSomeObject.DropFiles( Sender: <a href="kol_pas.htm#pcontrol target="_top""><font color="008080">PControl</font></a>; <font color="800000"><b>const</b></font> FileList: <font color="800000"><b>String</b></font>;
1504 <font color="800000"><b>const</b></font> Pt: TPoint ); )
1505 <font color="800000"><b>var</b></font> FList: PStrList;
1506 I: <font color="800000"><b>Integer</b></font>;
1507 <font color="800000"><b>begin</b></font>
1508 FList := <a href="kol_pas.htm#newstrlist target="_top""><font color="008080">NewStrList</font></a>;
1509 FList.Text := FileList;
1510 <font color="800000"><b>for</b></font> I := 0 <font color="800000"><b>to</b></font> FList.Count-1 <font color="800000"><b>do</b></font>
1511 <font color="800000"><b>begin</b></font>
1512 </b><font color="40A040"><em>// do something with FList.Items[ I ]</em></font><b>
1513 <font color="800000"><b>end</b></font>;
1514 FList.Free;
1515 <font color="800000"><b>end</b></font>;
1516 </pre></b></font></p>
1517 </p>
1518 <a name="tonpaintbkgnd"></a>
1520 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnPaintBkgnd</b></font> = <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; DC: HDC; Rect: PRect );</font>
1521 <br>
1522 Global event definition. Used to define Global_OnPaintBackground
1523 event placeholder.
1524 </p>
1525 <a name="global_onpaintbkgnd"></a>
1527 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_OnPaintBkgnd</b></font>: <a href=#tonpaintbkgnd>TOnPaintBkgnd</a> = DefaultPaintBackground;</font>
1528 <br>
1529 Global event. It is assigned in XBackgounds.pas add-on to replace
1530 PaintBackground method for all TVisual objects, allowing great
1531 visualization effect: transparent controls over [animated] bitmap
1532 background. Idea:
1533 <a href=mailto:"bw@sunv.com">Wei&nbsp;Bao</a>. Implementation:
1534 <a href=mailto:"bonanzas@xcl.cjb.net">Kladov&nbsp;Vladimir</a>.
1535 </p>
1536 <a name="global_invalidate"></a>
1538 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_Invalidate</b></font>: <b>procedure</b>( Sender: <a href=#pobj>PObj</a> ) = DummyObjProc;</font>
1539 <br>
1540 Is called in TControl.Invalidate to extend it in case when DoubleBuffered
1541 painting used.
1542 </p>
1543 <a name="global_onbeginpaint"></a>
1545 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_OnBeginPaint</b></font>: <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; DC: HDC ) = DummyPaintProc;</font>
1546 <br>
1547 Is called before painting a window.
1548 </p>
1549 <a name="global_onendpaint"></a>
1551 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_OnEndPaint</b></font>: <b>procedure</b>( Sender: <a href=#pcontrol>PControl</a>; DC: HDC ) = DummyPaintProc;</font>
1552 <br>
1553 Is called after painting a window.
1554 </p>
1555 <a name="helpfilepath"></a>
1557 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>HelpFilePath</b></font>: <b>PChar</b>;</font>
1558 <br>
1559 Path to application help file. If not assigned, application path with
1560 extension replaced to '.hlp' used. To use '.chm' file (HtmlHelp),
1561 call AssignHtmlHelp with a path to a html help file (or a name).
1562 </p>
1563 <a name="htmlhelpcommand"></a>
1565 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>HtmlHelpCommand</b></font>( Wnd: HWnd; <b>const</b> <a href=#helpfilepath>HelpFilePath</a>: <b>String</b>; Cmd, Data: <b>Integer</b> );</font>
1566 <br>
1567 Use this wrapper procedure to call HtmlHelp API function.
1568 </p>
1569 <a name="thhnnotify"></a>
1571 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>THHNNotify</b></font> = tagHHN_NOTIFY;</font>
1572 <br>
1573 * Use by command HH_DISPLAY_TEXT_POPUP
1574 </p>
1575 <a name="thhpopup"></a>
1577 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>THHPopup</b></font> = tagHH_POPUP;</font>
1578 <br>
1579 * Use by commands - HH_ALINK_LOOKUP, HH_KEYWORD_LOOKUP
1580 </p>
1581 <a name="global_getctlbrushhandle"></a>
1583 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_GetCtlBrushHandle</b></font>: <b>function</b>( Sender: <a href=#pcontrol>PControl</a> ): HBrush = SimpleGetCtlBrushHandle;</font>
1584 <br>
1585 Is called to obtain brush handle.
1586 </p>
1587 <a name="global_align"></a>
1589 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Global_Align</b></font>: <b>procedure</b>( Sender: <a href=#pobj>PObj</a> ) = DummyObjProc;</font>
1590 <br>
1591 Is set to perform aligning of control, and only if property Align
1592 is changed for TControl, or SetAlign method is called for it.
1593 </p>
1594 <a name="wndfunc"></a>
1596 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WndFunc</b></font>( W: HWnd; Msg: Cardinal; wParam, lParam: <b>Integer</b> ): <b>Integer</b>; stdcall;</font>
1597 <br>
1598 Global message handler for window. Redirects all messages to
1599 destination windows, obtaining target TControl object address from
1600 window itself, using GetProp API call.
1601 </p>
1602 <a name="appletrunning"></a>
1604 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>AppletRunning</b></font>: <b>Boolean</b>;</font>
1605 <br>
1606 Is set to True while message loop is processing (in <a href=#run>Run</a> procedure).
1607 </p>
1608 <a name="appletterminated"></a>
1610 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>AppletTerminated</b></font>: <b>Boolean</b>;</font>
1611 <br>
1612 Is set to True when message loop is terminated.
1613 </p>
1614 <a name="applet"></a>
1616 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>Applet</b></font>: <a href=#pcontrol>PControl</a>;</font>
1617 <br>
1618 Applet window object. Actually, can be set to main form if program
1619 not needed in special applet button window (useful to make applet
1620 button invisible on taskbar, or to have several forms with single
1621 applet button - crete it in that case using <a href=#newapplet>NewApplet</a>).
1622 </p>
1623 <a name="appbuttonused"></a>
1625 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>AppButtonUsed</b></font>: <b>Boolean</b>;</font>
1626 <br>
1627 True if special window to represent applet button (may be invisible)
1628 is used. If no, every form is represented with its own taskbar button
1629 (always visible).
1630 </p>
1631 <a name="screencursor"></a>
1633 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ScreenCursor</b></font>: HCursor;</font>
1634 <br>
1635 Set this global variable to override any cursor settings of current
1636 form or control.
1637 </p>
1638 <a name="screenwidth"></a>
1640 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ScreenWidth</b></font>: <b>Integer</b>;</font>
1641 <br>
1642 Returns screen width in pixels.
1643 </p>
1644 <a name="screenheight"></a>
1646 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ScreenHeight</b></font>: <b>Integer</b>;</font>
1647 <br>
1648 Returns screen height in pixels.
1649 </p>
1650 <a name="tstatusoption"></a>
1652 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TStatusOption</b></font> =( soNoSizeGrip, soTop );</font>
1653 <br>
1654 Options available for status bars.
1655 </p>
1656 <a name="tstatusoptions"></a>
1658 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TStatusOptions</b></font> = <b>Set</b> <b>of</b> <a href=#tstatusoption>TStatusOption</a>;</font>
1659 <br>
1660 Status bar options.
1661 </p>
1662 <a name="run"></a>
1664 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Run</b></font>( <b>var</b> AppletWnd: <a href=#pcontrol>PControl</a> );</font>
1665 <br>
1666 <a name="appbutton">
1667 Call this procedure to process messages loop of your program.
1668 Pass here pointer to applet button object (if You have created it
1669 - see <a href=#newapplet>NewApplet</a>) or your main form object of type <a href=#pcontrol>PControl</a> (created
1670 using <a href=#newform>NewForm</a>).
1671 <br><br>
1672 <h1 align=center><font color=#FF8040><a name="visual_objects_constructors"></a>
1673 Visual objects constructing functions
1674 </font></h1>
1675 Following constructing functions for visual controls are available:
1676 <table border=0>
1677 <tr><td><a href="kol_pas.htm#newapplet" target=_top>NewApplet</a></td><td>function NewApplet( const Caption: String ): PControl;</td></tr>
1678 <tr><td><a href="kol_pas.htm#newform" target=_top>NewForm</a></td><td>function NewForm( AParent: PControl; const Caption: String ): PControl;</td></tr>
1679 <tr><td><a href="kol_pas.htm#newbutton" target=_top>NewButton</a></td><td>function NewButton( AParent: PControl; const Caption: String ): PControl;</td></tr>
1680 <tr><td><a href="kol_pas.htm#newbitbtn" target=_top>NewBitBtn</a></td><td>function NewBitBtn( AParent: PControl; const Caption: String; Options: TBitBtnOptions; Layout: TGlyphLayout; GlyphBitmap: HBitmap; GlyphCount: Integer ): PControl;</td></tr>
1681 <tr><td><a href="kol_pas.htm#newlabel" target=_top>NewLabel</a></td><td>function NewLabel( AParent: PControl; const Caption: String ): PControl;</td></tr>
1682 <tr><td><a href="kol_pas.htm#newwordwraplabel" target=_top>NewWordWrapLabel</a></td><td>function NewWordWrapLabel( AParent: PControl; const Caption: String ): PControl;</td></tr>
1683 <tr><td><a href="kol_pas.htm#newlabeleffect" target=_top>NewLabelEffect</a></td><td>function NewLabelEffect( AParent: PControl; const Caption: String; ShadowDeep: Integer ): PControl;</td></tr>
1684 <tr><td><a href="kol_pas.htm#newpaintbox" target=_top>NewPaintbox</a></td><td>function NewPaintbox( AParent: PControl ): PControl;</td></tr>
1685 <tr><td><a href="kol_pas.htm#newimageshow" target=_top>NewImageShow</a></td><td>function NewImageShow( AParent: PControl; AImgList: PImageList; ImgIdx: Integer ): PControl;</td></tr>
1686 <tr><td><a href="kol_pas.htm#newscrollbox" target=_top>NewScrollBox</a></td><td>function NewScrollBox( AParent: PControl; EdgeStyle: TEdgeStyle; Bars: TScrollerBars ): PControl;</td></tr>
1687 <tr><td><a href="kol_pas.htm#newscrollboxex" target=_top>NewScrollBoxEx</a></td><td>function NewScrollBoxEx( AParent: PControl; EdgeStyle: TEdgeStyle ): PControl;</td></tr>
1688 <tr><td><a href="kol_pas.htm#newgradientpanel" target=_top>NewGradientPanel</a></td><td>function NewGradientPanel( AParent: PControl; Color1, Color2: TColor ): PControl;</td></tr>
1689 <tr><td><a href="kol_pas.htm#newgradientpanelex" target=_top>NewGradientPanelEx</a></td><td>function NewGradientPanelEx( AParent: PControl; Color1, Color2: TColor; Style: TGradientStyle; Layout: TGradientLayout ): PControl;</td></tr>
1690 <tr><td><a href="kol_pas.htm#newpanel" target=_top>NewPanel</a></td><td>function NewPanel( AParent: PControl; EdgeStyle: TEdgeStyle ): PControl;</td></tr>
1691 <tr><td><a href="kol_pas.htm#newmdiclient" target=_top>NewMDIClient</a></td><td>function NewMDIClient( AParent: PControl; WindowMenu: THandle ): PControl;</td></tr>
1692 <tr><td><a href="kol_pas.htm#newmdichild" target=_top>NewMDIChild</a></td><td>function NewMDIChild( AParent: PControl; const ACaption: String ): PControl;</td></tr>
1693 <tr><td><a href="kol_pas.htm#newsplitter" target=_top>NewSplitter</a></td><td>function NewSplitter( AParent: PControl; MinSizePrev, MinSizeNext: Integer ): PControl;</td></tr>
1694 <tr><td><a href="kol_pas.htm#newsplitterex" target=_top>NewSplitterEx</a></td><td>function NewSplitterEx( AParent: PControl; MinSizePrev, MinSizeNext: Integer; EdgeStyle: TEdgeStyle ): PControl;</td></tr>
1695 <tr><td><a href="kol_pas.htm#newgroupbox" target=_top>NewGroupbox</a></td><td>function NewGroupbox( AParent: PControl; const Caption: String ): PControl;</td></tr>
1696 <tr><td><a href="kol_pas.htm#newcheckbox" target=_top>NewCheckbox</a></td><td>function NewCheckbox( AParent: PControl; const Caption: String ): PControl;</td></tr>
1697 <tr><td><a href="kol_pas.htm#newcheckbox3state" target=_top>NewCheckBox3State</a></td><td>function NewCheckBox3State( AParent: PControl; const Caption: String ): PControl;</td></tr>
1698 <tr><td><a href="kol_pas.htm#newradiobox" target=_top>NewRadiobox</a></td><td>function NewRadiobox( AParent: PControl; const Caption: String ): PControl;</td></tr>
1699 <tr><td><a href="kol_pas.htm#neweditbox" target=_top>NewEditbox</a></td><td>function NewEditbox( AParent: PControl; Options: TEditOptions ): PControl;</td></tr>
1700 <tr><td><a href="kol_pas.htm#newrichedit" target=_top>NewRichEdit</a></td><td>function NewRichEdit( AParent: PControl; Options: TEditOptions ): PControl;</td></tr>
1701 <tr><td><a href="kol_pas.htm#newrichedit1" target=_top>NewRichEdit1</a></td><td>function NewRichEdit1( AParent: PControl; Options: TEditOptions ): PControl;</td></tr>
1702 <tr><td><a href="kol_pas.htm#newlistbox" target=_top>NewListbox</a></td><td>function NewListbox( AParent: PControl; Options: TListOptions ): PControl;</td></tr>
1703 <tr><td><a href="kol_pas.htm#newcombobox" target=_top>NewCombobox</a></td><td>function NewCombobox( AParent: PControl; Options: TComboOptions ): PControl;</td></tr>
1704 <tr><td><a href="kol_pas.htm#newprogressbar" target=_top>NewProgressbar</a></td><td>function NewProgressbar( AParent: PControl ): PControl;</td></tr>
1705 <tr><td><a href="kol_pas.htm#newprogressbarex" target=_top>NewProgressbarEx</a></td><td>function NewProgressbarEx( AParent: PControl; Options: TProgressbarOptions ): PControl;</td></tr>
1706 <tr><td><a href="kol_pas.htm#newlistview" target=_top>NewListView</a></td><td>function NewListView( AParent: PControl; Style: TListViewStyle; Options: TListViewOptions; ImageListSmall, ImageListNormal, ImageListState: PImageList ): PControl;</td></tr>
1707 <tr><td><a href="kol_pas.htm#newtreeview" target=_top>NewTreeView</a></td><td>function NewTreeView( AParent: PControl; Options: TTreeViewOptions; ImgListNormal, ImgListState: PImageList ): PControl;</td></tr>
1708 <tr><td><a href="kol_pas.htm#newtabcontrol" target=_top>NewTabControl</a></td><td>function NewTabControl( AParent: PControl; Tabs: array of String; Options: TTabControlOptions; ImgList: PImageList; ImgList1stIdx: Integer ): PControl;</td></tr>
1709 <tr><td><a href="kol_pas.htm#newtoolbar" target=_top>NewToolbar</a></td><td>function NewToolbar( AParent: PControl; Align: TControlAlign; Options: TToolbarOptions; Bitmap: HBitmap; Buttons: array of PChar; BtnImgIdxArray: array of Integer ): PControl;</td></tr>
1710 <tr><td><a href="kol_pas.htm#newdatetimepicker" target=_top>NewDateTimePicker</a></td><td>function NewDateTimePicker( AParent: PControl; Options: TDateTimePickerOptions ): PControl;</td></tr>
1711 </table>
1712 </p>
1713 <a name="appletminimize"></a>
1715 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AppletMinimize</b></font>;</font>
1716 <br>
1717 Minimizes the application (<a href=#applet>Applet</a> should be assigned to have effect).
1718 </p>
1719 <a name="applethide"></a>
1721 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AppletHide</b></font>;</font>
1722 <br>
1723 Minimizes and hides application.
1724 </p>
1725 <a name="appletrestore"></a>
1727 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AppletRestore</b></font>;</font>
1728 <br>
1729 Restores <a href=#applet>Applet</a> when minimized.
1730 </p>
1731 <a name="registeridlehandler"></a>
1733 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>RegisterIdleHandler</b></font>( <b>const</b> OnIdle: <a href=#tonevent>TOnEvent</a> );</font>
1734 <br>
1735 Registers new Idle handler. Idle handler is called each time when
1736 message queue becomes empty.
1737 </p>
1738 <a name="unregisteridlehandler"></a>
1740 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>UnRegisterIdleHandler</b></font>( <b>const</b> OnIdle: <a href=#tonevent>TOnEvent</a> );</font>
1741 <br>
1742 Unregisters Idle handler.
1743 </p>
1744 <a name="initcommoncontrols"></a>
1746 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>InitCommonControls</b></font>; stdcall;</font>
1747 <br>
1748 </p>
1749 <a name="doinitcommoncontrols"></a>
1751 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DoInitCommonControls</b></font>( dwICC: <b>DWORD</b> );</font>
1752 <br>
1753 Calls extended initialization for Common Controls (from ComCtrl32).
1754 Pass one of following constants:
1755 <pre>
1756 ICC_LISTVIEW_CLASSES = $00000001; // listview, header
1757 ICC_TREEVIEW_CLASSES = $00000002; // treeview, tooltips
1758 ICC_BAR_CLASSES = $00000004; // toolbar, statusbar, trackbar, tooltips
1759 ICC_TAB_CLASSES = $00000008; // tab, tooltips
1760 ICC_UPDOWN_CLASS = $00000010; // updown
1761 ICC_PROGRESS_CLASS = $00000020; // progress
1762 ICC_HOTKEY_CLASS = $00000040; // hotkey
1763 ICC_ANIMATE_CLASS = $00000080; // animate
1764 ICC_WIN95_CLASSES = $000000FF;
1765 ICC_DATE_CLASSES = $00000100; // month picker, date picker, time picker, updown
1766 ICC_USEREX_CLASSES = $00000200; // comboex
1767 ICC_COOL_CLASSES = $00000400; // rebar (coolbar) control
1768 ICC_INTERNET_CLASSES = $00000800;
1769 ICC_PAGESCROLLER_CLASS = $00001000; // page scroller
1770 ICC_NATIVEFNTCTL_CLASS = $00002000; // native font control
1771 </pre>
1772 </p>
1773 <a name="oleinit"></a>
1775 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>OleInit</b></font>: <b>Boolean</b>;</font>
1776 <br>
1777 Calls OleInitialize (once - all other calls are simulated by incrementing
1778 call counter. Every OleInit shoud be complemented with correspondent OleUninit.
1779 (Though, it is possible to call API function OleUnInitialize once to
1780 cancel all OleInit calls).
1781 </p>
1782 <a name="oleuninit"></a>
1784 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>OleUnInit</b></font>;</font>
1785 <br>
1786 Decrements counter and calls OleUnInitialize when it is zeroed.
1787 </p>
1788 <a name="stringtoolestr"></a>
1790 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StringToOleStr</b></font>( <b>const</b> Source: <b>string</b> ): PWideChar;</font>
1791 <br>
1792 </p>
1793 <a name="newapplet"></a>
1795 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewApplet</b></font>( <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
1796 <br>
1797 <a name="control">
1798 Creates applet button window, which has to be parent of all other forms
1799 in your project (but this is *not must*). See also comments about <a href=#newform>NewForm</a>.
1800 <br>
1801 Following methods, properties and events are useful to work with applet
1802 control:
1803 <table border=0>
1804 <tr><td><a href="kol_pas.htm#run" target=_top>Run</a></td><td>procedure Run( var AppletWnd: PControl );</td></tr>
1805 </table>
1806 </p>
1807 <a name="newform"></a>
1809 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewForm</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
1810 <br>
1811 <a name="control">
1812 Creates form window object and returns pointer to it. If You use only one form,
1813 and You are not going to do applet button on task bar invisible, it is not
1814 necessary to create also special applet button window - just pass
1815 your (main) form object to <a href=#run>Run</a> procedure. In that case, it is a good
1816 idea to assign pointer to your main form object to <a href=#applet>Applet</a> variable
1817 immediately following creating it - because some objects (e.g. <a href=#ttimer>TTimer</a>)
1818 want to have <a href=#applet>Applet</a> assigned to something.
1819 <br>
1820 Following methods, properties and events are useful to work with forms
1821 (ones common for all visual objects, such as
1822 <a href="tcontrol.htm#Left" target=_top> Left </a>
1824 <a href="tcontrol.htm#Top" target=_top> Top </a>
1826 <a href="tcontrol.htm#Width" target=_top> Width </a>
1828 <a href="tcontrol.htm#Height" target=_top> Height </a>
1829 , etc. are not listed here - look TControl for it):
1830 <table border=0>
1831 </table>
1832 </p>
1833 <a name="newbutton"></a>
1835 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewButton</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
1836 <br>
1837 <a name="control">
1838 Creates button on given parent control or form.
1839 Please note, that in Windows, buttons can not change its
1840 <a href="tcontrol.htm#Font" target=_top> Font </a>
1841 color
1842 and to be
1843 <a href="tcontrol.htm#Transparent" target=_top> Transparent </a>
1845 <br> Following methods, properies and events are (especially) useful with
1846 a button:
1847 <table border=0>
1848 </table>
1849 </p>
1850 <a name="newbitbtn"></a>
1852 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewBitBtn</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b>; Options: <a href=#tbitbtnoptions>TBitBtnOptions</a>; Layout: <a href=#tglyphlayout>TGlyphLayout</a>; GlyphBitmap: HBitmap; GlyphCount: <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
1853 <br>
1854 <a name="control">
1855 Creates image button (actually implemented as owner-drawn). In Options,
1856 it is possible to determine, whether bitmap or image list used to contain
1857 one or more (up to 5) images, correspondent to certain BitBtn state.
1858 <br>&nbsp;&nbsp;&nbsp;
1859 For case of imagelist (option bboImageList), it is possible to use a
1860 number of glyphs from the image list, starting from image index given
1861 by GlyphCount parameter. Number of used glyphs is passed in that case
1862 in high word of GlyphCount parameter (if 0, one image is used therefore).
1863 For bboImageList, BitBtn can be Transparent (and in that case bboNoBorder
1864 style can be useful to draw custom buttons of non-rectangular shape).
1865 <br>&nbsp;&nbsp;&nbsp;
1866 For case of bitmap BitBtn, image is stretched down (if too big), but can
1867 not be transparent. It is not necessary for bitmap BitBtn to pass correct
1868 GlyphCount - it is calculated on base of bitmap size, if 0 is passed.
1869 <br>&nbsp;&nbsp;&nbsp;
1870 And, certainly, BitBtn can be without glyph image (text only). For that
1871 case, it is therefore is more flexible and power than usual Button (but
1872 requires more code). E.g., BitBtn can change its
1873 <a href="tcontrol.htm#Font" target=_top> Font </a>
1875 <a href="tcontrol.htm#Color" target=_top> Color </a>
1877 and to be totally
1878 <a href="tcontrol.htm#Transparent" target=_top> Transparent </a>
1880 Moreover, BitBtn can be
1881 <a href="tcontrol.htm#Flat" target=_top> Flat </a>
1882 , bboFixed,
1883 <a href="tcontrol.htm#SpeedButton" target=_top> SpeedButton </a>
1885 have property
1886 <a href="tcontrol.htm#RepeatInterval" target=_top> RepeatInterval </a>
1888 <br>&nbsp;&nbsp;&nbsp;
1889 Note: if You use bboFixed Style, use OnChange event instead of OnClick,
1890 because
1891 <a href="tcontrol.htm#Checked" target=_top> Checked </a>
1892 state is changed immediately however OnClick occure
1893 only when mouse or space key released (and can be not called at all if
1894 mouse button is released out of BitBtn bounds). Also, bboFixed defines
1895 only which glyph to show (the border if it is not turned off behaves as
1896 usual for a button, i.e. it becomes lowered and then raised again at any click).
1897 Here You can find references to other properties, events and methods
1898 applicable to BitBtn:
1899 <table border=0>
1900 </table>
1901 </p>
1902 <a name="newlabel"></a>
1904 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewLabel</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
1905 <br>
1906 <a name="control">
1907 Creates static text control (native Windows STATIC control).
1908 Use property
1909 <a href="tcontrol.htm#Caption" target=_top> Caption </a>
1910 at run time to change label text. Also
1911 it is possible to adjust label
1912 <a href="tcontrol.htm#Font" target=_top> Font </a>
1914 <a href="tcontrol.htm#Brush" target=_top> Brush </a>
1916 <a href="tcontrol.htm#Color" target=_top> Color </a>
1918 Label can be
1919 <a href="tcontrol.htm#Transparent" target=_top> Transparent </a>
1920 . If You want to have rotated text
1921 label, call <a href=#newlabeleffect>NewLabelEffect</a> instead and change its
1922 <a href="tcontrol.htm#Font" target=_top> Font </a>
1923 .FontOrientation.
1924 Other references certain for a label:
1925 <table border=0>
1926 </table>
1927 </p>
1928 <a name="newwordwraplabel"></a>
1930 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewWordWrapLabel</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
1931 <br>
1932 <a name="control">
1933 Creates multiline static text control (native Windows STATIC control),
1934 which can wrap long text onto several lines. See also <a href=#newlabel>NewLabel</a>.
1935 See also:
1936 <table border=0>
1937 </table>
1938 </p>
1939 <a name="newlabeleffect"></a>
1941 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewLabelEffect</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b>; ShadowDeep: <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
1942 <br>
1943 <a name="control">
1944 Creates 3D-label with capability to rotate its text
1945 <a href="tcontrol.htm#Caption" target=_top> Caption </a>
1946 , which
1947 is controlled by changing
1948 <a href="tcontrol.htm#Font" target=_top> Font </a>
1949 .FontOrientation property. If You want
1950 to get flat effect label (e.g. to rotate it only), pass
1951 <a href="tcontrol.htm#ShadowDeep" target=_top> ShadowDeep </a>
1952 = 0.
1953 Please note, that drawing procedure uses
1954 <a href="tcontrol.htm#Canvas" target=_top> Canvas </a>
1955 property, so using of
1956 LabelEffect leads to increase size of executable.
1957 See also:
1958 <table border=0>
1959 </table>
1960 </p>
1961 <a name="newpaintbox"></a>
1963 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewPaintbox</b></font>( AParent: <a href=#pcontrol>PControl</a> ): <a href=#pcontrol>PControl</a>;</font>
1964 <br>
1965 <a name="control">
1966 Creates owner-drawn STATIC control. Set its
1967 <a href="tcontrol.htm#OnPaint" target=_top> OnPaint </a>
1968 event to
1969 perform custom painting.
1970 <table border=0>
1971 </table>
1972 </p>
1973 <a name="newimageshow"></a>
1975 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewImageShow</b></font>( AParent: <a href=#pcontrol>PControl</a>; AImgList: <a href=#pimagelist>PImageList</a>; ImgIdx: <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
1976 <br>
1977 <a name="control">
1978 Creates an image show control, implemented as a paintbox which is used to
1979 draw an image from the imagelist. At run-time, use property CurIndex to
1980 select another image from the imagelist, and a property ImageListNormal to
1981 use another image list. When the control is created, its size becomes
1982 equal to dimensions of imagelist (if any).
1983 </p>
1984 <a name="newscrollbox"></a>
1986 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewScrollBox</b></font>( AParent: <a href=#pcontrol>PControl</a>; EdgeStyle: <a href=#tedgestyle>TEdgeStyle</a>; Bars: TScrollerBars ): <a href=#pcontrol>PControl</a>;</font>
1987 <br>
1988 <a name="control">
1989 Creates simple scrolling box, which can be used any way you wish, e.g. to scroll
1990 certain large image. To provide automatic scrolling of a set of child controls,
1991 use advanced scroll box, created with <a href=#newscrollboxex>NewScrollBoxEx</a>.
1992 </p>
1993 <a name="newscrollboxex"></a>
1995 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewScrollBoxEx</b></font>( AParent: <a href=#pcontrol>PControl</a>; EdgeStyle: <a href=#tedgestyle>TEdgeStyle</a> ): <a href=#pcontrol>PControl</a>;</font>
1996 <br>
1997 <a name="control">
1998 Creates extended scrolling box control, which automatically scrolls child
1999 controls (if any).
2000 </p>
2001 <a name="newgradientpanel"></a>
2003 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewGradientPanel</b></font>( AParent: <a href=#pcontrol>PControl</a>; Color1, Color2: TColor ): <a href=#pcontrol>PControl</a>;</font>
2004 <br>
2005 <a name="control">
2006 Creates gradient-filled STATIC control. To adjust colors at the
2007 run time, change
2008 <a href="tcontrol.htm#Color1" target=_top> Color1 </a>
2010 <a href="tcontrol.htm#Color2" target=_top> Color2 </a>
2011 properties (which initially are
2012 assigned from Color1, Color2 parameters), and call
2013 <a href="tcontrol.htm#Invalidate" target=_top> Invalidate </a>
2014 method
2015 to repaint control.
2016 </p>
2017 <a name="newgradientpanelex"></a>
2019 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewGradientPanelEx</b></font>( AParent: <a href=#pcontrol>PControl</a>; Color1, Color2: TColor; Style: <a href=#tgradientstyle>TGradientStyle</a>; Layout: <a href=#tgradientlayout>TGradientLayout</a> ): <a href=#pcontrol>PControl</a>;</font>
2020 <br>
2021 <a name="control">
2022 Creates gradient-filled STATIC control. To adjust colors at the
2023 run time, change
2024 <a href="tcontrol.htm#Color1" target=_top> Color1 </a>
2026 <a href="tcontrol.htm#Color2" target=_top> Color2 </a>
2027 properties (which initially are
2028 assigned from Color1, Color2 parameters), and call
2029 <a href="tcontrol.htm#Invalidate" target=_top> Invalidate </a>
2030 method
2031 to repaint control. Depending on style and first line/point layout, can
2032 looking different. Idea: Vladimir Stojiljkovic.
2033 </p>
2034 <a name="newpanel"></a>
2036 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewPanel</b></font>( AParent: <a href=#pcontrol>PControl</a>; EdgeStyle: <a href=#tedgestyle>TEdgeStyle</a> ): <a href=#pcontrol>PControl</a>;</font>
2037 <br>
2038 <a name="control">
2039 Creates panel, which can be parent for other controls (though, any
2040 control can be used as a parent for other ones, but panel is specially
2041 designed for such purpose).
2042 </p>
2043 <a name="newmdiclient"></a>
2045 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMDIClient</b></font>( AParent: <a href=#pcontrol>PControl</a>; WindowMenu: THandle ): <a href=#pcontrol>PControl</a>;</font>
2046 <br>
2047 <a name="control">
2048 Creates MDI client window, which is a special type of child window,
2049 containing all MDI child windows, created calling <a href=#newmdichild>NewMDIChild</a> function.
2050 On a form, MDI client behaves like a panel, so it can be placed and sized
2051 (or aligned) like any other controls. To minimize flick during resizing
2052 main form having another aligned controls, place MDI client window on
2053 a panel and align it caClient in the panel.
2054 <br>Note:
2055 MDI client must be a single on the form.
2056 </p>
2057 <a name="newmdichild"></a>
2059 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMDIChild</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> ACaption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
2060 <br>
2061 <a name="control">
2062 Creates MDI client window. AParent should be a MDI client window,
2063 created with <a href=#newmdiclient>NewMDIClient</a> function.
2064 </p>
2065 <a name="newsplitter"></a>
2067 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewSplitter</b></font>( AParent: <a href=#pcontrol>PControl</a>; MinSizePrev, MinSizeNext: <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
2068 <br>
2069 <a name="control">
2070 Creates splitter control, which will separate previous one (i.e. last
2071 created one before splitter on the same parent) from created
2072 next, allowing to user to adjust size of separated controls by dragging
2073 the splitter in desired direction. Created splitter becomes vertical
2074 or horizontal depending on Align style of previous control on the same
2075 parent (if caLeft/caRight then vertical, if caTop/caBottom then horizontal).
2076 <br>&nbsp;&nbsp;&nbsp;
2077 Please note, what if previous control has no Align equal to caLeft/caRight
2078 or caTop/caBottom, splitter will not be able to function normally. If
2079 previous control does not exist, it is yet possible to use splitter as
2080 a resizeable panel (but set its initial Align value first - otherwise it
2081 is not set by default. Also, change Cursor property as You wish in that
2082 case, since it is not set too in case, when previous control does not
2083 exist).
2084 <br>&nbsp;&nbsp;&nbsp;
2085 Additional parameters determine, which minimal size (width or height -
2086 correspondently to split direction) is allowed for left (top) control
2087 and to rest of client area of parent, correspondently. (It is possible
2088 later to set second control for checking its size with MinSizeNext
2089 value - using TControl.SecondControl property). If -1 passed,
2090 correspondent control size is not checked during dragging of splitter.
2091 Usually 0 is more suitable value (with this value, it is garantee, that
2092 splitter will be always available even if mouse was released far from the
2093 edge of form).
2094 <br>&nbsp;&nbsp;&nbsp;
2095 It is possible for user to press Escape any time while dragging splitter
2096 to abort all adjustments made starting from left mouse button push and
2097 begin of drag the splitter. But remember please, that such event is
2098 controlled using timer, and therefore correspondent keyboard events
2099 are received by currently focused control. Be sure, that pressing Escape
2100 will not affect to any control on form, which could be focused, otherwise
2101 filter keyboard messages (by yourself) to prevent undesired handling of
2102 Escape key by certain controls while splitting. (Use Dragging property
2103 to check if splitter is dragging by user with mouse).
2104 <br>&nbsp;&nbsp;&nbsp;
2105 See also:
2106 <a href=#newsplitterex>NewSplitterEx</a>
2107 <table border=0>
2108 </table>
2109 </p>
2110 <a name="newsplitterex"></a>
2112 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewSplitterEx</b></font>( AParent: <a href=#pcontrol>PControl</a>; MinSizePrev, MinSizeNext: <b>Integer</b>; EdgeStyle: <a href=#tedgestyle>TEdgeStyle</a> ): <a href=#pcontrol>PControl</a>;</font>
2113 <br>
2114 <a name="control">
2115 Creates splitter control. Difference from <a href=#newsplitter>NewSplitter</a> is what it is possible
2116 to determine if a splitter will be beveled or not. See also <a href=#newsplitter>NewSplitter</a>.
2117 </p>
2118 <a name="newgroupbox"></a>
2120 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewGroupbox</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
2121 <br>
2122 <a name="control">
2123 Creates group box control. Note, that to group radio items, group
2124 box is not necessary - any parent can play role of group for radio items.
2125 See also <a href=#newpanel>NewPanel</a>.
2126 </p>
2127 <a name="newcheckbox"></a>
2129 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewCheckbox</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
2130 <br>
2131 <a name="control">
2132 Creates check box control. Special properties, methods, events:
2133 <table border=0>
2134 </table>
2135 </p>
2136 <a name="newcheckbox3state"></a>
2138 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewCheckBox3State</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
2139 <br>
2140 <a name="control">
2141 Creates check box control with 3 states. Special properties, methods,
2142 events:
2143 <table border=0>
2144 </table>
2145 </p>
2146 <a name="newradiobox"></a>
2148 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewRadiobox</b></font>( AParent: <a href=#pcontrol>PControl</a>; <b>const</b> Caption: <b>String</b> ): <a href=#pcontrol>PControl</a>;</font>
2149 <br>
2150 <a name="control">
2151 Creates radio box control. Alternative radio items must have the
2152 same parent window (regardless of its kind, either groupbox (<a href=#newgroupbox>NewGroupbox</a>),
2153 panel (<a href=#newpanel>NewPanel</a>) or form itself). Following properties, methods and events
2154 are specially for radiobox controls:
2155 <table border=0>
2156 </table>
2157 </p>
2158 <a name="neweditbox"></a>
2160 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewEditbox</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#teditoptions>TEditOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2161 <br>
2162 <a name="control">
2163 Creates edit box control. To create multiline edit box, similar to
2164 TMemo in VCL, apply eoMultiline in Options. Following properties, methods,
2165 events are special for edit controls:
2166 <table border=0>
2167 </table>
2168 </p>
2169 <a name="newrichedit"></a>
2171 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewRichEdit</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#teditoptions>TEditOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2172 <br>
2173 <a name="control">
2174 Creates rich text edit control. A rich edit control is a window in which
2175 the user can enter and edit text. The text can be assigned character and
2176 paragraph formatting, and can include embedded OLE objects. Rich edit
2177 controls provide a programming interface for formatting text. However, an
2178 application must implement any user interface components necessary to make
2179 formatting operations available to the user.
2180 <br>&nbsp;&nbsp;&nbsp;
2181 Note: eoPassword, eoMultiline options have no effect for RichEdit control.
2182 Some operations are supersided with special versions of those, created
2183 especially for RichEdit, but in some cases it is necessary to use
2184 another properties and methods, specially designed for RichEdit (see
2185 methods and properties, which names are starting from RE_...).
2186 <br>&nbsp;&nbsp;&nbsp;
2187 Following properties, methods, events are special for edit controls:
2188 <table border=0>
2189 </table>
2190 </p>
2191 <a name="newrichedit1"></a>
2193 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewRichEdit1</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#teditoptions>TEditOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2194 <br>
2195 <a name="control">
2196 Like <a href=#newrichedit>NewRichEdit</a>, but to work with older RichEdit control version 1.0
2197 (window class 'RichEdit' forced to use instead of 'RichEdit20A', even
2198 if library RICHED20.DLL found and loaded successfully). One more
2199 difference - <a href=#oleinit>OleInit</a> is not called, so the most of OLE capabilities
2200 of RichEdit could not working.
2201 </p>
2202 <a name="newlistbox"></a>
2204 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewListbox</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#tlistoptions>TListOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2205 <br>
2206 <a name="control">
2207 Creates list box control. Following properties, methods and events are
2208 special for Listbox:
2209 <table border=0>
2210 </table>
2211 </p>
2212 <a name="newcombobox"></a>
2214 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewCombobox</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#tcombooptions>TComboOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2215 <br>
2216 <a name="control">
2217 Creates new combo box control. Note, that it is not possible to align
2218 combobox caLeft or caRight: this can cause infinit recursion in the
2219 application.
2220 <br>Following properties, methods and events are
2221 special for Combobox:
2222 <table border=0>
2223 </table>
2224 </p>
2225 <a name="newprogressbar"></a>
2227 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewProgressbar</b></font>( AParent: <a href=#pcontrol>PControl</a> ): <a href=#pcontrol>PControl</a>;</font>
2228 <br>
2229 <a name="control">
2230 Creates progress bar control. Following properties are special for
2231 progress bar:
2232 <table border=0>
2233 </table>
2234 </p>
2235 <a name="newprogressbarex"></a>
2237 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewProgressbarEx</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#tprogressbaroptions>TProgressbarOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2238 <br>
2239 <a name="control">
2240 Can create progress bar with smooth style (progress is not segmented
2241 onto bricks) or/and vertical progress bar - using additional parameter.
2242 For list of properties, suitable for progress bars, see <a href=#newprogressbar>NewProgressbar</a>.
2243 </p>
2244 <a name="newlistview"></a>
2246 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewListView</b></font>( AParent: <a href=#pcontrol>PControl</a>; Style: <a href=#tlistviewstyle>TListViewStyle</a>; Options: TListViewOptions; ImageListSmall, ImageListNormal, ImageListState: <a href=#pimagelist>PImageList</a> ): <a href=#pcontrol>PControl</a>;</font>
2247 <br>
2248 <a name="control">
2249 Creates list view control. It is very powerful control, which can partially
2250 compensate absence of grid controls (in lvsDetail view mode). Properties,
2251 methods and events, special for list view control are:
2252 <table border=0>
2253 </table>
2254 </p>
2255 <a name="newtreeview"></a>
2257 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewTreeView</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#ttreeviewoptions>TTreeViewOptions</a>; ImgListNormal, ImgListState: <a href=#pimagelist>PImageList</a> ): <a href=#pcontrol>PControl</a>;</font>
2258 <br>
2259 <a name="control">
2260 Creates tree view control. See tree view methods and properties:
2261 <table border=0>
2262 </table>
2263 </p>
2264 <a name="newtabcontrol"></a>
2266 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewTabControl</b></font>( AParent: <a href=#pcontrol>PControl</a>; Tabs: <b>array</b> <b>of</b> <b>String</b>; Options: <a href=#ttabcontroloptions>TTabControlOptions</a>; ImgList: <a href=#pimagelist>PImageList</a>; ImgList1stIdx: <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
2267 <br>
2268 <a name="control">
2269 Creates new tab control (like notebook). To place child control on a certain
2270 page of TabControl, use property Pages[ Idx ], for example:
2271 <p align=left><font face="Courier" color="008080"><b><pre>
2272 Label1 := <a href="kol_pas.htm#newlabel target="_top""><font color="008080">NewLabel</font></a>( TabControl1.Pages[ 0 ], <font color="A08020">'Label1'</font> );
2273 </pre></b></font></p>
2274 &nbsp;&nbsp;&nbsp;
2275 To determine number of pages at run time, use property
2276 <a href="tcontrol.htm#Count" target=_top> Count </a>
2278 <br> to determine which page is currently selected (or to change
2279 selection), use property
2280 <a href="tcontrol.htm#CurrentIndex" target=_top> CurrentIndex </a>
2282 <br> to feedback to switch between tabs assign your handler to OnSelChange
2283 event;
2284 <br>Note, that by default, tab control is created with a border lowered to
2285 tab control's parent. To remove it, you can apply WS_EX_TRANSPARENT extended
2286 style (see TControl.ExStyle property), but painting of some child controls
2287 can be strange a bit in this case (no border drawing for edit controls was
2288 found, but not always...). You can also apply style WS_THICKFRAME (TControl.Style
2289 property) to make the border raised.
2290 <br> Other methods and properties, suitable for tab control, are:
2291 <table border=0>
2292 </table>
2293 </p>
2294 <a name="newtoolbar"></a>
2296 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewToolbar</b></font>( AParent: <a href=#pcontrol>PControl</a>; Align: <a href=#tcontrolalign>TControlAlign</a>; Options: <a href=#ttoolbaroptions>TToolbarOptions</a>; Bitmap: HBitmap; Buttons: <b>array</b> <b>of</b> <b>PChar</b>; BtnImgIdxArray: <b>array</b> <b>of</b> <b>Integer</b> ): <a href=#pcontrol>PControl</a>;</font>
2297 <br>
2298 <a name="control">
2299 Creates toolbar control. Bitmap must contain images for all buttons
2300 excluding separators (defined by string '-' in Buttons array), otherwise
2301 last buttons will no have images at all. Image width for every button
2302 is assumed to be equal to Bitmap height (if last of &quot;squares&quot; has
2303 insufficient width, it will not be used). To define fixed buttons, use
2304 characters '+' or '-' as a prefix for button string (even empty). To
2305 create groups of (radio-)buttons, use also '!' follow '+' or '-'. (These rules
2306 are similar used in menu creation). To define drop down button, use (as
2307 first) prefix '^'. (Do not forget to set
2308 <a href="tcontrol.htm#OnTBDropDown" target=_top> OnTBDropDown </a>
2309 event for this
2310 case). If You want to assign images to buttons not in the same order
2311 how these are placed in Bitmap (or You use system bitmap), define for every
2312 button (in BtnImgIdxArray array) indexes for every button (excluding
2313 separator buttons). Otherwise, it is possible to define index only for first
2314 button (e.g., [0]). It is also possible to change TBImages[ ] property
2315 for such purpose, or do the same in method TBSetBtnImgIdx).
2316 <br>
2317 Following properties, methods and event are specially designed to work with
2318 toolbar control:
2319 <table border=0>
2320 </table>
2321 </p>
2322 <a name="newdatetimepicker"></a>
2324 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewDateTimePicker</b></font>( AParent: <a href=#pcontrol>PControl</a>; Options: <a href=#tdatetimepickeroptions>TDateTimePickerOptions</a> ): <a href=#pcontrol>PControl</a>;</font>
2325 <br>
2326 <a name="control">
2327 Creates date and time picker common control.
2328 </p>
2329 <a name="newimagelist"></a>
2331 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewImageList</b></font>( AOwner: <a href=#pcontrol>PControl</a> ): <a href=#pimagelist>PImageList</a>;</font>
2332 <br>
2333 Constructor of <a href=#timagelist>TImageList</a> object. Unlike other non-visual objects, image list
2334 can be parented by TControl object (but this does not *must*), and in that
2335 case it is destroyed automatically when its parent control is destroyed.
2336 Every control can have several <a href=#timagelist>TImageList</a> objects, linked to a simple list.
2337 But if any <a href=#timagelist>TImageList</a> object is destroyed, all following ones are destroyed
2338 too (at least, now I implemented it so).
2339 </p>
2340 <a name="newtimer"></a>
2342 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewTimer</b></font>( Interval: <b>Integer</b> ): PTimer;</font>
2343 <br>
2344 Constructs initially disabled timer with interval 1000 (1 second).
2345 </p>
2346 <a name="newmmtimer"></a>
2348 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMMTimer</b></font>( Interval: <b>Integer</b> ): PMMTimer;</font>
2349 <br>
2350 Creates multimedia timer object. Initially, it has Resolution = 0,
2351 Periodic = TRUE and Enabled = FALSE. Do not forget also to assign your
2352 event handler to OnTimer to do something on timer shot.
2353 </p>
2354 <a name="pdirchange"></a>
2356 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PDirChange</b></font> = ^ <a href=#tdirchange>TDirChange</a>;</font>
2357 <br>
2358 </p>
2359 <a name="tondirchange"></a>
2361 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnDirChange</b></font> = <b>procedure</b>( Sender: <a href=#pdirchange>PDirChange</a>; <b>const</b> Path: <b>string</b> ) <b>of</b> <b>object</b>;</font>
2362 <br>
2363 Event type to define OnChange event for folder monitoring objects.
2364 </p>
2365 <a name="tfilechangefilters"></a>
2367 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFileChangeFilters</b></font> =( fncFileName, fncDirName, fncAttributes, fncSize, fncLastWrite, fncLastAccess, fncCreation, fncSecurity );</font>
2368 <br>
2369 Possible change monitor filters.
2370 </p>
2371 <a name="tfilechangefilter"></a>
2373 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TFileChangeFilter</b></font> = <b>set</b> <b>of</b> <a href=#tfilechangefilters>TFileChangeFilters</a>;</font>
2374 <br>
2375 Set of filters to pass to a constructor of <a href=#tdirchange>TDirChange</a> object.
2376 </p>
2377 <a name="newdirchangenotifier"></a>
2379 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewDirChangeNotifier</b></font>( <b>const</b> Path: <b>String</b>; Filter: <a href=#tfilechangefilter>TFileChangeFilter</a>; WatchSubtree: <b>Boolean</b>; ChangeProc: <a href=#tondirchange>TOnDirChange</a> ): <a href=#pdirchange>PDirChange</a>;</font>
2380 <br>
2381 Creates notification object TDirChangeNotifier. If something wrong (e.g.,
2382 passed directory does not exist), nil is returned as a result. When change
2383 is notified, ChangeProc is called always in main thread context.
2384 (Please note, that ChangeProc can not be nil).
2385 If empty filter is passed, default filter is used:
2386 [fncFileName..fncLastWrite].
2387 </p>
2388 <a name="tontrayiconmouse"></a>
2390 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnTrayIconMouse</b></font> = <b>procedure</b>( Sender: <a href=#pobj>PObj</a>; Message: <b>Word</b> ) <b>of</b> <b>object</b>;</font>
2391 <br>
2392 Event type to be called when <a href=#applet>Applet</a> receives a message from an icon,
2393 added to the taskbar tray.
2394 </p>
2395 <a name="newtrayicon"></a>
2397 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewTrayIcon</b></font>( Wnd: <a href=#pcontrol>PControl</a>; Icon: HIcon ): PTrayIcon;</font>
2398 <br>
2399 Constructor of <a href=#ttrayicon>TTrayIcon</a> object. Pass main form or applet as Wnd
2400 parameter.
2401 </p>
2402 <a name="tonanotherinstance"></a>
2404 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnAnotherInstance</b></font> = <b>procedure</b>( <b>const</b> CmdLine: <b>String</b> ) <b>of</b> <b>object</b>;</font>
2405 <br>
2406 Event type to use in <a href=#justonenotify>JustOneNotify</a> function.
2407 </p>
2408 <a name="justone"></a>
2410 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>JustOne</b></font>( Wnd: <a href=#pcontrol>PControl</a>; <b>const</b> Identifier: <b>String</b> ): <b>Boolean</b>;</font>
2411 <br>
2412 Returns True, if this is a first instance. For all other instances
2413 (application is already running), False is returned.
2414 </p>
2415 <a name="justonenotify"></a>
2417 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>JustOneNotify</b></font>( Wnd: <a href=#pcontrol>PControl</a>; <b>const</b> Identifier: <b>String</b>; <b>const</b> aOnAnotherInstance: <a href=#tonanotherinstance>TOnAnotherInstance</a> ): <b>Boolean</b>;</font>
2418 <br>
2419 Returns True, if this is a first instance. For all other instances
2420 (application is already running), False is returned. If handler
2421 aOnAnotherInstance passed, it is called (in first instance) every time
2422 when another instance of an application is started, receiving command
2423 line used to run it.
2424 </p>
2425 <a name="msgbox"></a>
2427 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MsgBox</b></font>( <b>const</b> S: <b>String</b>; Flags: <b>DWORD</b> ): <b>DWORD</b>;</font>
2428 <br>
2429 Displays message box with the same title as <a href=kol_pas.htm#applet#caption>Applet.Caption</a>. If applet
2430 is not running, and <a href=#applet>Applet</a> global variable is not assigned, caption
2431 'Error' is displayed (but actually this is not an error - the system
2432 does so, if nil is passed as a title).
2433 <br>&nbsp;&nbsp;&nbsp;
2434 Returns ID_... result (correspondently to flags passed (MB_OK, MBYESNO,
2435 etc. -&gt; ID_OK, ID_YES, ID_NO, etc.)
2436 </p>
2437 <a name="msgok"></a>
2439 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>MsgOK</b></font>( <b>const</b> S: <b>String</b> );</font>
2440 <br>
2441 Displays message box with the same title as <a href=kol_pas.htm#applet#caption>Applet.Caption</a> (or 'Error',
2442 if <a href=#applet>Applet</a> is not running).
2443 </p>
2444 <a name="showmsg"></a>
2446 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ShowMsg</b></font>( <b>const</b> S: <b>String</b>; Flags: <b>DWORD</b> ): <b>DWORD</b>;</font>
2447 <br>
2448 Displays message box like <a href=#msgbox>MsgBox</a>, but uses <a href=kol_pas.htm#applet#handle>Applet.Handle</a> as a parent
2449 (so the message has no button on a task bar).
2450 </p>
2451 <a name="showmessage"></a>
2453 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>ShowMessage</b></font>( <b>const</b> S: <b>String</b> );</font>
2454 <br>
2455 Like <a href=#showmsg>ShowMsg</a>, but has only styles MB_OK and MB_SETFOREGROUND.
2456 </p>
2457 <a name="showmsgmodal"></a>
2459 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>ShowMsgModal</b></font>( <b>const</b> S: <b>String</b> );</font>
2460 <br>
2461 This message function can be used out of a message loop (e.g., after
2462 finishing the application). It is always modal.
2463 Actually, a form with word-wrap label (decorated as borderless edit
2464 box with btnFace color) and with OK button is created and shown modal.
2465 When a dialog is called from outside message loop, caption 'Information'
2466 is always displayed.
2467 Dialog form is automatically resized vertically to fit message text
2468 (but until screen height is achieved) and shown always centered on
2469 screen. The width is fixed (400 pixels).
2470 <br>
2471 Do not use this function outside the message loop for case, when the
2472 <a href=#applet>Applet</a> variable is not used in an application.
2473 </p>
2474 <a name="showquestion"></a>
2476 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ShowQuestion</b></font>( <b>const</b> S: <b>String</b>; Answers: <b>String</b> ): <b>Integer</b>;</font>
2477 <br>
2478 Modal dialog like <a href=#showmsgmodal>ShowMsgModal</a>. It is based on KOL form, so it can
2479 be called also out of message loop, e.g. after finishing the
2480 application. Also, this function *must* be used in MDI applications
2481 in place of any dialog functions, based on MessageBox.
2482 <br>
2483 The second parameter should be empty string or several possible
2484 answers separated by '/', e.g.: 'Yes/No/Cancel'. Result is
2485 a number answered, starting from 1. For example, if 'Cancel'
2486 was pressed, 3 will be returned.
2487 <br>
2488 User can also press ESCAPE key, or close modal dialog. In such case
2489 -1 is returned.
2490 </p>
2491 <a name="showquestionex"></a>
2493 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ShowQuestionEx</b></font>( <b>const</b> S: <b>String</b>; Answers: <b>String</b>; CallBack: <a href=#tonevent>TOnEvent</a> ): <b>Integer</b>;</font>
2494 <br>
2495 Like <a href=#showquestion>ShowQuestion</a>, but with CallBack function, called just before showing
2496 the dialog.
2497 </p>
2498 <a name="speakerbeep"></a>
2500 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SpeakerBeep</b></font>( Freq: <b>Word</b>; Duration: <b>DWORD</b> );</font>
2501 <br>
2502 On Windows NT, calls Windows.Beep. On Windows 9x, produces beep on speaker
2503 of desired frequency during given duration time (in milliseconds).
2504 </p>
2505 <a name="syserrormessage"></a>
2507 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SysErrorMessage</b></font>( ErrorCode: <b>Integer</b> ): <b>string</b>;</font>
2508 <br>
2509 Creates and returns a string containing formatted system error message.
2510 It is possible then to display this message or write it to a log
2511 file, e.g.:
2512 <p align=left><font face="Courier" color="008080"><b><pre>
2513 <a href="kol_pas.htm#showmsg target="_top""><font color="008080">ShowMsg</font></a>( SysErrorMessage( GetLastError ) );
2514 </pre></b></font></p>
2515 <a name="64-bit integer numbers"></a><font color=#FF8040><h1>64-bit integer numbers</h1></font>
2517 </p>
2518 <a name="i64"></a>
2520 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>I64</b></font> = <b>record</b></font>
2521 <br>
2522 64 bit integer record. Use it and correspondent functions below in KOL
2523 projects to avoid dependancy from Delphi version (earlier versions of
2524 Delphi had no Int64 type).
2525 <table border="0" cellpadding="0" cellspacing="0" width="100%">
2526 <tr>
2527 <td width="32">&nbsp;</td>
2528 <td valign="top">
2529 <font face="Courier" color="#800080">Lo, Hi: <b>DWORD</b>;</font>
2530 </td>
2531 <td valign="top">
2532 </td>
2533 </tr>
2534 </table>
2535 <font face="Courier" color="#800080"><b>end</b>;</font>
2536 </p>
2537 <a name="pi64"></a>
2539 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PI64</b></font> = ^ <a href=#i64>I64</a>;</font>
2540 <br>
2541 </p>
2542 <a name="makeint64"></a>
2544 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeInt64</b></font>( Lo, Hi: <b>DWORD</b> ): <a href=#i64>I64</a>;</font>
2545 <br>
2546 </p>
2547 <a name="int2int64"></a>
2549 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Int64</b></font>( X: <b>Integer</b> ): <a href=#i64>I64</a>;</font>
2550 <br>
2551 </p>
2552 <a name="incint64"></a>
2554 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>IncInt64</b></font>( <b>var</b> <a href=#i64>I64</a>: <a href=#i64>I64</a>; Delta: <b>Integer</b> );</font>
2555 <br>
2556 <a href=#i64>I64</a> := <a href=#i64>I64</a> + Delta;
2557 </p>
2558 <a name="decint64"></a>
2560 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DecInt64</b></font>( <b>var</b> <a href=#i64>I64</a>: <a href=#i64>I64</a>; Delta: <b>Integer</b> );</font>
2561 <br>
2562 <a href=#i64>I64</a> := <a href=#i64>I64</a> - Delta;
2563 </p>
2564 <a name="add64"></a>
2566 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Add64</b></font>( <b>const</b> X, Y: <a href=#i64>I64</a> ): <a href=#i64>I64</a>;</font>
2567 <br>
2568 Result := X + Y;
2569 </p>
2570 <a name="sub64"></a>
2572 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Sub64</b></font>( <b>const</b> X, Y: <a href=#i64>I64</a> ): <a href=#i64>I64</a>;</font>
2573 <br>
2574 Result := X - Y;
2575 </p>
2576 <a name="neg64"></a>
2578 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Neg64</b></font>( <b>const</b> X: <a href=#i64>I64</a> ): <a href=#i64>I64</a>;</font>
2579 <br>
2580 Result := -X;
2581 </p>
2582 <a name="mul64i"></a>
2584 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Mul64i</b></font>( <b>const</b> X: <a href=#i64>I64</a>; Mul: <b>Integer</b> ): <a href=#i64>I64</a>;</font>
2585 <br>
2586 Result := X * Mul;
2587 </p>
2588 <a name="div64i"></a>
2590 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Div64i</b></font>( <b>const</b> X: <a href=#i64>I64</a>; D: <b>Integer</b> ): <a href=#i64>I64</a>;</font>
2591 <br>
2592 Result := X div D;
2593 </p>
2594 <a name="mod64i"></a>
2596 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Mod64i</b></font>( <b>const</b> X: <a href=#i64>I64</a>; D: <b>Integer</b> ): <b>Integer</b>;</font>
2597 <br>
2598 Result := X mod D;
2599 </p>
2600 <a name="sgn64"></a>
2602 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Sgn64</b></font>( <b>const</b> X: <a href=#i64>I64</a> ): <b>Integer</b>;</font>
2603 <br>
2604 Result := sign( X ); i.e.:
2605 <br>
2606 if X &lt; 0 then -1
2607 <br>
2608 if X = 0 then 0
2609 <br>
2610 if X &gt; 0 then 1
2611 </p>
2612 <a name="cmp64"></a>
2614 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Cmp64</b></font>( <b>const</b> X, Y: <a href=#i64>I64</a> ): <b>Integer</b>;</font>
2615 <br>
2616 Result := sign( X - Y ); i.e.
2617 <br>
2618 if X &lt; Y then -1
2619 <br>
2620 if X = Y then 0
2621 <br>
2622 if X &gt; Y then 1
2623 </p>
2624 <a name="int64_2str"></a>
2626 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int64_2Str</b></font>( X: <a href=#i64>I64</a> ): <b>String</b>;</font>
2627 <br>
2628 </p>
2629 <a name="str2int64"></a>
2631 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2Int64</b></font>( <b>const</b> S: <b>String</b> ): <a href=#i64>I64</a>;</font>
2632 <br>
2633 </p>
2634 <a name="int64_2double"></a>
2636 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int64_2Double</b></font>( <b>const</b> X: <a href=#i64>I64</a> ): <b>Double</b>;</font>
2637 <br>
2638 </p>
2639 <a name="double2int64"></a>
2641 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Double2Int64</b></font>( D: <b>Double</b> ): <a href=#i64>I64</a>;</font>
2642 <br>
2643 <a name="Floating point numbers"></a><font color=#FF8040><h1>Floating point numbers</h1></font>
2645 </p>
2646 <a name="isnan"></a>
2648 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IsNan</b></font>( <b>const</b> AValue: <b>Double</b> ): <b>Boolean</b>;</font>
2649 <br>
2650 Checks is an argument passed is NAN.
2651 </p>
2652 <a name="intpower"></a>
2654 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IntPower</b></font>( Base: Extended; Exponent: <b>Integer</b> ): Extended;</font>
2655 <br>
2656 Result := Base ^ Exponent;
2657 </p>
2658 <a name="str2double"></a>
2660 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2Double</b></font>( <b>const</b> S: <b>String</b> ): <b>Double</b>;</font>
2661 <br>
2662 </p>
2663 <a name="double2str"></a>
2665 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Double2Str</b></font>( D: <b>Double</b> ): <b>String</b>;</font>
2666 <br>
2667 </p>
2668 <a name="extended2str"></a>
2670 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Extended2Str</b></font>( E: Extended ): <b>String</b>;</font>
2671 <br>
2672 </p>
2673 <a name="double2strex"></a>
2675 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Double2StrEx</b></font>( D: <b>Double</b> ): <b>String</b>;</font>
2676 <br>
2677 experimental, do not use
2678 </p>
2679 <a name="truncd"></a>
2681 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>TruncD</b></font>( D: <b>Double</b> ): <b>Double</b>;</font>
2682 <br>
2683 Result := trunc( D ) as Double;
2684 <hr>
2685 <a name="Small bit arrays (max 32 bits in array)"></a><font color=#FF8040><h1>Small bit arrays (max 32 bits in array)</h1></font>
2687 See also <a href=#tbits>TBits</a> object.
2688 </p>
2689 <a name="getbits"></a>
2691 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetBits</b></font>( N: <b>DWORD</b>; first, last: <b>Byte</b> ): <b>DWord</b>;</font>
2692 <br>
2693 Retuns bits straing from &lt;first&gt; and to &lt;last&gt; inclusively.
2694 </p>
2695 <a name="getbitsl"></a>
2697 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetBitsL</b></font>( N: <b>DWORD</b>; from, len: <b>Byte</b> ): <b>DWord</b>;</font>
2698 <br>
2699 Retuns len bits starting from index &lt;from&gt;.
2700 <hr>
2701 <a name="Arithmetics, geometry and other utility functions"></a><font color=#FF8040><h1>Arithmetics, geometry and other utility functions</h1></font>
2703 See also units KolMath.pas, <a href=cplxmath_pas.htm>CplxMath.pas</a> and Err.pas.
2704 </p>
2705 <a name="muldiv"></a>
2707 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MulDiv</b></font>( A, B, C: <b>Integer</b> ): <b>Integer</b>;</font>
2708 <br>
2709 Returns A * B div C. Small and fast.
2710 </p>
2711 <a name="tmethod"></a>
2713 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMethod</b></font> = <b>packed</b> <b>record</b></font>
2714 <br>
2715 Is defined here because using of VCL classes.pas unit is
2716 not recommended in XCL. This record type is used often
2717 to set/access event handlers, referring to a procedure
2718 of object (usually to set such event to an ordinal
2719 procedure setting Data field to nil.
2720 <table border="0" cellpadding="0" cellspacing="0" width="100%">
2721 <tr>
2722 <td width="32">&nbsp;</td>
2723 <td valign="top">
2724 <font face="Courier" color="#800080">Code: <b>Pointer</b>;</font>
2725 </td>
2726 <td valign="top">
2727 Pointer to method code.
2728 </td></tr><tr><td width="32">&nbsp;</td>
2729 <td colspan=2 valign=top>
2730 If used to fake assigning to event handler of type 'procedure
2731 of object' with ordinal procedure pointer, use symbol '@'
2732 before method:
2733 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Courier"><b>
2734 Method.Code := @MyProcedure;
2735 </b></font>
2736 </td>
2737 </tr>
2738 <tr>
2739 <td width="32">&nbsp;</td>
2740 <td valign="top">
2741 <font face="Courier" color="#800080">Data: <b>Pointer</b>;</font>
2742 </td>
2743 <td valign="top">
2744 Pointer to object, owning the method.
2745 </td></tr><tr><td width="32">&nbsp;</td>
2746 <td colspan=2 valign=top>
2747 To fake event of type 'procedure of object' with setting it to
2748 ordinal procedure assign here NIL;
2749 </td>
2750 </tr>
2751 </table>
2752 When assigning TMethod record to event handler, typecast it with
2753 desired event type, e.g.:
2754 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Courier"><b>
2755 SomeObject.OnSomeEvent := TOnSomeEvent( Method );
2756 </b></font><br>
2757 <font face="Courier" color="#800080"><b>end</b>;</font>
2758 </p>
2759 <a name="pmethod"></a>
2761 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>PMethod</b></font> = ^ <a href=#tmethod>TMethod</a>;</font>
2762 <br>
2763 </p>
2764 <a name="makemethod"></a>
2766 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeMethod</b></font>( Data, Code: <b>Pointer</b> ): <a href=#tmethod>TMethod</a>;</font>
2767 <br>
2768 Help function to construct <a href=#tmethod>TMethod</a> record. Can be useful to
2769 assign regular type procedure/function as event handler for
2770 event, defined as object method (do not forget, that in that
2771 case it must have first dummy parameter to replace @Self,
2772 passed in EAX to methods of object).
2773 </p>
2774 <a name="makerect"></a>
2776 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeRect</b></font>( Left, Top, Right, Bottom: <b>Integer</b> ): TRect; stdcall;</font>
2777 <br>
2778 Use it instead of VCL Rect function
2779 </p>
2780 <a name="rectsequal"></a>
2782 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RectsEqual</b></font>( <b>const</b> R1, R2: TRect ): <b>Boolean</b>;</font>
2783 <br>
2784 Returns True if rectangles R1 and R2 have the same bounds
2785 </p>
2786 <a name="rectsintersected"></a>
2788 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RectsIntersected</b></font>( <b>const</b> R1, R2: TRect ): <b>Boolean</b>;</font>
2789 <br>
2790 Returns TRUE if rectangles R1 and R2 have at least one common point.
2791 Note, that right and bottom bounds of rectangles are not their part,
2792 so, if such points are lying on that bounds, FALSE is returned.
2793 </p>
2794 <a name="pointinrect"></a>
2796 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>PointInRect</b></font>( <b>const</b> P: TPoint; <b>const</b> R: TRect ): <b>Boolean</b>;</font>
2797 <br>
2798 Returns True if point P is located in rectangle R (including
2799 left and top bounds but without right and bottom bounds of the
2800 rectangle).
2801 </p>
2802 <a name="makepoint"></a>
2804 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakePoint</b></font>( X, Y: <b>Integer</b> ): TPoint;</font>
2805 <br>
2806 Use instead of VCL function Point
2807 </p>
2808 <a name="makeflags"></a>
2810 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeFlags</b></font>( FlgSet: PDWORD; FlgArray: <b>array</b> <b>of</b> <b>Integer</b> ): <b>Integer</b>;</font>
2811 <br>
2812 </p>
2813 <a name="makedatetimerange"></a>
2815 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeDateTimeRange</b></font>( D1, D2: TDateTime ): <a href=#tdatetimerange>TDateTimeRange</a>;</font>
2816 <br>
2817 Returns <a href=#tdatetimerange>TDateTimeRange</a> from two TDateTime bounds.
2818 </p>
2819 <a name="swap"></a>
2821 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Swap</b></font>( <b>var</b> X, Y: <b>Integer</b> );</font>
2822 <br>
2823 exchanging values
2824 </p>
2825 <a name="min"></a>
2827 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Min</b></font>( X, Y: <b>Integer</b> ): <b>Integer</b>;</font>
2828 <br>
2829 minimum of two integers
2830 </p>
2831 <a name="max"></a>
2833 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Max</b></font>( X, Y: <b>Integer</b> ): <b>Integer</b>;</font>
2834 <br>
2835 maximum of two integers
2836 </p>
2837 <a name="abs"></a>
2839 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Abs</b></font>( X: <b>Integer</b> ): <b>Integer</b>;</font>
2840 <br>
2841 absolute value
2842 </p>
2843 <a name="sgn"></a>
2845 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Sgn</b></font>( X: <b>Integer</b> ): <b>Integer</b>;</font>
2846 <br>
2847 sign of X: if X &lt; 0, -1 is returned, if &gt; 0, then +1, otherwise 0.
2848 </p>
2849 <a name="isqrt"></a>
2851 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>iSqrt</b></font>( X: <b>Integer</b> ): <b>Integer</b>;</font>
2852 <br>
2853 square root
2854 <hr>
2855 <a name="String to number and number to string conversions"></a><font color=#FF8040><h1>String to number and number to string conversions</h1></font>
2857 </p>
2858 <a name="int2hex"></a>
2860 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Hex</b></font>( Value: <b>DWord</b>; Digits: <b>Integer</b> ): <b>String</b>;</font>
2861 <br>
2862 Converts integer Value into string with hex number. Digits parameter
2863 determines minimal number of digits (will be completed by adding
2864 necessary number of leading zeroes).
2865 </p>
2866 <a name="int2str"></a>
2868 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Str</b></font>( Value: <b>Integer</b> ): <b>String</b>;</font>
2869 <br>
2870 Obvious.
2871 </p>
2872 <a name="uint2str"></a>
2874 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>UInt2Str</b></font>( Value: <b>DWORD</b> ): <b>String</b>;</font>
2875 <br>
2876 The same as <a href=#int2str>Int2Str</a>, but for unsigned integer value.
2877 </p>
2878 <a name="int2strex"></a>
2880 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2StrEx</b></font>( Value, MinWidth: <b>Integer</b> ): <b>String</b>;</font>
2881 <br>
2882 Like <a href=#int2str>Int2Str</a>, but resulting string filled with leading spaces to provide
2883 at least MinWidth characters.
2884 </p>
2885 <a name="int2rome"></a>
2887 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Rome</b></font>( Value: <b>Integer</b> ): <b>String</b>;</font>
2888 <br>
2889 Represents number 1..8999 to Rome numer.
2890 </p>
2891 <a name="int2ths"></a>
2893 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Ths</b></font>( I: <b>Integer</b> ): <b>String</b>;</font>
2894 <br>
2895 Converts integer into string, separating every three digits from each
2896 other by ',' character. (Convert to thousands).
2897 </p>
2898 <a name="int2digs"></a>
2900 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Int2Digs</b></font>( Value, Digits: <b>Integer</b> ): <b>String</b>;</font>
2901 <br>
2902 Converts integer to string, inserting necessary number of leading zeroes
2903 to provide desired length of string, given by Digits parameter. If
2904 resulting string is greater then Digits, string is not truncated anyway.
2905 </p>
2906 <a name="num2bytes"></a>
2908 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Num2Bytes</b></font>( Value: <b>Double</b> ): <b>String</b>;</font>
2909 <br>
2910 Converts double float to string, considering it as a bytes count.
2911 If Value is sufficiently large, number is represented in kilobytes (with
2912 following letter K), or in megabytes (M), gigabytes (G) or terabytes (T).
2913 Resulting string number is truncated to two decimals (.XX) or to one (.X),
2914 if the second is 0.
2915 </p>
2916 <a name="s2int"></a>
2918 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>S2Int</b></font>( S: <b>PChar</b> ): <b>Integer</b>;</font>
2919 <br>
2920 Converts null-terminated string to Integer. Scanning stopped when any
2921 non-digit character found. Even empty string or string not containing
2922 valid integer number silently converted to 0.
2923 </p>
2924 <a name="str2int"></a>
2926 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2Int</b></font>( <b>const</b> Value: <b>String</b> ): <b>Integer</b>;</font>
2927 <br>
2928 Converts string to integer. First character, which can not be
2929 recognized as a part of number, regards as a separator. Even
2930 empty string or string without number silently converted to 0.
2931 </p>
2932 <a name="hex2int"></a>
2934 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Hex2Int</b></font>( <b>const</b> Value: <b>String</b> ): <b>Integer</b>;</font>
2935 <br>
2936 Converts hexadecimal number to integer. Scanning is stopped
2937 when first non-hexadicimal character is found. Leading dollar ('$')
2938 character is skept (if present). Minus ('-') is not concerning as
2939 a sign of number and also stops scanning.
2940 </p>
2941 <a name="chex2int"></a>
2943 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>cHex2Int</b></font>( <b>const</b> Value: <b>String</b> ): <b>Integer</b>;</font>
2944 <br>
2945 As <a href=#hex2int>Hex2Int</a>, but also checks for leading '0x' and skips it.
2946 </p>
2947 <a name="octal2int"></a>
2949 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Octal2Int</b></font>( <b>const</b> Value: <b>String</b> ): <b>Integer</b>;</font>
2950 <br>
2951 Converts octal number to integer. Scanning is stopped on first
2952 non-octal digit (any char except 0..7). There are no checking if
2953 there octal numer in the parameter. If the first char is not octal
2954 digit, 0 is returned.
2955 </p>
2956 <a name="binary2int"></a>
2958 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Binary2Int</b></font>( <b>const</b> Value: <b>String</b> ): <b>Integer</b>;</font>
2959 <br>
2960 Converts binary number to integer. Like <a href=#octal2int>Octal2Int</a>, but only digits
2961 0 and 1 are allowed.
2962 </p>
2963 <a name="format"></a>
2965 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Format</b></font>( <b>const</b> fmt: <b>string</b>; params: <b>array</b> <b>of</b> <b>const</b> ): <b>String</b>;</font>
2966 <br>
2967 Uses API call to wvsprintf, so does not understand extra formats,
2968 such as floating point, date/time, currency conversions. See list of
2969 available formats in win32.hlp (topic wsprintf).
2970 <hr>
2971 <a name="Working with null-terminated and ansi strings"></a><font color=#FF8040><h1>Working with null-terminated and ansi strings</h1></font>
2973 </p>
2974 <a name="strcomp"></a>
2976 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrComp</b></font>( <b>const</b> Str1, Str2: <b>PChar</b> ): <b>Integer</b>;</font>
2977 <br>
2978 Compares two strings fast. -1: Str1&lt;Str2; 0: Str1=Str2; +1: Str1&gt;Str2
2979 </p>
2980 <a name="strcomp_nocase"></a>
2982 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrComp_NoCase</b></font>( <b>const</b> Str1, Str2: <b>PChar</b> ): <b>Integer</b>;</font>
2983 <br>
2984 Compares two strings fast without case sensitivity.
2985 Returns: -1 when Str1&lt;Str2; 0 when Str1=Str2; +1 when Str1&gt;Str2
2986 </p>
2987 <a name="strlcomp"></a>
2989 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrLComp</b></font>( <b>const</b> Str1, Str2: <b>PChar</b>; MaxLen: Cardinal ): <b>Integer</b>;</font>
2990 <br>
2991 Compare two strings (fast). Terminating 0 is not considered, so if
2992 strings are equal, comparing is continued up to MaxLen bytes.
2993 Since this, pass minimum of lengths as MaxLen.
2994 </p>
2995 <a name="strlcomp_nocase"></a>
2997 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrLComp_NoCase</b></font>( <b>const</b> Str1, Str2: <b>PChar</b>; MaxLen: Cardinal ): <b>Integer</b>;</font>
2998 <br>
2999 Compare two strings fast without case sensitivity.
3000 Terminating 0 is not considered, so if strings are equal,
3001 comparing is continued up to MaxLen bytes.
3002 Since this, pass minimum of lengths as MaxLen.
3003 </p>
3004 <a name="strcopy"></a>
3006 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrCopy</b></font>( Dest, Source: <b>PChar</b> ): <b>PChar</b>;</font>
3007 <br>
3008 Copy source string to destination (fast). Pointer to Dest is returned.
3009 </p>
3010 <a name="strcat"></a>
3012 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrCat</b></font>( Dest, Source: <b>PChar</b> ): <b>PChar</b>;</font>
3013 <br>
3014 Append source string to destination (fast). Pointer to Dest is returned.
3015 </p>
3016 <a name="strlen"></a>
3018 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrLen</b></font>( <b>const</b> Str: <b>PChar</b> ): Cardinal;</font>
3019 <br>
3020 StrLen returns the number of characters in Str, not counting the null
3021 terminator.
3022 </p>
3023 <a name="strscanlen"></a>
3025 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrScanLen</b></font>( Str: <b>PChar</b>; Chr: <b>Char</b>; Len: <b>Integer</b> ): <b>PChar</b>;</font>
3026 <br>
3027 Fast scans string Str of length Len searching character Chr.
3028 Pointer to a character next to found or to Str[Len] (if no one found)
3029 is returned.
3030 </p>
3031 <a name="strscan"></a>
3033 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrScan</b></font>( Str: <b>PChar</b>; Chr: <b>Char</b> ): <b>PChar</b>;</font>
3034 <br>
3035 Fast search of given character in a string. Pointer to found character
3036 (or nil) is returned.
3037 </p>
3038 <a name="strrscan"></a>
3040 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrRScan</b></font>( <b>const</b> Str: <b>PChar</b>; Chr: <b>Char</b> ): <b>PChar</b>;</font>
3041 <br>
3042 StrRScan returns a pointer to the last occurrence of Chr in Str. If Chr
3043 does not occur in Str, StrRScan returns NIL. The null terminator is
3044 considered to be part of the string.
3045 </p>
3046 <a name="strisstartingfrom"></a>
3048 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrIsStartingFrom</b></font>( Str, Pattern: <b>PChar</b> ): <b>Boolean</b>;</font>
3049 <br>
3050 Returns True, if string Str is starting from Pattern, i.e. if
3051 Copy( Str, 1, <a href=#strlen>StrLen</a>( Pattern ) ) = Pattern. Str must not be nil!
3052 </p>
3053 <a name="strisstartingfromnocase"></a>
3055 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrIsStartingFromNoCase</b></font>( Str, Pattern: <b>PChar</b> ): <b>Boolean</b>;</font>
3056 <br>
3057 Like <a href=#strisstartingfrom>StrIsStartingFrom</a> above, but without case sensitivity.
3058 </p>
3059 <a name="trimleft"></a>
3061 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>TrimLeft</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3062 <br>
3063 Removes spaces, tabulations and control characters from the starting
3064 of string S.
3065 </p>
3066 <a name="trimright"></a>
3068 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>TrimRight</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3069 <br>
3070 Removes spaces, tabulates and other control characters from the
3071 end of string S.
3072 </p>
3073 <a name="trim"></a>
3075 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Trim</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3076 <br>
3077 Makes <a href=#trimleft>TrimLeft</a> and <a href=#trimright>TrimRight</a> for given string.
3078 </p>
3079 <a name="removespaces"></a>
3081 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RemoveSpaces</b></font>( <b>const</b> S: <b>String</b> ): <b>String</b>;</font>
3082 <br>
3083 Removes all characters less or equal to ' ' in S and returns it.
3084 </p>
3085 <a name="str2lowercase"></a>
3087 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Str2LowerCase</b></font>( S: <b>PChar</b> );</font>
3088 <br>
3089 Converts null-terminated string to lowercase (inplace).
3090 </p>
3091 <a name="lowercase"></a>
3093 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LowerCase</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3094 <br>
3095 Obvious.
3096 </p>
3097 <a name="uppercase"></a>
3099 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>UpperCase</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3100 <br>
3101 Obvious.
3102 </p>
3103 <a name="ansiuppercase"></a>
3105 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiUpperCase</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3106 <br>
3107 Obvious.
3108 </p>
3109 <a name="ansilowercase"></a>
3111 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiLowerCase</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
3112 <br>
3113 Obvious.
3114 </p>
3115 <a name="wansiuppercase"></a>
3117 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WAnsiUpperCase</b></font>( <b>const</b> S: WideString ): WideString;</font>
3118 <br>
3119 Obvious.
3120 </p>
3121 <a name="wansilowercase"></a>
3123 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WAnsiLowerCase</b></font>( <b>const</b> S: WideString ): WideString;</font>
3124 <br>
3125 Obvious.
3126 </p>
3127 <a name="ansicomparestr"></a>
3129 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiCompareStr</b></font>( <b>const</b> S1, S2: <b>string</b> ): <b>Integer</b>;</font>
3130 <br>
3131 AnsiCompareStr compares S1 to S2, with case-sensitivity. The compare
3132 operation is controlled by the current Windows locale. The return value
3133 is the same as for CompareStr.
3134 </p>
3135 <a name="_ansicomparestr"></a>
3137 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>_AnsiCompareStr</b></font>( S1, S2: <b>PChar</b> ): <b>Integer</b>;</font>
3138 <br>
3139 The same, but for PChar ANSI strings
3140 </p>
3141 <a name="ansicomparestrnocase"></a>
3143 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiCompareStrNoCase</b></font>( <b>const</b> S1, S2: <b>string</b> ): <b>Integer</b>;</font>
3144 <br>
3145 <a href=#ansicomparestr>AnsiCompareStr</a> compares S1 to S2, with case-sensitivity. The compare
3146 operation is controlled by the current Windows locale. The return value
3147 is the same as for CompareStr.
3148 </p>
3149 <a name="_ansicomparestrnocase"></a>
3151 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>_AnsiCompareStrNoCase</b></font>( S1, S2: <b>PChar</b> ): <b>Integer</b>;</font>
3152 <br>
3153 The same, but for PChar ANSI strings
3154 </p>
3155 <a name="ansicomparetext"></a>
3157 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiCompareText</b></font>( <b>const</b> S1, S2: <b>String</b> ): <b>Integer</b>;</font>
3158 <br>
3159 </p>
3160 <a name="lstrfrompwcharlen"></a>
3162 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LStrFromPWCharLen</b></font>( Source: PWideChar; Length: <b>Integer</b> ): <b>String</b>;</font>
3163 <br>
3164 from Delphi5 - because D2 does not contain it.
3165 </p>
3166 <a name="lstrfrompwchar"></a>
3168 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>LStrFromPWChar</b></font>( Source: PWideChar ): <b>String</b>;</font>
3169 <br>
3170 from Delphi5 - because D2 does not contain it.
3171 </p>
3172 <a name="copyend"></a>
3174 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CopyEnd</b></font>( <b>const</b> S: <b>String</b>; Idx: <b>Integer</b> ): <b>String</b>;</font>
3175 <br>
3176 Returns copy of source string S starting from Idx up to the end of
3177 string S. Works correctly for case, when Idx &gt; Length( S ) (returns
3178 empty string for such case).
3179 </p>
3180 <a name="copytail"></a>
3182 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CopyTail</b></font>( <b>const</b> S: <b>String</b>; Len: <b>Integer</b> ): <b>String</b>;</font>
3183 <br>
3184 Returns last Len characters of the source string. If Len &gt; Length( S ),
3185 entire string S is returned.
3186 </p>
3187 <a name="deletetail"></a>
3189 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DeleteTail</b></font>( <b>var</b> S: <b>String</b>; Len: <b>Integer</b> );</font>
3190 <br>
3191 Deletes last Len characters from string.
3192 </p>
3193 <a name="indexofchar"></a>
3195 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IndexOfChar</b></font>( <b>const</b> S: <b>String</b>; Chr: <b>Char</b> ): <b>Integer</b>;</font>
3196 <br>
3197 Returns index of given character (1..Length(S)), or
3198 -1 if a character not found.
3199 </p>
3200 <a name="indexofcharsmin"></a>
3202 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IndexOfCharsMin</b></font>( <b>const</b> S, Chars: <b>String</b> ): <b>Integer</b>;</font>
3203 <br>
3204 Returns index (in string S) of those character, what is taking place
3205 in Chars string and located nearest to start of S. If no such
3206 characters in string S found, -1 is returned.
3207 </p>
3208 <a name="indexofwidecharsmin"></a>
3210 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IndexOfWideCharsMin</b></font>( <b>const</b> S, Chars: WideString ): <b>Integer</b>;</font>
3211 <br>
3212 Returns index (in wide string S) of those wide character, what
3213 is taking place in Chars wide string and located nearest to start of S.
3214 If no such characters in string S found, -1 is returned.
3215 </p>
3216 <a name="indexofstr"></a>
3218 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IndexOfStr</b></font>( <b>const</b> S, Sub: <b>String</b> ): <b>Integer</b>;</font>
3219 <br>
3220 Returns index of given substring in source string S. If found,
3221 1..Length(S)-Length(Sub), if not found, -1.
3222 </p>
3223 <a name="parse"></a>
3225 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Parse</b></font>( <b>var</b> S: <b>String</b>; <b>const</b> Separators: <b>String</b> ): <b>String</b>;</font>
3226 <br>
3227 Returns first characters of string S, separated from others by
3228 one of characters, taking place in Separators string, assigning
3229 a tail of string (after found separator) to source string. If
3230 no separator characters found, source string S is returned, and
3231 source string itself becomes empty.
3232 </p>
3233 <a name="wparse"></a>
3235 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WParse</b></font>( <b>var</b> S: WideString; <b>const</b> Separators: WideString ): WideString;</font>
3236 <br>
3237 Returns first wide characters of wide string S, separated from others
3238 by one of wide characters, taking place in Separators wide string,
3239 assigning a tail of wide string (following found separator) to the
3240 source one. If there are no separator characters found, source wide
3241 string S is returned, and source wide string itself becomes empty.
3242 </p>
3243 <a name="parsepascalstring"></a>
3245 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ParsePascalString</b></font>( <b>var</b> S: <b>String</b>; <b>const</b> Separators: <b>String</b> ): <b>String</b>;</font>
3246 <br>
3247 Returns first characters of string S, separated from others by
3248 one of characters, taking place in Separators string, assigning
3249 a tail of string (after the found separator) to source string. If
3250 there are no separator characters found, the source string S is returned,
3251 and the source string itself becomes empty. Additionally: if the first (after
3252 a blank space) is the quote &quot;'&quot; or '#', pascal string is assumung first
3253 and is converted to usual string (without quotas) before analizing
3254 of other separators.
3255 </p>
3256 <a name="string2pascalstrexpr"></a>
3258 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>String2PascalStrExpr</b></font>( <b>const</b> S: <b>String</b> ): <b>String</b>;</font>
3259 <br>
3260 Converts string to Pascal-like string expression (concatenation of
3261 strings with quotas and characters with leading '#').
3262 </p>
3263 <a name="streq"></a>
3265 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrEq</b></font>( <b>const</b> S1, S2: <b>String</b> ): <b>Boolean</b>;</font>
3266 <br>
3267 Returns True, if <a href=#lowercase>LowerCase</a>(S1) = <a href=#lowercase>LowerCase</a>(S2). I.e., if strings
3268 are equal to each other without caring of characters case sensitivity
3269 (ASCII only).
3270 </p>
3271 <a name="ansieq"></a>
3273 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AnsiEq</b></font>( <b>const</b> S1, S2: <b>String</b> ): <b>Boolean</b>;</font>
3274 <br>
3275 Returns True, if <a href=#ansilowercase>AnsiLowerCase</a>(S1) = <a href=#ansilowercase>AnsiLowerCase</a>(S2). I.e., if ANSI
3276 stringsare equal to each other without caring of characters case
3277 sensitivity.
3278 </p>
3279 <a name="wansieq"></a>
3281 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WAnsiEq</b></font>( <b>const</b> S1, S2: WideString ): <b>Boolean</b>;</font>
3282 <br>
3283 Returns True, if <a href=#ansilowercase>AnsiLowerCase</a>(S1) = <a href=#ansilowercase>AnsiLowerCase</a>(S2). I.e., if ANSI
3284 stringsare equal to each other without caring of characters case
3285 sensitivity.
3286 </p>
3287 <a name="strin"></a>
3289 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrIn</b></font>( <b>const</b> S: <b>String</b>; <b>const</b> A: <b>array</b> <b>of</b> <b>String</b> ): <b>Boolean</b>;</font>
3290 <br>
3291 Returns True, if S is &quot;equal&quot; to one of strings, taking place
3292 in A array. To check equality, <a href=#streq>StrEq</a> function is used, i.e.
3293 comaprison is taking place without case sensitivity.
3294 </p>
3295 <a name="wstrin"></a>
3297 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WStrIn</b></font>( <b>const</b> S: WideString; <b>const</b> A: <b>array</b> <b>of</b> WideString ): <b>Boolean</b>;</font>
3298 <br>
3299 Returns True, if S is &quot;equal&quot; to one of strings, taking place
3300 in A array. To check equality, <a href=#wansieq>WAnsiEq</a> function is used, i.e.
3301 comaprison is taking place without case sensitivity.
3302 </p>
3303 <a name="stris"></a>
3305 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrIs</b></font>( <b>const</b> S: <b>String</b>; <b>const</b> A: <b>array</b> <b>of</b> <b>String</b>; <b>var</b> Idx: <b>Integer</b> ): <b>Boolean</b>;</font>
3306 <br>
3307 Returns True, if S is &quot;equal&quot; to one of strings, taking place
3308 in A array, and in such Case Idx also is assigned to an index of A element
3309 equal to S. To check equality, <a href=#streq>StrEq</a> function is used, i.e.
3310 comaprison is taking place without case sensitivity.
3311 </p>
3312 <a name="intin"></a>
3314 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IntIn</b></font>( Value: <b>Integer</b>; <b>const</b> List: <b>array</b> <b>of</b> <b>Integer</b> ): <b>Boolean</b>;</font>
3315 <br>
3316 Returns TRUE, if Value is found in a List.
3317 </p>
3318 <a name="_strsatisfy"></a>
3320 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>_StrSatisfy</b></font>( S, Mask: <b>PChar</b> ): <b>Boolean</b>;</font>
3321 <br>
3322 </p>
3323 <a name="_2strsatisfy"></a>
3325 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>_2StrSatisfy</b></font>( S, Mask: <b>PChar</b> ): <b>Boolean</b>;</font>
3326 <br>
3327 </p>
3328 <a name="strsatisfy"></a>
3330 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrSatisfy</b></font>( <b>const</b> S, Mask: <b>String</b> ): <b>Boolean</b>;</font>
3331 <br>
3332 Returns True, if S is satisfying to a given Mask (which can contain
3333 wildcard symbols '*' and '?' interpeted correspondently as 'any
3334 set of characters' and 'single any character'. If there are no
3335 such wildcard symbols in a Mask, result is True only if S is maching
3336 to Mask string.)
3337 </p>
3338 <a name="strreplace"></a>
3340 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrReplace</b></font>( <b>var</b> S: <b>String</b>; <b>const</b> From, ReplTo: <b>String</b> ): <b>Boolean</b>;</font>
3341 <br>
3342 Replaces first occurance of From to ReplTo in S, returns True,
3343 if pattern From was found and replaced.
3344 </p>
3345 <a name="wstrreplace"></a>
3347 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WStrReplace</b></font>( <b>var</b> S: WideString; <b>const</b> From, ReplTo: WideString ): <b>Boolean</b>;</font>
3348 <br>
3349 Replaces first occurance of From to ReplTo in S, returns True,
3350 if pattern From was found and replaced. See also function <a href=#strreplace>StrReplace</a>.
3351 This function is not available in Delphi2 (this version of Delphi
3352 does not support WideString type).
3353 </p>
3354 <a name="strrepeat"></a>
3356 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrRepeat</b></font>( <b>const</b> S: <b>String</b>; Count: <b>Integer</b> ): <b>String</b>;</font>
3357 <br>
3358 Repeats given string Count times. E.g., StrRepeat( 'A', 5 ) gives 'AAAAA'.
3359 </p>
3360 <a name="wstrrepeat"></a>
3362 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WStrRepeat</b></font>( <b>const</b> S: WideString; Count: <b>Integer</b> ): WideString;</font>
3363 <br>
3364 Repeats given wide string Count times. E.g., <a href=#strrepeat>StrRepeat</a>( 'A', 5 ) gives 'AAAAA'.
3365 </p>
3366 <a name="normalizeunixtext"></a>
3368 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>NormalizeUnixText</b></font>( <b>var</b> S: <b>String</b> );</font>
3369 <br>
3370 In the string S, replaces all occurances of character #10 (without leading #13)
3371 to the character #13.
3372 </p>
3373 <a name="wstrlen"></a>
3375 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WStrLen</b></font>( W: PWideChar ): <b>Integer</b>;</font>
3376 <br>
3377 Returns Length of null-terminated Unicode string.
3378 </p>
3379 <a name="wstrcopy"></a>
3381 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>WStrCopy</b></font>( Dest, Src: PWideChar );</font>
3382 <br>
3383 Copies null-terminated Unicode string (terminated null also copied).
3384 </p>
3385 <a name="wstrcmp"></a>
3387 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WStrCmp</b></font>( W1, W2: PWideChar ): <b>Integer</b>;</font>
3388 <br>
3389 Compares two null-terminated Unicode strings.
3390 </p>
3391 <a name="strpcopy"></a>
3393 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrPCopy</b></font>( Dest: <b>PChar</b>; <b>const</b> Source: <b>string</b> ): <b>PChar</b>;</font>
3394 <br>
3395 Copyes Pascal-style string into null-terminaed one.
3396 </p>
3397 <a name="strlcopy"></a>
3399 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrLCopy</b></font>( Dest: <b>PChar</b>; <b>const</b> Source: <b>PChar</b>; MaxLen: Cardinal ): <b>PChar</b>;</font>
3400 <br>
3401 Copyes first MaxLen characters of Pascal-style string into
3402 null-terminated one.
3403 </p>
3404 <a name="delimiterlast"></a>
3406 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DelimiterLast</b></font>( <b>const</b> Str, Delimiters: <b>String</b> ): <b>Integer</b>;</font>
3407 <br>
3408 Returns index of the last of delimiters given by same named parameter
3409 among characters of Str. If there are no delimiters found, length of
3410 Str is returned. This function is intended mainly to use in filename
3411 parsing functions.
3412 </p>
3413 <a name="__delimiterlast"></a>
3415 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>__DelimiterLast</b></font>( Str, Delimiters: <b>PChar</b> ): <b>PChar</b>;</font>
3416 <br>
3417 Returns address of the last of delimiters given by Delimiters parameter
3418 among characters of Str. If there are no delimeters found, position of
3419 the null terminator in Str is returned. This function is intended
3420 mainly to use in filename parsing functions.
3421 </p>
3422 <a name="skipspaces"></a>
3424 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SkipSpaces</b></font>( P: <b>PChar</b> ): <b>PChar</b>;</font>
3425 <br>
3426 Skips all characters #1..' ' in a string.
3427 </p>
3428 <a name="comparemem"></a>
3430 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CompareMem</b></font>( P1, P2: <b>Pointer</b>; Length: <b>Integer</b> ): <b>Boolean</b>;</font>
3431 <br>
3432 Fast compare of two memory blocks.
3433 </p>
3434 <a name="allocmem"></a>
3436 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AllocMem</b></font>( Size: <b>Integer</b> ): <b>Pointer</b>;</font>
3437 <br>
3438 Allocates global memory and unlocks it.
3439 </p>
3440 <a name="disposemem"></a>
3442 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DisposeMem</b></font>( <b>var</b> Addr: <b>Pointer</b> );</font>
3443 <br>
3444 Locks global memory block given by pointer, and frees it.
3445 Does nothing, if the pointer is nil.
3446 <hr>
3447 <a name="Text in clipboard operations"></a><font color=#FF8040><h1>Text in clipboard operations</h1></font>
3449 </p>
3450 <a name="clipboard2text"></a>
3452 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Clipboard2Text</b></font>: <b>String</b>;</font>
3453 <br>
3454 If clipboard contains text, this function returns it for You.
3455 </p>
3456 <a name="clipboard2wtext"></a>
3458 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Clipboard2WText</b></font>: WideString;</font>
3459 <br>
3460 If clipboard contains text, this function returns it for You (as Unicode string).
3461 </p>
3462 <a name="text2clipboard"></a>
3464 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Text2Clipboard</b></font>( <b>const</b> S: <b>String</b> ): <b>Boolean</b>;</font>
3465 <br>
3466 Puts given string to a clipboard.
3467 </p>
3468 <a name="wtext2clipboard"></a>
3470 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WText2Clipboard</b></font>( <b>const</b> WS: WideString ): <b>Boolean</b>;</font>
3471 <br>
3472 Puts given Unicode string to a clipboard.
3473 <hr>
3474 </p>
3475 <a name="supportansimnemonics"></a>
3477 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SupportAnsiMnemonics</b></font>( LocaleID: <b>Integer</b> );</font>
3478 <br>
3479 Provides encoding to work with given locale. Call this global function to
3480 extend TControl.SupportMnemonics capability (also should be called for a form
3481 or for <a href=#applet>Applet</a> variable).
3482 <a name="Date and time handling"></a><font color=#FF8040><h1>Date and time handling</h1></font>
3484 </p>
3485 <a name="tdateformat"></a>
3487 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TDateFormat</b></font> =( dfShortDate, dfLongDate );</font>
3488 <br>
3489 <a href=#date>Date</a> formats available to use in formatting date/time to string.
3490 </p>
3491 <a name="ttimeformatflag"></a>
3493 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTimeFormatFlag</b></font> =( tffNoMinutes, tffNoSeconds, tffNoMarker, tffForce24 );</font>
3494 <br>
3495 Additional flags, used for formatting time.
3496 </p>
3497 <a name="ttimeformatflags"></a>
3499 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TTimeFormatFlags</b></font> = <b>Set</b> <b>of</b> <a href=#ttimeformatflag>TTimeFormatFlag</a>;</font>
3500 <br>
3501 Set of flags, used for formatting time.
3502 </p>
3503 <a name="monthdays"></a>
3505 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>MonthDays</b></font>: array[ <b>Boolean</b> ] <b>of</b> TDayTable =(( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ),( 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ) );</font>
3506 <br>
3507 The MonthDays array can be used to quickly find the number of
3508 days in a month: MonthDays[<a href=#isleapyear>IsLeapYear</a>(Y), M].
3509 </p>
3510 <a name="secsperday"></a>
3512 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>SecsPerDay</b></font> = 24* 60* 60;</font>
3513 <br>
3514 Seconds per day.
3515 </p>
3516 <a name="msecsperday"></a>
3518 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>MSecsPerDay</b></font> = SecsPerDay* 1000;</font>
3519 <br>
3520 Milliseconds per day.
3521 </p>
3522 <a name="vcldate0"></a>
3524 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>VCLDate0</b></font> = 693594;</font>
3525 <br>
3526 Value to convert VCL &quot;date 0&quot; to KOL &quot;date 0&quot; and back.
3527 This value corresponds to 30-Dec-1899, 0:00:00. So,
3528 to convert VCL date to KOL date, just subtract this
3529 value from VCL date. And to convert back from KOL date
3530 to VCL date, add this value to KOL date.
3531 </p>
3532 <a name="now"></a>
3534 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Now</b></font>: TDateTime;</font>
3535 <br>
3536 Returns local date and time on running PC.
3537 </p>
3538 <a name="date"></a>
3540 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Date</b></font>: TDateTime;</font>
3541 <br>
3542 Returns todaylocal date.
3543 </p>
3544 <a name="decodedatefully"></a>
3546 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DecodeDateFully</b></font>( DateTime: TDateTime; <b>var</b> Year, Month, Day, <a href=#dayofweek>DayOfWeek</a>: <b>WORD</b> );</font>
3547 <br>
3548 Decodes date.
3549 </p>
3550 <a name="decodedate"></a>
3552 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DecodeDate</b></font>( DateTime: TDateTime; <b>var</b> Year, Month, Day: <b>WORD</b> );</font>
3553 <br>
3554 Decodes date.
3555 </p>
3556 <a name="encodedate"></a>
3558 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>EncodeDate</b></font>( Year, Month, Day: <b>WORD</b>; <b>var</b> DateTime: TDateTime ): <b>Boolean</b>;</font>
3559 <br>
3560 Encodes date.
3561 </p>
3562 <a name="comparesystemtime"></a>
3564 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CompareSystemTime</b></font>( <b>const</b> D1, D2: TSystemTime ): <b>Integer</b>;</font>
3565 <br>
3566 Compares to TSystemTime records. Returns -1, 0, or 1 if, correspondantly,
3567 D1 &lt; D2, D1 = D2 and D1 &gt; D2.
3568 </p>
3569 <a name="incdays"></a>
3571 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>IncDays</b></font>( <b>var</b> SystemTime: TSystemTime; DaysNum: <b>Integer</b> );</font>
3572 <br>
3573 Increases/decreases day in TSystemTime record onto given days count
3574 (can be negative).
3575 </p>
3576 <a name="incmonths"></a>
3578 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>IncMonths</b></font>( <b>var</b> SystemTime: TSystemTime; MonthsNum: <b>Integer</b> );</font>
3579 <br>
3580 Increases/decreases month number in TSystemTime record onto given
3581 months count (can be negative). Correct result is not garantee if
3582 day number is incorrect for newly obtained month.
3583 </p>
3584 <a name="isleapyear"></a>
3586 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IsLeapYear</b></font>( Year: <b>Word</b> ): <b>Boolean</b>;</font>
3587 <br>
3588 Returns True, if given year is &quot;leap&quot; (i.e. has 29 days in the February).
3589 </p>
3590 <a name="dayofweek"></a>
3592 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DayOfWeek</b></font>( <a href=#date>Date</a>: TDateTime ): <b>Integer</b>;</font>
3593 <br>
3594 Returns day of week (0..6) for given date.
3595 </p>
3596 <a name="systemtime2datetime"></a>
3598 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SystemTime2DateTime</b></font>( <b>const</b> SystemTime: TSystemTime; <b>var</b> DateTime: TDateTime ): <b>Boolean</b>;</font>
3599 <br>
3600 Converts TSystemTime record to XDateTime variable.
3601 </p>
3602 <a name="datetime2systemtime"></a>
3604 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DateTime2SystemTime</b></font>( <b>const</b> DateTime: TDateTime; <b>var</b> SystemTime: TSystemTime ): <b>Boolean</b>;</font>
3605 <br>
3606 Converts TDateTime variable to TSystemTime record.
3607 </p>
3608 <a name="datetime_system2local"></a>
3610 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DateTime_System2Local</b></font>( DTSys: TDateTime ): TDateTime;</font>
3611 <br>
3612 Converts DTSys representing system time (+0 Grinvich) to local time.
3613 </p>
3614 <a name="datetime_local2system"></a>
3616 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DateTime_Local2System</b></font>( DTLoc: TDateTime ): TDateTime;</font>
3617 <br>
3618 Converts DTLoc representing local time to system time (+0 Grinvich)
3619 </p>
3620 <a name="catholiceaster"></a>
3622 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CatholicEaster</b></font>( nYear: <b>Integer</b> ): TDateTime;</font>
3623 <br>
3624 Returns date of catholic easter for given year.
3625 </p>
3626 <a name="divmod"></a>
3628 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DivMod</b></font>( Dividend: <b>Integer</b>; Divisor: <b>Word</b>; <b>var</b> Result, Remainder: <b>Word</b> );</font>
3629 <br>
3630 Dividing of integer onto divisor with obtaining both result of division
3631 and remainder.
3632 </p>
3633 <a name="systemdate2str"></a>
3635 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SystemDate2Str</b></font>( <b>const</b> SystemTime: TSystemTime; <b>const</b> LocaleID: <b>DWORD</b>; <b>const</b> DfltDateFormat: <a href=#tdateformat>TDateFormat</a>; <b>const</b> DateFormat: <b>PChar</b> ): <b>String</b>;</font>
3636 <br>
3637 Formats date, stored in TSystemTime record into string, using given locale
3638 and date/time formatting flags.
3639 </p>
3640 <a name="systemtime2str"></a>
3642 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>SystemTime2Str</b></font>( <b>const</b> SystemTime: TSystemTime; <b>const</b> LocaleID: <b>DWORD</b>; <b>const</b> Flags: <a href=#ttimeformatflags>TTimeFormatFlags</a>; <b>const</b> TimeFormat: <b>PChar</b> ): <b>String</b>;</font>
3643 <br>
3644 Formats time, stored in TSystemTime record into string, using given locale
3645 and date/time formatting flags.
3646 </p>
3647 <a name="date2strfmt"></a>
3649 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Date2StrFmt</b></font>( <b>const</b> Fmt: <b>String</b>; D: TDateTime ): <b>String</b>;</font>
3650 <br>
3651 Represents date as a string correspondently to Fmt formatting string.
3652 See possible pictures in definition of the function <a href=#str2datetimefmt>Str2DateTimeFmt</a>
3653 (the first part). If Fmt string is empty, default system date format
3654 for short date string used.
3655 </p>
3656 <a name="time2strfmt"></a>
3658 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Time2StrFmt</b></font>( <b>const</b> Fmt: <b>String</b>; D: TDateTime ): <b>String</b>;</font>
3659 <br>
3660 Represents time as a string correspondently to Fmt formatting string.
3661 See possible pictures in definition of the function <a href=#str2datetimefmt>Str2DateTimeFmt</a>
3662 (the second part). If Fmt string is empty, default system time format
3663 for short date string used.
3664 </p>
3665 <a name="datetime2strshort"></a>
3667 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DateTime2StrShort</b></font>( D: TDateTime ): <b>String</b>;</font>
3668 <br>
3669 Formats date and time to string in short date format using current user
3670 locale.
3671 </p>
3672 <a name="str2datetimefmt"></a>
3674 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2DateTimeFmt</b></font>( <b>const</b> sFmtStr, sS: <b>String</b> ): TDateTime;</font>
3675 <br>
3676 Restores date or/and time from string correspondently to a format string.
3677 <a href=#date>Date</a> and time formatting string can contain following pictures (case
3678 sensitive):
3679 <pre>
3680 DATE PICTURES
3681 d Day of the month as digits without leading zeros for single digit days.
3682 dd Day of the month as digits with leading zeros for single digit days
3683 ddd Day of the week as a 3-letter abbreviation as specified by a
3684 LOCALE_SABBREVDAYNAME value.
3685 dddd Day of the week as specified by a LOCALE_SDAYNAME value.
3686 M Month as digits without leading zeros for single digit months.
3687 MM Month as digits with leading zeros for single digit months
3688 MMM Month as a three letter abbreviation as specified by a LOCALE_SABBREVMONTHNAME value.
3689 MMMM Month as specified by a LOCALE_SMONTHNAME value.
3690 y Year represented only be the last digit.
3691 yy Year represented only be the last two digits.
3692 yyyy Year represented by the full 4 digits.
3693 gg Period/era string as specified by the CAL_SERASTRING value. The gg
3694 format picture in a date string is ignored if there is no associated era
3695 string. In Enlish locales, usual values are BC or AD.
3696 TIME PICTURES
3697 h Hours without leading zeros for single-digit hours (12-hour clock).
3698 hh Hours with leading zeros for single-digit hours (12-hour clock).
3699 H Hours without leading zeros for single-digit hours (24-hour clock).
3700 HH Hours with leading zeros for single-digit hours (24-hour clock).
3701 m Minutes without leading zeros for single-digit minutes.
3702 mm Minutes with leading zeros for single-digit minutes.
3703 s Seconds without leading zeros for single-digit seconds.
3704 ss Seconds with leading zeros for single-digit seconds.
3705 t One character–time marker string (usually P or A, in English locales).
3706 tt Multicharacter–time marker string (usually PM or AM, in English locales).
3707 </pre>
3708 E.g., 'D, yyyy/MM/dd h:mm:ss'.
3709 See also <a href=#str2datetimeshort>Str2DateTimeShort</a> function.
3710 </p>
3711 <a name="str2datetimeshort"></a>
3713 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2DateTimeShort</b></font>( <b>const</b> S: <b>String</b> ): TDateTime;</font>
3714 <br>
3715 Restores date and time from string correspondently to current user locale.
3716 </p>
3717 <a name="str2datetimeshortex"></a>
3719 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Str2DateTimeShortEx</b></font>( <b>const</b> S: <b>String</b> ): TDateTime;</font>
3720 <br>
3721 Like <a href=#str2datetimeshort>Str2DateTimeShort</a> above, but uses locale defined date and time
3722 separators to avoid recognizing time as a date in some cases.
3723 <hr>
3724 <a name="File and directory routines"></a><font color=#FF8040><h1>File and directory routines</h1></font>
3726 </p>
3727 <a name="ofopenread"></a>
3729 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofOpenRead</b></font> = $80000000;</font>
3730 <br>
3731 Use this flag (in combination with others) to open file for &quot;read&quot; only.
3732 </p>
3733 <a name="ofopenwrite"></a>
3735 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofOpenWrite</b></font> = $40000000;</font>
3736 <br>
3737 Use this flag (in combination with others) to open file for &quot;write&quot; only.
3738 </p>
3739 <a name="ofopenreadwrite"></a>
3741 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofOpenReadWrite</b></font> = $C0000000;</font>
3742 <br>
3743 Use this flag (in combination with others) to open file for &quot;read&quot; and &quot;write&quot;.
3744 </p>
3745 <a name="ofshareexclusive"></a>
3747 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofShareExclusive</b></font> = $00;</font>
3748 <br>
3749 Use this flag (in combination with others) to open file for exclusive use.
3750 </p>
3751 <a name="ofsharedenywrite"></a>
3753 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofShareDenyWrite</b></font> = $01;</font>
3754 <br>
3755 Use this flag (in combination with others) to open file in share mode, when
3756 only attempts to open it in other process for &quot;write&quot; will be impossible.
3757 I.e., other processes could open this file simultaneously for read only
3758 access.
3759 </p>
3760 <a name="ofsharedenyread"></a>
3762 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofShareDenyRead</b></font> = $02;</font>
3763 <br>
3764 Use this flag (in combination with others) to open file in share mode, when
3765 only attempts to open it for &quot;read&quot; in other processes will be disabled.
3766 I.e., other processes could open it for &quot;write&quot; only access.
3767 </p>
3768 <a name="ofsharedenynone"></a>
3770 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofShareDenyNone</b></font> = $03;</font>
3771 <br>
3772 Use this flag (in combination with others) to open file in full sharing mode.
3773 I.e. any process will be able open this file using the same share flag.
3774 </p>
3775 <a name="ofcreatenew"></a>
3777 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofCreateNew</b></font> = $100;</font>
3778 <br>
3779 Default creation disposition. Use this flag for creating new file (usually
3780 for write access.
3781 </p>
3782 <a name="ofcreatealways"></a>
3784 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofCreateAlways</b></font> = $200;</font>
3785 <br>
3786 Use this flag (in combination with others) to open existing or creating new
3787 file. If existing file is opened, it is truncated to size 0.
3788 </p>
3789 <a name="ofopenexisting"></a>
3791 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofOpenExisting</b></font> = $300;</font>
3792 <br>
3793 Use this flag (in combination with others) to open existing file only.
3794 </p>
3795 <a name="ofopenalways"></a>
3797 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofOpenAlways</b></font> = $400;</font>
3798 <br>
3799 Use this flag (in combination with others) to open existing or create new
3800 (if such file is not yet exists).
3801 </p>
3802 <a name="oftruncateexisting"></a>
3804 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofTruncateExisting</b></font> = $500;</font>
3805 <br>
3806 Use this flag (in combination with others) to open existing file and truncate
3807 it to size 0.
3808 </p>
3809 <a name="ofattrreadonly"></a>
3811 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrReadOnly</b></font> = $10000;</font>
3812 <br>
3813 Use this flag to create Read-Only file (?).
3814 </p>
3815 <a name="ofattrhidden"></a>
3817 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrHidden</b></font> = $20000;</font>
3818 <br>
3819 Use this flag to create hidden file.
3820 </p>
3821 <a name="ofattrsystem"></a>
3823 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrSystem</b></font> = $40000;</font>
3824 <br>
3825 Use this flag to create system file.
3826 </p>
3827 <a name="ofattrtemp"></a>
3829 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrTemp</b></font> = $1000000;</font>
3830 <br>
3831 Use this flag to create temp file.
3832 </p>
3833 <a name="ofattrarchive"></a>
3835 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrArchive</b></font> = $200000;</font>
3836 <br>
3837 Use this flag to create archive file.
3838 </p>
3839 <a name="ofattrcompressed"></a>
3841 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrCompressed</b></font> = $8000000;</font>
3842 <br>
3843 Use this flag to create compressed file. Has effect only on NTFS, and
3844 only if ofAttrCompressed is not specified also.
3845 </p>
3846 <a name="ofattroffline"></a>
3848 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>ofAttrOffline</b></font> = $10000000;</font>
3849 <br>
3850 Use this flag to create offline file.
3851 </p>
3852 <a name="filecreate"></a>
3854 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileCreate</b></font>( <b>const</b> FileName: <b>string</b>; OpenFlags: <b>DWord</b> ): THandle;</font>
3855 <br>
3856 Call this function to open existing or create new file. OpenFlags
3857 parameter can be a combination of up to three flags (by one from
3858 each group:
3859 <table border=0>
3860 <tr><td valign=top>ofOpenRead, ofOpenWrite, ofOpenReadWrite</td><td valign=top>
3861 - 1st group. Here You decide
3862 wish You open file for read, write or read-and-write operations;
3863 </td></tr>
3865 <tr><td valign=top>ofShareExclusive, ofShareDenyWrite, ofShareDenyRead, ofShareDenyNone</td><td valign=top>
3866 -2nd
3867 group - sharing. Here You can mark out sharing mode, which is used to
3868 open file.
3869 </td></tr>
3871 <tr><td valign=top>ofCreateNew, ofCreateAlways, ofOpenExisting, ofOpenAlways, ofTruncateExisting</td><td valign=top>
3873 - 3rd group - creation disposition. Here You determine, either to create new
3874 or open existing file and if to truncate existing or not.
3875 </table>
3876 </p>
3877 <a name="fileclose"></a>
3879 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileClose</b></font>( Handle: THandle ): <b>Boolean</b>;</font>
3880 <br>
3881 Call it to close opened earlier file.
3882 </p>
3883 <a name="fileexists"></a>
3885 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileExists</b></font>( <b>const</b> FileName: <b>String</b> ): <b>Boolean</b>;</font>
3886 <br>
3887 Returns True, if given file exists.
3888 <br>Note (by Dod):
3889 It is not documented in a help for GetFileAttributes, but it seems that
3890 under NT-based Windows systems, FALSE is always returned for files
3891 opened for excluseve use like pagefile.sys.
3892 </p>
3893 <a name="fileread"></a>
3895 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileRead</b></font>( Handle: THandle; <b>var</b> Buffer; Count: <b>DWord</b> ): <b>DWord</b>;</font>
3896 <br>
3897 Reads bytes from current position in file to buffer. Returns number of
3898 read bytes.
3899 </p>
3900 <a name="file2str"></a>
3902 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>File2Str</b></font>( Handle: THandle ): <b>String</b>;</font>
3903 <br>
3904 Reads file from current position to the end and returns result as ansi string.
3905 </p>
3906 <a name="fileseek"></a>
3908 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileSeek</b></font>( Handle: THandle; MoveTo: <b>integer</b>; MoveMethod: TMoveMethod ): <b>DWord</b>;</font>
3909 <br>
3910 Changes current position in file.
3911 </p>
3912 <a name="filewrite"></a>
3914 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileWrite</b></font>( Handle: THandle; <b>const</b> Buffer; Count: <b>DWord</b> ): <b>DWord</b>;</font>
3915 <br>
3916 Writes bytes from buffer to file from current position, extending its
3917 size if needed.
3918 </p>
3919 <a name="fileeof"></a>
3921 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileEOF</b></font>( Handle: THandle ): <b>Boolean</b>;</font>
3922 <br>
3923 Returns True, if EOF is achieved during read operations or last byte is
3924 overwritten or append made to extend file during last write operation.
3925 </p>
3926 <a name="filefullpath"></a>
3928 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileFullPath</b></font>( <b>const</b> FileName: <b>String</b> ): <b>String</b>;</font>
3929 <br>
3930 Returns full path name for given file. Validness of source FileName path
3931 is not checked at all.
3932 </p>
3933 <a name="fileshortpath"></a>
3935 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileShortPath</b></font>( <b>const</b> FileName: <b>String</b> ): <b>String</b>;</font>
3936 <br>
3937 Returns short path to the file or directory.
3938 </p>
3939 <a name="fileiconsystemidx"></a>
3941 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileIconSystemIdx</b></font>( <b>const</b> Path: <b>String</b> ): <b>Integer</b>;</font>
3942 <br>
3943 Returns index of the index of the system icon correspondent to the file or
3944 directory in system icon image list.
3945 </p>
3946 <a name="fileiconsysidxoffline"></a>
3948 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileIconSysIdxOffline</b></font>( <b>const</b> Path: <b>String</b> ): <b>Integer</b>;</font>
3949 <br>
3950 The same as <a href=#fileiconsystemidx>FileIconSystemIdx</a>, but an icon is calculated for the file
3951 as it were offline (it is possible to get an icon for file even if
3952 it is not existing, on base of its extension only).
3953 </p>
3954 <a name="logfileoutput"></a>
3956 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LogFileOutput</b></font>( <b>const</b> filepath, str: <b>String</b> );</font>
3957 <br>
3958 Debug function. Use it to append given string to the end of the given file.
3959 </p>
3960 <a name="strsavetofile"></a>
3962 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrSaveToFile</b></font>( <b>const</b> Filename, Str: <b>String</b> ): <b>Boolean</b>;</font>
3963 <br>
3964 Saves a string to a file without any changes. If file does not exists, it is
3965 created. If it exists, it is overriden. If operation failed, FALSE is returned.
3966 </p>
3967 <a name="strloadfromfile"></a>
3969 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>StrLoadFromFile</b></font>( <b>const</b> Filename: <b>String</b> ): <b>String</b>;</font>
3970 <br>
3971 Reads entire file and returns its content as a string. If operation failed,
3972 an empty strinng is returned.
3973 </p>
3974 <a name="mem2file"></a>
3976 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Mem2File</b></font>( Filename: <b>PChar</b>; Mem: <b>Pointer</b>; Len: <b>Integer</b> ): <b>Integer</b>;</font>
3977 <br>
3978 Saves memory block to a file (if file exists it is overriden, created new if
3979 not exists).
3980 </p>
3981 <a name="file2mem"></a>
3983 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>File2Mem</b></font>( Filename: <b>PChar</b>; Mem: <b>Pointer</b>; MaxLen: <b>Integer</b> ): <b>Integer</b>;</font>
3984 <br>
3985 Loads file content to memory.
3986 </p>
3987 <a name="filesize"></a>
3989 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileSize</b></font>( <b>const</b> Path: <b>String</b> ): <b>Integer</b>;</font>
3990 <br>
3991 Returns file size in bytes without opening it. If file too large
3992 to represent its size as Integer, -1 is returned.
3993 </p>
3994 <a name="getuniquefilename"></a>
3996 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetUniqueFilename</b></font>( PathName: <b>string</b> ): <b>String</b>;</font>
3997 <br>
3998 If file given by PathName exists, modifies it to create unique
3999 filename in target folder and returns it. Modification is performed
4000 by incrementing last number in name (if name part of file does not
4001 represent a number, such number is generated and concatenated to
4002 it). E.g., if file aaa.aaa is already exist, the function checks
4003 names aaa1.aaa, aaa2.aaa, ..., aaa10.aaa, etc. For name abc123.ext,
4004 names abc124.ext, abc125.ext, etc. will be checked.
4005 </p>
4006 <a name="filetimecompare"></a>
4008 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FileTimeCompare</b></font>( <b>const</b> FT1, FT2: TFileTime ): <b>Integer</b>;</font>
4009 <br>
4010 Compares time of file (createing, writing, accessing. Returns
4011 -1, 0, 1 if correspondantly FT1&lt;FT2, FT1=FT2, FT1&gt;FT2.
4012 </p>
4013 <a name="getstartdir"></a>
4015 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetStartDir</b></font>: <b>String</b>;</font>
4016 <br>
4017 Returns path to directory where executable is located (regardless
4018 of current directory).
4019 </p>
4020 <a name="directoryexists"></a>
4022 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DirectoryExists</b></font>( <b>const</b> Name: <b>string</b> ): <b>Boolean</b>;</font>
4023 <br>
4024 Returns True if given directory (folder) exists.
4025 </p>
4026 <a name="directoryempty"></a>
4028 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DirectoryEmpty</b></font>( <b>const</b> Name: <b>String</b> ): <b>Boolean</b>;</font>
4029 <br>
4030 Returns True if given directory is not exists or empty.
4031 </p>
4032 <a name="directoryhassubdirs"></a>
4034 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DirectoryHasSubdirs</b></font>( <b>const</b> Path: <b>String</b> ): <b>Boolean</b>;</font>
4035 <br>
4036 Returns TRUE if given directory exists and has subdirectories.
4037 </p>
4038 <a name="checkdirectorycontent"></a>
4040 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CheckDirectoryContent</b></font>( <b>const</b> Name: <b>String</b>; SubDirsOnly: <b>Boolean</b>; <b>const</b> Mask: <b>String</b> ): <b>Boolean</b>;</font>
4041 <br>
4042 Returns TRUE if directory does not contain files (or directories only)
4043 satisfying given mask.
4044 </p>
4045 <a name="includetrailingpathdelimiter"></a>
4047 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IncludeTrailingPathDelimiter</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
4048 <br>
4049 by Edward Aretino. Adds '\' to the end if it is not present.
4050 </p>
4051 <a name="excludetrailingpathdelimiter"></a>
4053 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExcludeTrailingPathDelimiter</b></font>( <b>const</b> S: <b>string</b> ): <b>string</b>;</font>
4054 <br>
4055 by Edward Aretino. Removes '\' at the end if it is present.
4056 </p>
4057 <a name="forcedirectories"></a>
4059 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ForceDirectories</b></font>( Dir: <b>String</b> ): <b>Boolean</b>;</font>
4060 <br>
4061 by Edward Aretino. Creates given directory if not present. All needed
4062 subdirectories are created if necessary.
4063 </p>
4064 <a name="createdir"></a>
4066 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CreateDir</b></font>( <b>const</b> Dir: <b>string</b> ): <b>Boolean</b>;</font>
4067 <br>
4068 by Edward Aretino. Creates given directory.
4069 </p>
4070 <a name="changefileext"></a>
4072 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ChangeFileExt</b></font>( FileName: <b>String</b>; <b>const</b> Extension: <b>string</b> ): <b>string</b>;</font>
4073 <br>
4074 by Edward Aretino. Changes file extention.
4075 </p>
4076 <a name="excludetrailingchar"></a>
4078 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExcludeTrailingChar</b></font>( <b>const</b> S: <b>String</b>; C: <b>Char</b> ): <b>String</b>;</font>
4079 <br>
4080 If S is finished with character C, it is excluded.
4081 </p>
4082 <a name="includetrailingchar"></a>
4084 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IncludeTrailingChar</b></font>( <b>const</b> S: <b>String</b>; C: <b>Char</b> ): <b>String</b>;</font>
4085 <br>
4086 If S is not finished with character C, it is added.
4087 </p>
4088 <a name="extractfilepath"></a>
4090 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExtractFilePath</b></font>( <b>const</b> Path: <b>String</b> ): <b>String</b>;</font>
4091 <br>
4092 Returns only path part from exact path to file.
4093 </p>
4094 <a name="extractfilename"></a>
4096 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExtractFileName</b></font>( <b>const</b> Path: <b>String</b> ): <b>String</b>;</font>
4097 <br>
4098 Extracts file name from exact path to file.
4099 </p>
4100 <a name="extractfilenamewoext"></a>
4102 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExtractFileNameWOext</b></font>( <b>const</b> Path: <b>String</b> ): <b>String</b>;</font>
4103 <br>
4104 Extracts file name from path to file or from filename.
4105 </p>
4106 <a name="extractfileext"></a>
4108 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExtractFileExt</b></font>( <b>const</b> Path: <b>String</b> ): <b>String</b>;</font>
4109 <br>
4110 Extracts extention from file name (returns it with dot '.' first)
4111 </p>
4112 <a name="replacefileext"></a>
4114 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ReplaceFileExt</b></font>( <b>const</b> Path, NewExt: <b>String</b> ): <b>String</b>;</font>
4115 <br>
4116 Returns a path with extension replaced to a given one.
4117 </p>
4118 <a name="extractshortpathname"></a>
4120 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExtractShortPathName</b></font>( <b>const</b> Path: <b>String</b> ): <b>String</b>;</font>
4121 <br>
4122 </p>
4123 <a name="filepathshortened"></a>
4125 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FilePathShortened</b></font>( <b>const</b> Path: <b>String</b>; MaxLen: <b>Integer</b> ): <b>String</b>;</font>
4126 <br>
4127 Returns shortened file path to fit MaxLen characters.
4128 </p>
4129 <a name="filepathshortenpixels"></a>
4131 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FilePathShortenPixels</b></font>( <b>const</b> Path: <b>String</b>; DC: HDC; MaxPixels: <b>Integer</b> ): <b>String</b>;</font>
4132 <br>
4133 Returns shortened file path to fit MaxPixels for a given DC. If you pass
4134 Canvas.Handle of any control or bitmap object, ensure that font is valid
4135 for it (or call <a href=tcanvas.htm#requiredstate>TCanvas.RequiredState</a>( FontValid ) method before. If DC passed
4136 = 0, call is equivalent to call <a href=#filepathshortened>FilePathShortened</a>, and MaxPixels means in such
4137 case maximum number of characters.
4138 </p>
4139 <a name="minimizename"></a>
4141 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MinimizeName</b></font>( <b>const</b> Path: <b>String</b>; DC: HDC; MaxPixels: <b>Integer</b> ): <b>String</b>;</font>
4142 <br>
4143 Exactly the same as MinimizeName in FileCtrl.pas (VCL).
4144 </p>
4145 <a name="getsystemdir"></a>
4147 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetSystemDir</b></font>: <b>String</b>;</font>
4148 <br>
4149 Returns path to windows system directory.
4150 </p>
4151 <a name="getwindowsdir"></a>
4153 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetWindowsDir</b></font>: <b>string</b>;</font>
4154 <br>
4155 Returns path to Windows directory.
4156 </p>
4157 <a name="getworkdir"></a>
4159 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetWorkDir</b></font>: <b>string</b>;</font>
4160 <br>
4161 Returns path to application's working directory.
4162 </p>
4163 <a name="gettempdir"></a>
4165 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetTempDir</b></font>: <b>string</b>;</font>
4166 <br>
4167 Returns path to default temp folder (directory to place temporary files).
4168 </p>
4169 <a name="createtempfile"></a>
4171 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CreateTempFile</b></font>( <b>const</b> DirPath, Prefix: <b>String</b> ): <b>String</b>;</font>
4172 <br>
4173 Returns path to just created temporary file.
4174 </p>
4175 <a name="getfileliststr"></a>
4177 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetFileListStr</b></font>( FPath, FMask: <b>string</b> ): <b>string</b>;</font>
4178 <br>
4179 List of files in string, separating each path from others with semicolon (';').
4180 E.g.: 'c:\tmp\unit1.dcu;c:\tmp\unit1.~pa' (for use with <a href=#deletefile2recycle>DeleteFile2Recycle</a>())
4181 </p>
4182 <a name="deletefiles"></a>
4184 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DeleteFiles</b></font>( <b>const</b> DirPath: <b>String</b> ): <b>Boolean</b>;</font>
4185 <br>
4186 Deletes files by file mask (given with wildcards '*' and '?').
4187 </p>
4188 <a name="deletefile2recycle"></a>
4190 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DeleteFile2Recycle</b></font>( <b>const</b> Filename: <b>String</b> ): <b>Boolean</b>;</font>
4191 <br>
4192 Deletes file to recycle bin. This operation can be very slow, when
4193 called for a single file. To delete group of files at once (fast),
4194 pass a list of paths to files to be deleted, separating each path
4195 from others with semicolon (';'). E.g.: 'unit1.dcu;unit1.~pa'
4196 <br>
4197 FALSE is returned only in case when at least one file was not deleted
4198 successfully.
4199 <br>
4200 Note, that files are deleted not to recycle bin, if wildcards are
4201 used or not fully qualified paths to files.
4202 </p>
4203 <a name="copymovefiles"></a>
4205 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>CopyMoveFiles</b></font>( <b>const</b> FromList, ToList: <b>String</b>; Move: <b>Boolean</b> ): <b>Boolean</b>;</font>
4206 <br>
4207 </p>
4208 <a name="diskfreespace"></a>
4210 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DiskFreeSpace</b></font>( <b>const</b> Path: <b>String</b> ): <a href=#i64>I64</a>;</font>
4211 <br>
4212 Returns disk free space in bytes. Pass a path to root directory,
4213 e.g. 'C:\'.
4214 <hr>
4215 <a name="Wrappers to registry API functions"></a><font color=#FF8040><h1>Wrappers to registry API functions</h1></font>
4217 These functions can be used independently to simplify access to Windows
4218 registry.
4219 </p>
4220 <a name="regkeyopenread"></a>
4222 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyOpenRead</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): HKey;</font>
4223 <br>
4224 Opens registry key for read operations (including enumerating of subkeys).
4225 Pass either handle of opened earlier key or one of constans
4226 HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS
4227 as a first parameter. If not successful, 0 is returned.
4228 </p>
4229 <a name="regkeyopenwrite"></a>
4231 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyOpenWrite</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): HKey;</font>
4232 <br>
4233 Opens registry key for write operations (including adding new values or
4234 subkeys), as well as for read operations too. See also <a href=#regkeyopenread>RegKeyOpenRead</a>.
4235 </p>
4236 <a name="regkeyopencreate"></a>
4238 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyOpenCreate</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): HKey;</font>
4239 <br>
4240 Creates and opens key.
4241 </p>
4242 <a name="regkeygetstr"></a>
4244 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetStr</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): <b>String</b>;</font>
4245 <br>
4246 Reads key, which must have type REG_SZ (null-terminated string). If
4247 not successful, empty string is returned. This function as well as all
4248 other registry manipulation functions, does nothing, if Key passed is 0
4249 (without producing any error).
4250 </p>
4251 <a name="regkeygetstrex"></a>
4253 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetStrEx</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): <b>String</b>;</font>
4254 <br>
4255 Like <a href=#regkeygetstr>RegKeyGetStr</a>, but accepts REG_EXPAND_SZ type, expanding all
4256 environment variables in resulting string.
4257 <br>
4258 Code provided by neuron, e-mailto:neuron@hollowtube.mine.nu
4259 </p>
4260 <a name="regkeygetdw"></a>
4262 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetDw</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): <b>DWORD</b>;</font>
4263 <br>
4264 Reads key value, which must have type REG_DWORD. If ValueName passed
4265 is '' (empty string), unnamed (default) value is reading. If not
4266 successful, 0 is returned.
4267 </p>
4268 <a name="regkeysetstr"></a>
4270 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeySetStr</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b>; <b>const</b> Value: <b>String</b> ): <b>Boolean</b>;</font>
4271 <br>
4272 Writes new key value as null-terminated string (type REG_SZ). If not
4273 successful, returns False.
4274 </p>
4275 <a name="regkeysetstrex"></a>
4277 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeySetStrEx</b></font>( Key: HKey; <b>const</b> ValueName: <b>string</b>; <b>const</b> Value: <b>string</b>; expand: <b>boolean</b> ): <b>Boolean</b>;</font>
4278 <br>
4279 Writes new key value as REG_SZ or REG_EXPAND_SZ. - by neuron, e-mailto:neuron@hollowtube.mine.nu
4280 </p>
4281 <a name="regkeysetdw"></a>
4283 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeySetDw</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b>; Value: <b>DWORD</b> ): <b>Boolean</b>;</font>
4284 <br>
4285 Writes new key value as dword (with type REG_DWORD). Returns False,
4286 if not successful.
4287 </p>
4288 <a name="regkeyclose"></a>
4290 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>RegKeyClose</b></font>( Key: HKey );</font>
4291 <br>
4292 Closes key, opened using <a href=#regkeyopenread>RegKeyOpenRead</a> or <a href=#regkeyopenwrite>RegKeyOpenWrite</a>. (But does
4293 nothing, if Key passed is 0).
4294 </p>
4295 <a name="regkeydelete"></a>
4297 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyDelete</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): <b>Boolean</b>;</font>
4298 <br>
4299 Deletes key. Does nothing if key passed is 0 (returns FALSE).
4300 </p>
4301 <a name="regkeydeletevalue"></a>
4303 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyDeleteValue</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): <b>Boolean</b>;</font>
4304 <br>
4305 Deletes value. - by neuron, e-mailto:neuron@hollowtube.mine.nu
4306 </p>
4307 <a name="regkeyexists"></a>
4309 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyExists</b></font>( Key: HKey; <b>const</b> SubKey: <b>String</b> ): <b>Boolean</b>;</font>
4310 <br>
4311 Returns TRUE, if given subkey exists under given Key.
4312 </p>
4313 <a name="regkeyvalexists"></a>
4315 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyValExists</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): <b>Boolean</b>;</font>
4316 <br>
4317 Returns TRUE, if given value exists under the Key.
4318 </p>
4319 <a name="regkeyvaluesize"></a>
4321 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyValueSize</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): <b>Integer</b>;</font>
4322 <br>
4323 Returns a size of value. This is a size of buffer needed to store
4324 registry key value. For string value, size returned is equal to a
4325 length of string plus 1 for terminated null character.
4326 </p>
4327 <a name="regkeygetbinary"></a>
4329 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetBinary</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b>; <b>var</b> Buffer; Count: <b>Integer</b> ): <b>Integer</b>;</font>
4330 <br>
4331 Reads binary data from a registry, writing it to the Buffer.
4332 It is supposed that size of Buffer provided is at least Count bytes.
4333 Returned value is actul count of bytes read from the registry and written
4334 to the Buffer.
4335 <br>
4336 This function can be used to get data of any type from the registry, not
4337 only REG_BINARY.
4338 </p>
4339 <a name="regkeysetbinary"></a>
4341 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeySetBinary</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b>; <b>const</b> Buffer; Count: <b>Integer</b> ): <b>Boolean</b>;</font>
4342 <br>
4343 Stores binary data in the registry.
4344 </p>
4345 <a name="regkeygetdatetime"></a>
4347 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetDateTime</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b> ): TDateTime;</font>
4348 <br>
4349 Returns datetime variable stored in registry in binary format.
4350 </p>
4351 <a name="regkeysetdatetime"></a>
4353 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeySetDateTime</b></font>( Key: HKey; <b>const</b> ValueName: <b>String</b>; DateTime: TDateTime ): <b>Boolean</b>;</font>
4354 <br>
4355 Stores DateTime variable in the registry.
4356 </p>
4357 <a name="regkeygetsubkeys"></a>
4359 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetSubKeys</b></font>( <b>const</b> Key: HKEY; List: PStrList ): <b>Boolean</b>;</font>
4360 <br>
4361 The function enumerates subkeys of the specified open registry key.
4362 True is returned, if successful.
4363 </p>
4364 <a name="regkeygetvaluenames"></a>
4366 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetValueNames</b></font>( <b>const</b> Key: HKEY; List: PStrList ): <b>Boolean</b>;</font>
4367 <br>
4368 The function enumerates value names of the specified open registry key.
4369 True is returned, if successful.
4370 </p>
4371 <a name="regkeygetvaluetyp"></a>
4373 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RegKeyGetValueTyp</b></font>( <b>const</b> Key: HKEY; <b>const</b> ValueName: <b>String</b> ): <b>DWORD</b>;</font>
4374 <br>
4375 The function receives the type of data stored in the specified value.
4376 <br>
4377 If the function fails, the return value is the Key value.
4378 <br>
4379 If the function succeeds, the return value return will be one of the following:
4380 <br>
4381 REG_BINARY , REG_DWORD, REG_DWORD_LITTLE_ENDIAN,
4382 REG_DWORD_BIG_ENDIAN, REG_EXPAND_SZ, REG_LINK , REG_MULTI_SZ,
4383 REG_NONE, REG_RESOURCE_LIST, REG_SZ
4384 <hr>
4385 <a name="Data sorting (quicksort implementation)"></a><font color=#FF8040><h1>Data sorting (quicksort implementation)</h1></font>
4387 This part contains implementation of 'quick sort' algorithm,
4388 based on following code:
4389 <pre>
4390 TQSort by Mike Junkin 10/19/95.
4391 DoQSort routine adapted from Peter Szymiczek's QSort procedure which
4392 was presented in issue#8 of The Unofficial Delphi Newsletter.
4393 TQSort changed by Vladimir Kladov (Mr.Bonanzas) to allow 32-bit
4394 sorting (of big arrays with more than 64K elements).
4395 </pre>
4396 Finally, this sort procedure is adapted to XCL (and then to KOL)
4397 requirements (no references to SysUtils, Classes etc. TQSort object
4398 is transferred to a single procedure call and DoQSort method is
4399 renamed to <a href=#sortdata>SortData</a> - which is a regular procedure now).
4400 </p>
4401 <a name="tcompareevent"></a>
4403 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TCompareEvent</b></font> = <b>function</b>( <b>const</b> Data: <b>Pointer</b>; <b>const</b> e1, e2: <b>Dword</b> ): <b>Integer</b>;</font>
4404 <br>
4405 Event type to define comparison function between two elements of an array.
4406 This event handler must return -1 or +1 (correspondently for cases e1&lt;e2
4407 and e2&gt;e2). Items are enumerated from 0 to uNElem.
4408 </p>
4409 <a name="tswapevent"></a>
4411 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TSwapEvent</b></font> = <b>procedure</b>( <b>const</b> Data: <b>Pointer</b>; <b>const</b> e1, e2: <b>Dword</b> );</font>
4412 <br>
4413 Event type to define swap procedure which is swapping two elements of an
4414 array.
4415 </p>
4416 <a name="sortdata"></a>
4418 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SortData</b></font>( <b>const</b> Data: <b>Pointer</b>; <b>const</b> uNElem: <b>Dword</b>; <b>const</b> CompareFun: <a href=#tcompareevent>TCompareEvent</a>; <b>const</b> SwapProc: <a href=#tswapevent>TSwapEvent</a> );</font>
4419 <br>
4420 Call it to sort any array of data of any kind, passing total
4421 number of items in an array and two defined (regular) function
4422 and procedure to perform custom compare and swap operations.
4423 First procedure parameter is to pass it to callback function
4424 CompareFun and procedure SwapProc. Items are enumerated from
4425 0 to uNElem-1.
4426 </p>
4427 <a name="sortintegerarray"></a>
4429 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SortIntegerArray</b></font>( <b>var</b> A: <b>array</b> <b>of</b> <b>Integer</b> );</font>
4430 <br>
4431 procedure to sort array of integers.
4432 </p>
4433 <a name="sortdwordarray"></a>
4435 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SortDwordArray</b></font>( <b>var</b> A: <b>array</b> <b>of</b> <b>DWORD</b> );</font>
4436 <br>
4437 Procedure to sort array of unsigned 32-bit integers.
4438 <hr>
4439 </p>
4440 <a name="tsortdirrules"></a>
4442 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TSortDirRules</b></font> =( sdrNone, sdrFoldersFirst, sdrCaseSensitive, sdrByName, sdrByExt, sdrBySize, sdrBySizeDescending, sdrByDateCreate, sdrByDateChanged, sdrByDateAccessed );</font>
4443 <br>
4444 List of rules (options) to sort directories. Rules are passed to Sort
4445 method in an array, and first placed rules are applied first.
4446 </p>
4447 <a name="newdirlist"></a>
4449 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewDirList</b></font>( <b>const</b> DirPath, Filter: <b>String</b>; Attr: <b>DWORD</b> ): PDirList;</font>
4450 <br>
4451 Creates directory list object using easy one-string filter. If Attr = FILE_ATTRIBUTE_NORMAL,
4452 only files are scanned without directories. If Attr = 0, both files and
4453 directories are listed.
4454 </p>
4455 <a name="newdirlistex"></a>
4457 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewDirListEx</b></font>( <b>const</b> DirPath, Filters: <b>String</b>; Attr: <b>DWORD</b> ): PDirList;</font>
4458 <br>
4459 Creates directory list object using several filters, separated by ';'.
4460 Filters starting from '^' consider to be anti-filters, i.e. files,
4461 satisfying to those masks, are skept during scanning.
4462 </p>
4463 <a name="defsortdirrules"></a>
4465 <font face="Courier" color="#800080"><b>var</b> <font color="#808000"><b>DefSortDirRules</b></font>: array[ 0 . . 3 ] <b>of</b> <a href=#tsortdirrules>TSortDirRules</a> =( sdrFoldersFirst, sdrByName, sdrBySize, sdrByDateCreate );</font>
4466 <br>
4467 Default rules to sort directory entries.
4468 </p>
4469 <a name="directorysize"></a>
4471 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>DirectorySize</b></font>( <b>const</b> Path: <b>String</b> ): <a href=#i64>I64</a>;</font>
4472 <br>
4473 Returns directory size in bytes as large 64 bit integer.
4474 </p>
4475 <a name="topensaveoptions"></a>
4477 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOpenSaveOptions</b></font> = <b>set</b> <b>of</b> TOpenSaveOption;</font>
4478 <br>
4479 Options available for <a href=#topensavedialog>TOpenSaveDialog</a>.
4480 </p>
4481 <a name="newopensavedialog"></a>
4483 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewOpenSaveDialog</b></font>( <b>const</b> Title, StrtDir: <b>String</b>; Options: <a href=#topensaveoptions>TOpenSaveOptions</a> ): POpenSaveDialog;</font>
4484 <br>
4485 Creates object, which can be used (several times) to open file(s)
4486 selecting dialog.
4487 </p>
4488 <a name="topendiroption"></a>
4490 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOpenDirOption</b></font> =( odBrowseForComputer, odBrowseForPrinter, odDontGoBelowDomain, odOnlyFileSystemAncestors, odOnlySystemDirs, odStatusText, odBrowseIncludeFiles );</font>
4491 <br>
4492 Flags available for <a href=#topendirdialog>TOpenDirDialog</a> object.
4493 </p>
4494 <a name="topendiroptions"></a>
4496 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOpenDirOptions</b></font> = <b>set</b> <b>of</b> <a href=#topendiroption>TOpenDirOption</a>;</font>
4497 <br>
4498 Set of all flags used to control ZOpenDirDialog class.
4499 </p>
4500 <a name="tonodselchange"></a>
4502 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnODSelChange</b></font> = <b>procedure</b>( Sender: POpenDirDialog; NewSelDir: <b>PChar</b>; <b>var</b> EnableOK: <b>Integer</b>; <b>var</b> StatusText: <b>String</b> ) <b>of</b> <b>object</b>;</font>
4503 <br>
4504 Event type to be called when user select another directory in OpenDirDialog.
4505 Set EnableOK to -1 to disable OK button, or to +1 to enable it.
4506 It is also possible to set new StatusText string.
4507 </p>
4508 <a name="newopendirdialog"></a>
4510 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewOpenDirDialog</b></font>( <b>const</b> Title: <b>String</b>; Options: <a href=#topendiroptions>TOpenDirOptions</a> ): POpenDirDialog;</font>
4511 <br>
4512 Creates object, which can be used (several times) to open directory
4513 selecting dialog (using SHBrowseForFolder API call).
4514 </p>
4515 <a name="newcolordialog"></a>
4517 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewColorDialog</b></font>( FullOpen: TColorCustomOption ): PColorDialog;</font>
4518 <br>
4519 Creates color choosing dialog object.
4520 </p>
4521 <a name="tinifilemode"></a>
4523 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TIniFileMode</b></font> =( ifmRead, ifmWrite );</font>
4524 <br>
4525 ifmRead is default mode (means &quot;read&quot; data from ini-file.
4526 Set mode to ifmWrite to write data to ini-file, correspondent to
4527 <a href=#tinifile>TIniFile</a>.
4528 </p>
4529 <a name="openinifile"></a>
4531 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>OpenIniFile</b></font>( <b>const</b> FileName: <b>String</b> ): PIniFile;</font>
4532 <br>
4533 Opens ini file, creating <a href=#tinifile>TIniFile</a> object instance to work with it.
4534 </p>
4535 <a name="opencabfile"></a>
4537 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>OpenCABFile</b></font>( <b>const</b> APaths: <b>array</b> <b>of</b> <b>String</b> ): PCABFile;</font>
4538 <br>
4539 This function creates <a href=#tcabfile>TCABFile</a> object, passing a sequence of CAB file names
4540 (fully qualified). It is possible not to provide all names here, or pass '?'
4541 string in place of some of those. For such files, either an event OnNextCAB
4542 will be called, or (and) user will be prompted to browse file during
4543 executing (i.e. Extracting).
4544 </p>
4545 <a name="tonmenuitem"></a>
4547 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TOnMenuItem</b></font> = <b>procedure</b>( Sender: PMenu; Item: <b>Integer</b> ) <b>of</b> <b>object</b>;</font>
4548 <br>
4549 Event type to define OnMenuItem event.
4550 </p>
4551 <a name="tmenuaccelerator"></a>
4553 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMenuAccelerator</b></font> = <b>packed</b> <b>Record</b></font>
4554 <br>
4555 Menu accelerator record. Use <a href=#makeaccelerator>MakeAccelerator</a> function to combine desired
4556 attributes into a record, describing the accelerator.
4557 <table border="0" cellpadding="0" cellspacing="0" width="100%">
4558 <tr>
4559 <td width="32">&nbsp;</td>
4560 <td valign="top">
4561 <font face="Courier" color="#800080">fVirt: <b>Byte</b>;</font>
4562 </td>
4563 <td valign="top">
4564 or-combination of FSHIFT, FCONTROL, FALT, FVIRTKEY, FNOINVERT
4565 </td>
4566 </tr>
4567 <tr>
4568 <td width="32">&nbsp;</td>
4569 <td valign="top">
4570 <font face="Courier" color="#800080">Key: <b>Word</b>;</font>
4571 </td>
4572 <td valign="top">
4573 character or virtual key code (FVIRTKEY flag is present above)
4574 </td>
4575 </tr>
4576 <tr>
4577 <td width="32">&nbsp;</td>
4578 <td valign="top">
4579 <font face="Courier" color="#800080">NotUsed: <b>Byte</b>;</font>
4580 </td>
4581 <td valign="top">
4582 not used
4583 </td>
4584 </tr>
4585 </table>
4586 <font face="Courier" color="#800080"><b>end</b>;</font>
4587 </p>
4588 <a name="tmenuoption"></a>
4590 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMenuOption</b></font> =( moDefault, moDisabled, moChecked, moCheckMark, moRadioMark, moSeparator, moBitmap, moSubMenu, moBreak, moBarBreak );</font>
4591 <br>
4592 Options to add menu items dynamically.
4593 </p>
4594 <a name="tmenuoptions"></a>
4596 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMenuOptions</b></font> = <b>set</b> <b>of</b> <a href=#tmenuoption>TMenuOption</a>;</font>
4597 <br>
4598 Set of options for menu item to use it in <a href=tmenu.htm#additem>TMenu.AddItem</a> method.
4599 </p>
4600 <a name="tmenubreak"></a>
4602 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TMenuBreak</b></font> =( mbrNone, mbrBreak, mbrBarBreak );</font>
4603 <br>
4604 Possible menu item break types.
4605 </p>
4606 <a name="menustructsize"></a>
4608 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MenuStructSize</b></font>: <b>Integer</b>;</font>
4609 <br>
4610 Returns 44 under Windows95, and 48 (=sizeof(TMenuItemInfo) under all other
4611 Windows versions.
4612 </p>
4613 <a name="newmenu"></a>
4615 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMenu</b></font>( AParent: <a href=#pcontrol>PControl</a>; MaxCmdReserve: <b>DWORD</b>; <b>const</b> Template: <b>array</b> <b>of</b> <b>PChar</b>; aOnMenuItem: <a href=#tonmenuitem>TOnMenuItem</a> ): PMenu;</font>
4616 <br>
4617 Menu constructor. First created menu becomes main menu of form (if AParent
4618 is a form). All other menus becomes popup (can be activated using Popup
4619 method). To provide dynamic replacing of main menu, create all popup
4620 menus as children of any other control, not form itself.
4621 When Menu is created, pass FirstCmd integer value to set it
4622 as ID of first menu item (all other ID's obtained by incrementing this value),
4623 and Template, which is an array of PChar (usually array of string constants),
4624 containing list of menu item identifiers and/or formatting characters.
4625 <br>&nbsp;&nbsp;&nbsp;
4626 FirstCmd value is assigned to first menu item created as its ID,
4627 all follow menu items are assigned to ID's obtained from FirstCmd incrementing
4628 it by 1. It is desirable to provide not intersected ranges of ID's for
4629 defferent menus in the applet.
4630 <br>&nbsp;&nbsp;&nbsp;
4631 Following formatting characters can be used in menu template strings:
4632 <br><b>&amp; (in identifier)</b>
4633 - to underline next character and use it as a shortcut character
4634 when possible;
4635 <br><b>+ (in front of identifier)</b>
4636 - to make item checked. If also
4637 <b>!</b> is used before <b>
4638 &amp;
4639 </b> than radioitem is defined;
4640 <br><b>- (in front of identifier)</b>
4641 - item not checked;
4642 <br><b>- (separate)</b>
4643 - separator (between two items);
4644 <br><b>( (separate)</b>
4645 - start of submenu;
4646 <br><b>) (separate)</b>
4647 - end of submenu;
4648 <br>&nbsp;&nbsp;&nbsp;
4649 To get access to menu items, use constants 0, 1, etc. It is a good idea
4650 to create special enumerated type to index correspondent menu items
4651 using Ord( ) operator. Note in that case, that it is necessary only to
4652 define constants correspondent to identifiers (positions, correspondent
4653 to separators or submenu brackets are not identified by numbers).
4654 <br>&nbsp;&nbsp;&nbsp;
4655 </p>
4656 <a name="newmenuex"></a>
4658 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewMenuEx</b></font>( AParent: <a href=#pcontrol>PControl</a>; FirstCmd: <b>Integer</b>; <b>const</b> Template: <b>array</b> <b>of</b> <b>PChar</b>; aOnMenuItems: <b>array</b> <b>of</b> <a href=#tonmenuitem>TOnMenuItem</a> ): PMenu;</font>
4659 <br>
4660 Creates menu, assigning its own event handler for every (enough) menu item.
4661 </p>
4662 <a name="makeaccelerator"></a>
4664 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>MakeAccelerator</b></font>( fVirt: <b>Byte</b>; Key: <b>Word</b> ): <a href=#tmenuaccelerator>TMenuAccelerator</a>;</font>
4665 <br>
4666 Creates accelerator item to assign it to <a href=tmenu.htm#itemaccelerator>TMenu.ItemAccelerator</a>[ ] property
4667 easy.
4668 </p>
4669 <a name="getacceleratortext"></a>
4671 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetAcceleratorText</b></font>( <b>const</b> Accelerator: <a href=#tmenuaccelerator>TMenuAccelerator</a> ): <b>string</b>;</font>
4672 <br>
4673 Returns text representation of accelerator.
4674 </p>
4675 <a name="newactionlist"></a>
4677 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>NewActionList</b></font>( AOwner: <a href=#pcontrol>PControl</a> ): PActionList;</font>
4678 <br>
4679 Action list constructor. AOwner - owner form.
4680 <hr>
4681 <a name="System functions and working with windows"></a><font color=#FF8040><h1>System functions and working with windows</h1></font>
4683 </p>
4684 <a name="twindowchildkind"></a>
4686 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWindowChildKind</b></font> =( wcActive, wcFocus, wcCapture, wcMenuOwner, wcMoveSize, wcCaret );</font>
4687 <br>
4688 Type of window child kind. Used in function <a href=#getwindowchild>GetWindowChild</a>.
4689 </p>
4690 <a name="getwindowchild"></a>
4692 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetWindowChild</b></font>( Wnd: HWnd; Kind: <a href=#twindowchildkind>TWindowChildKind</a> ): HWnd;</font>
4693 <br>
4694 Returns child of given top-level window, having given characteristics.
4695 For example, it is possible to get know for foreground window,
4696 which of its child window has focus. This function does not work in old
4697 Windows 95 (returns Wnd in that case). But for Windows 98, Windows NT/2000
4698 this function works fine. To obtain focused child of the window,
4699 use GetFocusedWindow, which is independant from Windows version.
4700 </p>
4701 <a name="getfocusedchild"></a>
4703 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetFocusedChild</b></font>( Wnd: HWnd ): HWnd;</font>
4704 <br>
4705 Returns focused child of given window (which should be foreground
4706 and active, certainly). 0 is returned either if Wnd is not active
4707 or Wnd has no focused child window.
4708 </p>
4709 <a name="stroke2window"></a>
4711 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Stroke2Window</b></font>( Wnd: HWnd; <b>const</b> S: <b>String</b> ): <b>Boolean</b>;</font>
4712 <br>
4713 Posts characters from string S to those child window of Wnd, which
4714 has focus now (top-level window Wnd must be foreground, and have
4715 focused edit-aware control to receive the stroke).
4716 <br>
4717 This function allows only to post typeable characters (including
4718 such special symbols as #13 (Enter), #9 (Tab), #8 (BackSpace), etc.
4719 <br>
4720 See also function <a href=#stroke2windowex>Stroke2WindowEx</a>, which allows to post any key down
4721 and up events, simulating keyboard for given (automated) application.
4722 </p>
4723 <a name="stroke2windowex"></a>
4725 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Stroke2WindowEx</b></font>( Wnd: HWnd; <b>const</b> S: <b>String</b>; Wait: <b>Boolean</b> ): <b>Boolean</b>;</font>
4726 <br>
4727 In addition to function <a href=#stroke2window>Stroke2Window</a>, this one can send special keys
4728 to given window, including functional keys and navigation keys. To
4729 post special key to target window, place a combination of names of
4730 such key together with keys, which should be passed simultaneously,
4731 between square or figure brackets. For example, [Ctrl F1], [Alt Shift Home],
4732 [Ctrl E]. For letters and usual characters, it is not necessary to
4733 simulate pressing it with determining all Shift combinations and it is
4734 sufficient to pass characters as is. (E.g., not '[Shift 1]', but '!').
4735 </p>
4736 <a name="findwindowbythreadid"></a>
4738 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>FindWindowByThreadID</b></font>( ThreadID: <b>DWORD</b> ): HWnd;</font>
4739 <br>
4740 Searches for window, belonging to a given thread.
4741 </p>
4742 <a name="getdesktoprect"></a>
4744 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetDesktopRect</b></font>: TRect;</font>
4745 <br>
4746 Returns rectangle of screen, free of taskbar and other
4747 similar app-bars, which reduces size of available desktop
4748 when created.
4749 </p>
4750 <a name="getworkarea"></a>
4752 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetWorkArea</b></font>: TRect;</font>
4753 <br>
4754 The same as <a href=#getdesktoprect>GetDesktopRect</a>, but obtained calling SystemParametersInfo.
4755 </p>
4756 <a name="executewait"></a>
4758 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExecuteWait</b></font>( <b>const</b> AppPath, CmdLine, DfltDirectory: <b>String</b>; Show: <b>DWORD</b>; TimeOut: <b>DWORD</b>; ProcID: PDWORD ): <b>Boolean</b>;</font>
4759 <br>
4760 Allows to execute an application and wait when it is finished. Pass
4761 INFINITE constant as TimeOut, if You sure that application is finished
4762 anyway. If another value passed as a TimeOut (in milliseconds), and
4763 application was not finished for that time, ExecuteWait is returning
4764 FALSE, and if ProcID is not nil, than ProcID^ contains started process
4765 handle (it can be used to wait it more, or to terminate it using
4766 TerminateProcess API function).
4767 <br>
4768 Launching application can be console or GUI - it does not matter.
4769 Pass SW_SHOW, SW_HIDE or other SW_XXX constant as Show parameter
4770 as appropriate.
4771 <br>
4772 Trie is returned only in case when application specified was launched
4773 successfully and finished for TimeOut specified. Otherwise, check
4774 ProcID^ variable: if it is 0, process could not be launched (and it
4775 is possible to get information about error using GetLastError API
4776 function in a such case). You can freely pass nil in place of ProcID
4777 parameter, but this is acually correct only when TimeOut is INFINITE.
4778 </p>
4779 <a name="executeioredirect"></a>
4781 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExecuteIORedirect</b></font>( <b>const</b> AppPath, CmdLine, DfltDirectory: <b>String</b>; Show: <b>DWORD</b>; ProcID: PDWORD; InPipe, OutPipeWr, OutPipeRd: PHandle ): <b>Boolean</b>;</font>
4782 <br>
4783 Executes an application with its console input and output redirection.
4784 Terminating of the application is not waiting, but if ProcID pointer
4785 is defined, it receives process Id launched, so it is possible to
4786 call WaitForSingleObject for it. InPipe is a pointer to THandle variable
4787 which receives a handle to input pipe of the console redirected. The same
4788 is for OutPipeWr and OutPipeRd, but for output of the console redirected.
4789 Before reading from OutPipeRd^, first close OutPipeWr^. If you run
4790 simple console application, for which you want to read results after its
4791 termination, you can use <a href=#executeconsoleappioredirect>ExecuteConsoleAppIORedirect</a> instead.
4792 <br>&nbsp;&nbsp;&nbsp;
4793 Notes: if your application is not console and it does not create console
4794 using AllocConsole, this function will fail to redirect input-output.
4795 </p>
4796 <a name="executeconsoleappioredirect"></a>
4798 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ExecuteConsoleAppIORedirect</b></font>( <b>const</b> AppPath, CmdLine, DfltDirectory: <b>String</b>; Show: <b>DWORD</b>; <b>const</b> InStr: <b>String</b>; <b>var</b> OutStr: <b>String</b>; WaitTimeout: <b>DWORD</b> ): <b>Boolean</b>;</font>
4799 <br>
4800 Executes an application, redirecting its console input and output.
4801 After redirecting input and output and launching the application,
4802 content of InStr is written to input stream of the application, then
4803 the application is waiting for its termination (WaitTimeout milliseconds
4804 or INFINITE, as passed) and console output of the application is read to
4805 OutStr. TRUE is returned only in case, when all these tasks are
4806 completed successfully.
4807 <br>&nbsp;&nbsp;&nbsp;
4808 Notes: if your application is not console and it does not create console
4809 using AllocConsole, this function will fail to redirect input-output.
4810 </p>
4811 <a name="windowsshutdown"></a>
4813 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WindowsShutdown</b></font>( <b>const</b> Machine: <b>String</b>; Force, Reboot: <b>Boolean</b> ): <b>Boolean</b>;</font>
4814 <br>
4815 Shut down of Windows NT. Pass Machine = '' to shutdown this PC.
4816 Pass Reboot = True to reboot immediatelly after shut down.
4817 </p>
4818 <a name="twindowsversion"></a>
4820 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWindowsVersion</b></font> =( wv31, wv95, wv98, wvNT, wvY2K, wvXP, wvLongHorn );</font>
4821 <br>
4822 Windows versions constants.
4823 </p>
4824 <a name="twindowsversions"></a>
4826 <font face="Courier" color="#800080"><b>type</b> <font color="#808000"><b>TWindowsVersions</b></font> = <b>Set</b> <b>of</b> <a href=#twindowsversion>TWindowsVersion</a>;</font>
4827 <br>
4828 Set of Windows version (e.g. to define a range of versions supported by the
4829 application).
4830 </p>
4831 <a name="winver"></a>
4833 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>WinVer</b></font>: <a href=#twindowsversion>TWindowsVersion</a>;</font>
4834 <br>
4835 Returns Windows version.
4836 </p>
4837 <a name="iswinver"></a>
4839 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IsWinVer</b></font>( Ver: <a href=#twindowsversions>TWindowsVersions</a> ): <b>Boolean</b>;</font>
4840 <br>
4841 Returns True if Windows version is in given range of values.
4842 </p>
4843 <a name="paramstr"></a>
4845 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ParamStr</b></font>( Idx: <b>Integer</b> ): <b>String</b>;</font>
4846 <br>
4847 Returns command-line parameter by index. This function supersides
4848 standard ParamStr function.
4849 </p>
4850 <a name="paramcount"></a>
4852 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ParamCount</b></font>: <b>Integer</b>;</font>
4853 <br>
4854 Returns number of parameters in command line.
4855 <hr>
4856 </p>
4857 <a name="_tobj"></a>
4859 <font face="Courier" color="#808000"><b>type</b> <a href=_tobj.htm><b>_TObj</b></a> = <b>object</b></font>
4860 <br>
4861 auxiliary object type. See <a href=#tobj>TObj</a>.
4862 </p>
4863 <a name="tobj"></a>
4865 <font face="Courier" color="#808000"><b>type</b> <a href=tobj.htm><b>TObj</b></a> = <b>object</b>( <a href=#_tobj>_TObj</a> )</font>
4866 <br>
4867 Prototype for all objects of KOL. All its methods are important to
4868 implement objects in a manner similar to Delphi TObject class.
4869 </p>
4870 <a name="tlist"></a>
4872 <font face="Courier" color="#808000"><b>type</b> <a href=tlist.htm><b>TList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4873 <br>
4874 Simple list of pointers. It is used in KOL instead of standard VCL
4875 <a href=tlist.htm>TList</a> to store any kind data (or pointers to these ones). Can be created
4876 calling function <a href=#newlist>NewList</a>.
4877 </p>
4878 <a name="tlistex"></a>
4880 <font face="Courier" color="#808000"><b>type</b> <a href=tlistex.htm><b>TListEx</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4881 <br>
4882 Extended list, with Objects[ ] property. Created calling <a href=#newlistex>NewListEx</a> function.
4883 </p>
4884 <a name="ttree"></a>
4886 <font face="Courier" color="#808000"><b>type</b> <a href=ttree.htm><b>TTree</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4887 <br>
4888 Object to store tree-like data in memory (non-visual).
4889 </p>
4890 <a name="tthread"></a>
4892 <font face="Courier" color="#808000"><b>type</b> <a href=tthread.htm><b>TThread</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4893 <br>
4894 Thread object. It is possible not to derive Your own thread-based
4895 object, but instead create thread <a href=tthread.htm#suspended>Suspended</a> and assign event
4896 <a href=tthread.htm#onexecute>OnExecute</a>. To create, use one of <a href=#newthread>NewThread</a> of <a href=#newthreadex>NewThreadEx</a> functions,
4897 or derive Your own descendant object and write creation function
4898 (or constructor) for it.
4899 <br><br>
4900 Aknowledgements. Originally class ZThread was developed for XCL:
4901 <br> * By: Tim Slusher : junior@nlcomm.com
4902 <br> * Home: http://www.nlcomm.com/~junior
4903 </p>
4904 <a name="tstream"></a>
4906 <font face="Courier" color="#808000"><b>type</b> <a href=tstream.htm><b>TStream</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4907 <br>
4908 Simple stream object. Can be opened for file, or as memory stream (see
4909 <a href=#newreadfilestream>NewReadFileStream</a>, <a href=#newwritefilestream>NewWriteFileStream</a>, <a href=#newmemorystream>NewMemoryStream</a>, etc.). And, another
4910 type of streaming object can be derived (without inheriting new object
4911 type, just by writing another New...Stream method, which calls
4912 <a href=#_newstream>_NewStream</a> and pass methods record to it).
4913 </p>
4914 <a name="tbits"></a>
4916 <font face="Courier" color="#808000"><b>type</b> <a href=tbits.htm><b>TBits</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4917 <br>
4918 Variable-length bits array object. Created using function <a href=#newbits>NewBits</a>. See also
4919 <a href="kol_pas.htm#Small bit arrays (max 32 bits in array)">
4920 Small bit arrays (max 32 bits in array)
4921 </a>.
4922 </p>
4923 <a name="tstrlist"></a>
4925 <font face="Courier" color="#808000"><b>type</b> <a href=tstrlist.htm><b>TStrList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4926 <br>
4927 Easy string list implementation (non-visual, just to store
4928 string data). It is well improved and has very high performance
4929 allowing to work fast with huge text files (more then megabyte
4930 of text data).
4931 Please note that #0 charaster if stored in string lines, will cut it
4932 preventing reading the rest of a line. Be careful, if your data
4933 contain such characters.
4934 </p>
4935 <a name="tstrlistex"></a>
4937 <font face="Courier" color="#808000"><b>type</b> <a href=tstrlistex.htm><b>TStrListEx</b></a> = <b>object</b>( <a href=#tstrlist>TStrList</a> )</font>
4938 <br>
4939 Extended string list object. Has additional capability to associate
4940 numbers or objects with string list items.
4941 </p>
4942 <a name="twstrlist"></a>
4944 <font face="Courier" color="#808000"><b>type</b> <a href=twstrlist.htm><b>TWStrList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4945 <br>
4946 String list to store Unicode (null-terminated) strings.
4947 </p>
4948 <a name="twstrlistex"></a>
4950 <font face="Courier" color="#808000"><b>type</b> <a href=twstrlistex.htm><b>TWStrListEx</b></a> = <b>object</b>( <a href=#twstrlist>TWStrList</a> )</font>
4951 <br>
4952 Extended Unicode string list (with <a href=twstrlistex.htm#objects>Objects</a>).
4953 </p>
4954 <a name="tgraphictool"></a>
4956 <font face="Courier" color="#808000"><b>type</b> <a href=tgraphictool.htm><b>TGraphicTool</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4957 <br>
4958 Incapsulates all GDI objects: Pen, Brush and Font.
4959 </p>
4960 <a name="tcanvas"></a>
4962 <font face="Courier" color="#808000"><b>type</b> <a href=tcanvas.htm><b>TCanvas</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4963 <br>
4964 Very similar to VCL's <a href=tcanvas.htm>TCanvas</a> object. But with some changes, specific
4965 for KOL: there is no necessary to use canvases in all applications.
4966 And graphic tools objects are not created with canvas, but only
4967 if really accessed in program. (Actually, even if paint box used,
4968 only programmer decides, if to implement painting using Canvas or
4969 to call low level API drawing functions working directly with DC).
4970 Therefore <a href=tcanvas.htm>TCanvas</a> has some powerful extensions: rotated text support,
4971 geometric pen support - just by changing correspondent properties
4972 of certain graphic tool objects (Font.FontOrientation, Pen.GeometricPen).
4973 See also additional <a href=tcanvas.htm#font>Font</a> properties (Font.FontWeight, Font.FontQuality,
4974 etc.
4975 </p>
4976 <a name="timagelist"></a>
4978 <font face="Courier" color="#808000"><b>type</b> <a href=timagelist.htm><b>TImageList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4979 <br>
4980 ImageList incapsulation.
4981 </p>
4982 <a name="tbitmap"></a>
4984 <font face="Courier" color="#808000"><b>type</b> <a href=tbitmap.htm><b>TBitmap</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4985 <br>
4986 Bitmap incapsulation object.
4987 </p>
4988 <a name="ticon"></a>
4990 <font face="Courier" color="#808000"><b>type</b> <a href=ticon.htm><b>TIcon</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4991 <br>
4992 Object type to incapsulate icon or cursor image.
4993 </p>
4994 <a name="tmetafile"></a>
4996 <font face="Courier" color="#808000"><b>type</b> <a href=tmetafile.htm><b>TMetafile</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
4997 <br>
4998 Object type to incapsulate metafile image.
4999 </p>
5000 <a name="ttimer"></a>
5002 <font face="Courier" color="#808000"><b>type</b> <a href=ttimer.htm><b>TTimer</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5003 <br>
5004 Easy timer incapsulation object. Uses applet window to
5005 receive timer events. So, either assign your main form
5006 to <a href=#applet>Applet</a> variable or create applet button object (and
5007 assign it to <a href=#applet>Applet</a>) before enabling timer.
5008 </p>
5009 <a name="tmmtimer"></a>
5011 <font face="Courier" color="#808000"><b>type</b> <a href=tmmtimer.htm><b>TMMTimer</b></a> = <b>object</b>( <a href=#ttimer>TTimer</a> )</font>
5012 <br>
5013 Multimedia timer incapsulation object. Does not require <a href=#applet>Applet</a> or special
5014 window to handle it. System creates a thread for each high resolution
5015 timer, so using many such objects can degrade total PC performance.
5016 </p>
5017 <a name="tdirchange"></a>
5019 <font face="Courier" color="#808000"><b>type</b> <a href=tdirchange.htm><b>TDirChange</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5020 <br>
5021 Object type to monitor changes in certain folder.
5022 </p>
5023 <a name="ttrayicon"></a>
5025 <font face="Courier" color="#808000"><b>type</b> <a href=ttrayicon.htm><b>TTrayIcon</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5026 <br>
5027 Object to place (and change) a single icon onto taskbar tray.
5028 </p>
5029 <a name="tdirlist"></a>
5031 <font face="Courier" color="#808000"><b>type</b> <a href=tdirlist.htm><b>TDirList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5032 <br>
5033 Allows easy directory scanning. This is not visual object, but
5034 storage to simplify working with directory content.
5035 </p>
5036 <a name="topensavedialog"></a>
5038 <font face="Courier" color="#808000"><b>type</b> <a href=topensavedialog.htm><b>TOpenSaveDialog</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5039 <br>
5040 Object to show standard Open/Save dialog. Initially provided
5041 for XCL by Carlo Kok.
5042 </p>
5043 <a name="topendirdialog"></a>
5045 <font face="Courier" color="#808000"><b>type</b> <a href=topendirdialog.htm><b>TOpenDirDialog</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5046 <br>
5047 Dialog for open directories, uses SHBrowseForFolder.
5048 </p>
5049 <a name="tcolordialog"></a>
5051 <font face="Courier" color="#808000"><b>type</b> <a href=tcolordialog.htm><b>TColorDialog</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5052 <br>
5053 <a href=tcolordialog.htm#color>Color</a> choosing dialog.
5054 </p>
5055 <a name="tinifile"></a>
5057 <font face="Courier" color="#808000"><b>type</b> <a href=tinifile.htm><b>TIniFile</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5058 <br>
5059 Ini file incapsulation. The main feature is what the same block of
5060 read-write operations could be defined (difference must be only in
5061 <a href=tinifile.htm#mode>Mode</a> value).
5062 &nbsp;&nbsp;&nbsp;<a href="Inifilesample.htm"><font face="Webdings" size=7>&#181;</font></a>&nbsp;&nbsp;&nbsp;
5063 </p>
5064 <a name="tcabfile"></a>
5066 <font face="Courier" color="#808000"><b>type</b> <a href=tcabfile.htm><b>TCABFile</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5067 <br>
5068 An object to simplify extracting files from a cabinet (.CAB) files.
5069 The only what need to use this object, setupapi.dll. It is provided
5070 with all latest versions of Windows.
5071 </p>
5072 <a name="tmenu"></a>
5074 <font face="Courier" color="#808000"><b>type</b> <a href=tmenu.htm><b>TMenu</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5075 <br>
5076 Dynamic menu incapsulation object. Can play role of form main menu or popup
5077 menu, depending on kind of parent window (form or control) and order of
5078 creation (created first (for a form) become main menu). Does not allow
5079 merging menus, but items can be hidden. Additionally checkmark bitmaps,
5080 shortcut key accelerators and other features are available.
5081 </p>
5082 <a name="taction"></a>
5084 <font face="Courier" color="#808000"><b>type</b> <a href=taction.htm><b>TAction</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5085 <br>
5086 Use action objects, in conjunction with action lists, to centralize the response
5087 to user commands (actions).
5088 Use AddControl, AddMenuItem, AddToolbarButton methods to link controls to an action.
5089 See also <a href=#tactionlist>TActionList</a>.
5090 </p>
5091 <a name="tactionlist"></a>
5093 <font face="Courier" color="#808000"><b>type</b> <a href=tactionlist.htm><b>TActionList</b></a> = <b>object</b>( <a href=#tobj>TObj</a> )</font>
5094 <br>
5095 <a href=tactionlist.htm>TActionList</a> maintains a list of actions used with components and controls,
5096 such as menu items and buttons.
5097 Action lists are used, in conjunction with actions, to centralize the response
5098 to user commands (actions).
5099 Write an <a href=tactionlist.htm#onupdateactions>OnUpdateActions</a> handler to update actions state.
5100 Created using function <a href=#newactionlist>NewActionList</a>.
5101 See also <a href=#taction>TAction</a>.
5102 </p>
5103 <hr>
5104 <p align="center">[&nbsp;<a href=index.htm>Index</a>&nbsp;]</p>
5105 <p align="center"><font face="Comic Sans MS"><small>This help is generated 22-Sep-2005 by KOL Help generator, (C) 2000-2001 by Vladimir Kladov<br>Modified (C) 2003 by Alexander Bartov</small></font></p>
5106 </body>
5107 </html>