initial commit
[rofl0r-KOL.git] / main_tmenu.htm
blobabefb81cb3c71c76c3ad40021ad2da13e59d8f98
1 <html>
2 <head>
3 <title>KOL Help: TMenu object (main frame)</title>
4 <base target="_top">
5 </head>
7 <body bgcolor="#FFFFEF" text="#000000" link="#008080" vlink="#008000" alink="#808000">
8 <p><font face="Courier" color="#800080"><b>TMenu( unit <a href=kol_pas.htm>KOL.pas</a> )
9 <font face="Wingdings">ï</font> <a href=tobj.htm>TObj</a>
10 <font face="Wingdings">ï</font> <a href=_tobj.htm>_TObj</a>
11 </b></font></p>
12 <p><b>
13 TMenu = object( <a href=tobj.htm target="_top">TObj</a> )
14 </b></p>
15 Dynamic menu incapsulation object. Can play role of form main menu or popup
16 menu, depending on kind of parent window (form or control) and order of
17 creation (created first (for a form) become main menu). Does not allow
18 merging menus, but items can be hidden. Additionally checkmark bitmaps,
19 shortcut key accelerators and other features are available.
20 <h3 align="center"><font color="#FF8080">TMenu properties</font></h3>
21 <a name="handle"></a>
22 <p>
23 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Handle</b></font>: HMenu;</font>
24 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
25 <br>
26 Handle of Windows menu object.
27 </p>
28 <a name="menuid"></a>
29 <p>
30 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>MenuId</b></font>: <b>Integer</b>;</font>
31 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
32 <br>
33 Id of the menu item object. If menu item has subitems, it has
34 also submenu <a href=#handle target="main">Handle</a>. Top parent menu object itself has no Id.
35 Id-s areassigned automatically starting from 4096. Do not
36 (re)create menu items instantly, because such values are not
37 reused, and maximum possible Id value must not exceed 65535.
38 </p>
39 <a name="parent"></a>
40 <p>
41 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Parent</b></font>: PMenu;</font>
42 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
43 <br>
44 Parent menu item (or parent menu).
45 </p>
46 <a name="topparent"></a>
47 <p>
48 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>TopParent</b></font>: PMenu;</font>
49 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
50 <br>
51 Top parent menu, owning all nested subitems.
52 </p>
53 <a name="owner"></a>
54 <p>
55 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Owner</b></font>: <a href=kol_pas.htm#pcontrol target="_top">PControl</a>;</font>
56 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
57 <br>
58 <a href=#parent target="main">Parent</a> control or form.
59 </p>
60 <a name="caption"></a>
61 <p>
62 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Caption</b></font>: <b>String</b>;</font>
63 <br>
64 Menu item caption text (including '&amp;' indicating mnemonic characters,
65 and keyboard accelerator representation string, usually following
66 tabulation character).
67 </p>
68 <a name="items"></a>
69 <p>
70 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Items</b></font>[ Id: HMenu ]: PMenu;</font>
71 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
72 <br>
73 Returns menu item object by its index or by menu id. Since menu id
74 values are starting from 4096, values from 0 to 4095 are interpreted
75 as absolute index of menu item. Be careful accessing menu items or
76 submenus by index, if you dynamically insert or delete items or
77 submenus. In this version, separators are enumerating too, like
78 all other items. Use index -1 to access object itself. The first
79 item of a menu (or the first subitem of submenu item) has index 0.
80 Children are enumerating before all siblings. The maximum available
81 index is (<a href=#count target="main">Count</a> - 1), when accessing menu items by index.
82 </p>
83 <a name="count"></a>
84 <p>
85 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Count</b></font>: <b>Integer</b>;</font>
86 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
87 <br>
88 Count of items together with all its nested subitems.
89 </p>
90 <a name="byaccel"></a>
91 <p>
92 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ByAccel</b></font>: <b>Boolean</b>;</font>
93 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
94 <br>
95 True, when <a href=#onmenuitem target="main">OnMenuItem</a> is called not by mouse, but by accelerator key.
96 Check this flag for entire menu (<a href=#topparent target="main">TopParent</a>), not for item itself.
97 (Note, that Sender in <a href=#onmenuitem target="main">OnMenuItem</a> always is <a href=#topparent target="main">TopParent</a> menu object). )
98 </p>
99 <a name="isseparator"></a>
101 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>IsSeparator</b></font>: <b>Boolean</b>;</font>
102 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
103 <br>
104 TRUE, if a separator menu item.
105 </p>
106 <a name="menubreak"></a>
108 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>MenuBreak</b></font>: <a href=kol_pas.htm#tmenubreak target="_top">TMenuBreak</a>;</font>
109 <br>
110 Menu item break type.
111 </p>
112 <a name="radiogroup"></a>
114 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>RadioGroup</b></font>: <b>Integer</b>;</font>
115 <br>
116 Radio group index. Several neighbour items with the same radio group
117 index form radio group. Only single item from the same group can be
118 checked at a time.
119 </p>
120 <a name="ischeckitem"></a>
122 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>IsCheckItem</b></font>: <b>Boolean</b>;</font>
123 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
124 <br>
125 If menu item is defined as check item, it is checked automatically
126 when clicked.
127 </p>
128 <a name="checked"></a>
130 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Checked</b></font>: <b>Boolean</b>;</font>
131 <br>
132 Checked state of the item.
133 </p>
134 <a name="enabled"></a>
136 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Enabled</b></font>: <b>Boolean</b>;</font>
137 <br>
138 Enabled state of the item. Whaen assigned, Grayed state also is
139 set to arbitrary value (i.e., when Enabled is set to true, Grayed
140 is set to FALSE.
141 </p>
142 <a name="defaultitem"></a>
144 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>DefaultItem</b></font>: <b>Boolean</b>;</font>
145 <br>
146 Set this property to TRUE to make menu item default. Default item
147 is drawn with bold.
148 <br>If you change DefaultItem at run-time and whant
149 to provide changing its visual state, recreate the item first resetting
150 <a href=#visible target="main">Visible</a> property, then setting it again.
151 </p>
152 <a name="highlight"></a>
154 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Highlight</b></font>: <b>Boolean</b>;</font>
155 <br>
156 Highlight state of the item.
157 </p>
158 <a name="visible"></a>
160 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Visible</b></font>: <b>Boolean</b>;</font>
161 <br>
162 Visibility of menu item.
163 </p>
164 <a name="data"></a>
166 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Data</b></font>: <b>Pointer</b>;</font>
167 <br>
168 Data pointer, associated with the menu item.
169 </p>
170 <a name="bitmap"></a>
172 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Bitmap</b></font>: HBitmap;</font>
173 <br>
174 Bitmap used for unchecked state of the menu item.
175 </p>
176 <a name="bitmapchecked"></a>
178 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>BitmapChecked</b></font>: HBitmap;</font>
179 <br>
180 <a href=#bitmap target="main">Bitmap</a> used for checked state of the menu item.
181 </p>
182 <a name="bitmapitem"></a>
184 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>BitmapItem</b></font>: HBitmap;</font>
185 <br>
186 <a href=#bitmap target="main">Bitmap</a> used for item itself. In addition, following special values
187 are possible:
188 HBMMENU_CALLBACK, HBMMENU_MBAR_CLOSE, HBMMENU_MBAR_CLOSE_D,
189 HBMMENU_MBAR_MINIMIZE, HBMMENU_MBAR_MINIMIZE_D, HBMMENU_MBAR_RESTORE,
190 HBMMENU_POPUP_CLOSE, HBMMENU_POPUP_MAXIMIZE, HBMMENU_POPUP_MINIMIZE,
191 HBMMENU_POPUP_RESTORE, HBMMENU_SYSTEM.
192 </p>
193 <a name="accelerator"></a>
195 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Accelerator</b></font>: <a href=kol_pas.htm#tmenuaccelerator target="_top">TMenuAccelerator</a>;</font>
196 <br>
197 Accelerator for menu item.
198 </p>
199 <a name="helpcontext"></a>
201 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>HelpContext</b></font>: <b>Integer</b>;</font>
202 <br>
203 Help context for entire menu (help context can not be assigned to
204 individual menu items).
205 </p>
206 <a name="notpopup"></a>
208 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>NotPopup</b></font>: <b>Boolean</b>;</font>
209 <br>
210 Set this property to true to prevent popup of popup menu, e.g. in
211 <a href=#onpopup target="main">OnPopup</a> event handler.
212 </p>
213 <a name="flags"></a>
215 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Flags</b></font>: <b>DWORD</b>;</font>
216 <br>
217 Pop-up flags, which are used to call TrackPopupMenuEx, when <a href=#popup target="main">Popup</a> or
218 <a href=#popupex target="main">PopupEx</a> method is called. Can be a combination of following values:
219 <br>
220 TPM_CENTERALIGN or TPM_LEFTALIGN or TPM_RIGHTALIGN
221 <br>
222 TPM_BOTTOMALIGN or TPM_TOPALIGN or TPM_VCENTERALIGN
223 <br>
224 TPM_NONOTIFY or TPM_RETURNCMD
225 <br>
226 TPM_LEFTBUTTON or TPM_RIGHTBUTTON
227 <br>
228 TPM_HORNEGANIMATION or TPM_HORPOSANIMATION or TPM_NOANIMATION or
229 TPM_VERNEGANIMATION or TPM_VERPOSANIMATION
230 <br>
231 TPM_HORIZONTAL or TPM_VERTICAL.
232 <br>
233 By default, a combination TPM_LEFTALIGN or TPM_LEFTBUTTON is used.
234 </p>
235 <a name="submenu"></a>
237 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>SubMenu</b></font>: HMenu;</font>
238 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
239 <br>
240 Submenu associated with the menu item. The same as <a href=#handle target="main">Handle</a>. It was possible
241 in ealier versions to change this value, replacing (removing, assigning)
242 entire popup menu as a submenu for menu item.
243 But in modern version of TMenu, this is not possible.
244 Instead, entire menu object should be added or removed using
245 InsertSubmenu or RemoveSubmenu methods.
246 </p>
247 <a name="ownerdraw"></a>
249 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OwnerDraw</b></font>: <b>Boolean</b>;</font>
250 <br>
251 Set this property to true for some items to make it owner-draw.
252 </p>
253 <a name="itemhandle"></a>
255 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemHandle</b></font>[ Idx: <b>Integer</b> ]: <b>DWORD</b>;</font>
256 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
257 <br>
258 Returns handle for item given by index.
259 </p>
260 <a name="itemchecked"></a>
262 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemChecked</b></font>[ Idx: <b>Integer</b> ]: <b>Boolean</b>;</font>
263 <br>
264 True, if correspondent menu item is checked.
265 </p>
266 <a name="itembitmap"></a>
268 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemBitmap</b></font>[ Idx: <b>Integer</b> ]: HBitmap;</font>
269 <br>
270 This property allows to assign bitmap to menu item (for unchecked state
271 only - for checked menu items default checkmark bitmap is used).
272 </p>
273 <a name="itemtext"></a>
275 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemText</b></font>[ Idx: <b>Integer</b> ]: <b>String</b>;</font>
276 <br>
277 This property allows to get / modify menu item text at run time.
278 </p>
279 <a name="itemenabled"></a>
281 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemEnabled</b></font>[ Idx: <b>Integer</b> ]: <b>Boolean</b>;</font>
282 <br>
283 Controls enabling / disabling menu items. Disabled menu items are
284 displayed (grayed) but inaccessible to click.
285 </p>
286 <a name="itemvisible"></a>
288 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemVisible</b></font>[ Idx: <b>Integer</b> ]: <b>Boolean</b>;</font>
289 <br>
290 This property allows to simulate visibility of menu items (implementing
291 it by removing or inserting again if needed. For items of submenu, which
292 is made invisible, True is returned. If such item made <a href=#visible target="main">Visible</a>, entire
293 submenu with all its parent menu items becomes visible. To release menu
294 properly it is necessary to make before all its items visible again.
295 This does not matter, if menu is released at the end of execution, but
296 can be sensible if owner form is destroyed and re-created at run time
297 dynamically.
298 </p>
299 <a name="itemaccelerator"></a>
301 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemAccelerator</b></font>[ Idx: <b>Integer</b> ]: <a href=kol_pas.htm#tmenuaccelerator target="_top">TMenuAccelerator</a>;</font>
302 <br>
303 Allows to get / change accelerator key kodes assigned to menu items.
304 Has no effect unless SupportMnemonics called for a form.
305 </p>
306 <a name="itemsubmenu"></a>
308 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ItemSubmenu</b></font>[ Idx: <b>Integer</b> ]: HMenu;</font>
309 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
310 <br>
311 Retrieves submenu item dynamically. See also <a href=#submenu target="main">SubMenu</a> property.
312 </p>
313 <a name="curctl"></a>
315 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>CurCtl</b></font>: <a href=kol_pas.htm#pcontrol target="_top">PControl</a>;</font>
316 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
317 <br>
318 By Alexander Pravdin. This property is assigned to a control which were
319 initiated a pop-up, for popup menu.
320 </p>
321 <h4 align="center"><font color="black">Properties, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
322 <h3 align="center"><font color="#FF8080">TMenu methods</font></h3>
323 <a name="destroy"></a>
325 <font face="Courier" color="#800080"><b>destructor</b> <font color="#808000"><b>Destroy</b></font>; <b>virtual</b>;</font>
326 <br>
327 To release menu dynamically, call <a href=#free target="main">Free</a> method instead. All (popup)
328 menus created after this (for the same control) are destroyed in
329 that case too.
330 <br>
331 It is not necessary to release menu object manually: all menus,
332 created with given form (or control), are automatically released,
333 when owner form (or control) is destroyed.
334 </p>
335 <a name="indexof"></a>
337 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>IndexOf</b></font>( Item: PMenu ): <b>Integer</b>;</font>
338 <br>
339 Returns index of an item. This index can be used to access
340 menu item. Value -2 is returned, if the Item is not a child for menu
341 or menu item, and has no parents, which are children for it, etc.
342 Menu object itself always has index -1.
343 </p>
344 <a name="radiocheckitem"></a>
346 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>RadioCheckItem</b></font>;</font>
347 <br>
348 Call this method to check radio item. (Calling this method for
349 an item, which is not belonging to a radio group, just sets its
350 <a href=#checked target="main">Checked</a> state to TRUE).
351 </p>
352 <a name="assignevents"></a>
354 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AssignEvents</b></font>( StartIdx: <b>Integer</b>; Events: <b>array</b> <b>of</b> <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a> );</font>
355 <br>
356 It is possible to assign its own event handler to every menu item
357 using this call. This procedure also is called automatically in
358 a constructor <a href=kol_pas.htm#newmenuex target="_top">NewMenuEx</a>.
359 </p>
360 <a name="popup"></a>
362 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Popup</b></font>( X, Y: <b>Integer</b> );</font>
363 <br>
364 Only for popup menu - to popup it at the given position on screen.
365 </p>
366 <a name="popupex"></a>
368 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>PopupEx</b></font>( X, Y: <b>Integer</b> );</font>
369 <br>
370 This version of popup command is very useful, when popup menu is activated
371 when its parent window is not visible (e.g., for a kind of applications,
372 which always are invisible, and can be activated only using tray icon).
373 PopupEx method provides correct tracking of menu disappearing when mouse
374 is clicked anywhere else on screen, fixing strange menu behavior in some
375 Windows versions (NT).
376 <br>
377 Actually, when PopupEx used, parent form is shown but below of visible
378 screen, and when menu is disappearing, previous state of the form (visibility
379 and position) are restored. If such solvation is not satisfying You,
380 You can do something else (e.g., use region clipping, etc.)
381 </p>
382 <a name="insert"></a>
384 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Insert</b></font>( InsertBefore: <b>Integer</b>; ACaption: <b>PChar</b>; Event: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>; Options: <a href=kol_pas.htm#tmenuoptions target="_top">TMenuOptions</a> ): PMenu;</font>
385 <br>
386 Inserts new menu item before item, given by Id (&gt;=4096) or index
387 value InsertBefore. Pointer to an object created is returned.
388 </p>
389 <a name="insertsubmenu"></a>
391 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>InsertSubMenu</b></font>( SubMenuToInsert: PMenu; InsertBefore: <b>Integer</b> );</font>
392 <br>
393 Inserts existing menu item (together with its subitems if any present)
394 into given position. See also <a href=#removesubmenu target="main">RemoveSubMenu</a>.
395 </p>
396 <a name="removesubmenu"></a>
398 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>RemoveSubMenu</b></font>( ItemToRemove: <b>Integer</b> ): PMenu;</font>
399 <br>
400 Removes menu item from the menu, returning TMenu object, representing it,
401 if submenu item, having its own children, detached. If an individual menu
402 item is removed, nil is returned.
403 This function can be useful to add or remove dynamically entire submenus
404 (created together with its subitems).
405 </p>
406 <a name="getmenuitemhandle"></a>
408 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>GetMenuItemHandle</b></font>( Idx: <b>Integer</b> ): <b>DWORD</b>;</font>
409 <br>
410 Returns Id of menu item with given index.
411 </p>
412 <a name="radiocheck"></a>
414 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>RadioCheck</b></font>( Idx: <b>Integer</b> );</font>
415 <br>
416 Call this method to check radio item. For radio items, do not
417 use assignment to <a href=#itemchecked target="main">ItemChecked</a> or <a href=#checked target="main">Checked</a> properties.
418 </p>
419 <a name="assignbitmaps"></a>
421 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AssignBitmaps</b></font>( StartIdx: <b>Integer</b>; Bitmaps: <b>array</b> <b>of</b> HBitmap );</font>
422 <br>
423 Can be used to assign bitmaps to several menu items during one call.
424 </p>
425 <a name="parentitem"></a>
427 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>ParentItem</b></font>( Idx: <b>Integer</b> ): <b>Integer</b>;</font>
428 <br>
429 Returns index of parent menu item (for submenu item). If there are no
430 such item (Idx corresponds to root level menu item), -1 is returned.
431 </p>
432 <a name="additem"></a>
434 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>AddItem</b></font>( ACaption: <b>PChar</b>; Event: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>; Options: <a href=kol_pas.htm#tmenuoptions target="_top">TMenuOptions</a> ): <b>Integer</b>;</font>
435 <br>
436 Adds menu item dynamically. Returns ID of the added item.
437 </p>
438 <a name="insertitem"></a>
440 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>InsertItem</b></font>( InsertBefore: <b>Integer</b>; ACaption: <b>PChar</b>; Event: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>; Options: <a href=kol_pas.htm#tmenuoptions target="_top">TMenuOptions</a> ): <b>Integer</b>;</font>
441 <br>
442 Inserts menu item before an item with ID, given by InsertBefore parameter.
443 </p>
444 <a name="insertitemex"></a>
446 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>InsertItemEx</b></font>( InsertBefore: <b>Integer</b>; ACaption: <b>PChar</b>; Event: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>; Options: <a href=kol_pas.htm#tmenuoptions target="_top">TMenuOptions</a>; ByPosition: <b>Boolean</b> ): <b>Integer</b>;</font>
447 <br>
448 Inserts menu item by command or by position, dependant on ByPosition parameter
449 </p>
450 <a name="redrawformmenubar"></a>
452 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>RedrawFormMenuBar</b></font>;</font>
453 <br>
454 </p>
455 <h4 align="center"><font color="black">Methods, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
456 <h3 align="center"><font color="#FF8080">TMenu events</font></h3>
457 <a name="onmenuitem"></a>
459 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnMenuItem</b></font>: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>;</font>
460 <br>
461 Is called when menu item is clicked. Absolute index of menu item
462 clicked is passed as the second parameter. <a href=#topparent target="main">TopParent</a> always is
463 passed as a Sender parameter.
464 </p>
465 <a name="onuncheckradioitem"></a>
467 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnUncheckRadioItem</b></font>: <a href=kol_pas.htm#tonmenuitem target="_top">TOnMenuItem</a>;</font>
468 <br>
469 Is called when radio item becomes unchecked in menu in result of
470 checking another radio item of the same radio group.
471 </p>
472 <a name="onpopup"></a>
474 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnPopup</b></font>: <a href=kol_pas.htm#tonevent target="_top">TOnEvent</a>;</font>
475 <br>
476 This event occurs before the popup menu is shown.
477 </p>
478 <a name="onmeasureitem"></a>
480 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnMeasureItem</b></font>: <a href=kol_pas.htm#tonmeasureitem target="_top">TOnMeasureItem</a>;</font>
481 <br>
482 This event is called for owner-drawn menu items. Event handler should return
483 menu item height in lower word of a result and item width (for menu) in
484 high word of result. If either for height or for width returned value is 0,
485 a default one is used.
486 </p>
487 <a name="ondrawitem"></a>
489 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnDrawItem</b></font>: <a href=kol_pas.htm#tondrawitem target="_top">TOnDrawItem</a>;</font>
490 <br>
491 This event is called for owner-drawn menu items.
492 </p>
493 <h4 align="center"><font color="black">Events, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
494 <h3 align="center"><font color="#FF8080">TMenu fields</font></h3>
495 <h4 align="center"><font color="black">Fields, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
496 <hr>
497 <p align="center">[&nbsp;<a href=index.htm>Index</a>&nbsp;]</p>
498 <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>
499 </body>
500 </html>