| Previous Next | Contents |
Class.SYS simple Systray support. Add a Systray Item to any form with an associated icon and tooltip. Probably you would want a 16×16 icon here. Note that the & character cannot be used in the tooltip (possible bug?).
Event handlers may be set on RBM (right-mouse menu) and LBC (left-button click) and also on the standard DC (double-click) event. Typically you would put up a popup menu on RBM and open a modal dialogue box on DC. Some standard systray items also use the left-click (e.g. the volume control).
Two issues there is no way to cancel a menu without selecting an item from it, and menus do not respond to keystrokes so you cannot select with the arrow keys here.
Class.FM adds support for images in menus. The FM now has an artwork property which expects a 16 × 16n integer array of bits (as created with the PicStrip editor) in the same way as a toolbar. If this property is set on the form, you can use the PC event (remember to use this or the RC, not the Create) to run a new function ...
Do 'SetMenuImages' mat
... which expects an n × 2 matrix of menu item IDs and integers (in your IO) giving the image to be associated with each item (or submenu) in the menu which is set as the forms Menu property. Note that if you reset the menu dynamically you will need to re-apply the function above to regenerate the images. The current assumption is that the IDs are unique, so to apply the same image to more than one item you will need to give it a different ID and use the same index number for both.
To set an image for a menu, use its existing name, but enclosed in [] as it appears in the menu definition. A valid matrix of menu settings could be ...
NEW 6 OPEN 7 SAVE 8 THIS 13 [next] 14
N.B. This is documented as working in the Latest enhancements help file but you cannot currently set an ImageIndex for a menu (as opposed to a menuitem). The above table is tested by cm menimg in QA and will fail on a domain error as a result. Just skip the problem line to see the general effect.