Please enable JavaScript to view this site.

A-Shell Development History

AUI_CONTROL enhancement: The syntax of the Tooltip parameter has been expanded for static image controls to allow for context (and "hover") menus.

Tooltip only (original syntax):

tooltip

Menu only:

\menudef

Tooltip and menu:

>tooltip\menudef

This scheme, with > and \ leadins, follows the general syntax relating to tooltips and context menus supported by INFLD's HLPIDX parameter.

The menudef syntax is:

\{@<attrib>\} <text>,<cmd>; ... <text>,<cmd>;

It must start with a leading backslash, followed by an optional list of attributes (which must begin with "@" and end with "\"), followed by one or more <text>,<cmd> pairs, each terminated with a semicolon. This also matches the syntax used for INFLD menu definitions, and XTREE PopupMenu definitions, except that the attribute list is new, and there are no special $cmds yet defined.

The only attribute currently supported is:

@Hover{=##}

Where the optional =## may be used to specify the millisecond hover time before the menu appears.  0 indicates that the menu should appear immediately with no hover delay; omit the =## clause for the system default  hover delay (typically 400ms). If the Hover attribute is not specified, then the context menu acts like a typical one, i.e. doesn't appear unless you right click on the control.

Each <text> field contains the text to display in the menu, with an optional image specification, enclosed in vertical bars, i.e.:

|imagespec{=##}|display text

This is identical to the format supported by the AUI_MENU MnuTxt parameter.

The optional =## clause at the end of the image spec specifies the size of the displayed image in pixels. The width and height of the image will be the same, so only one size value is needed.

The imagespec may be a native or AMOS-style filespec, or a DLL library reference, e.g.: "images:sunshine.ico", "exit::ashico1", "c:\img\new.png". Under ATE, if the image is not found in the specified location or default path, it will also be looked for in the ATECACHE and ATEPERMCACHE directories.

Examples

Standard right-click context menu with two options and a separator between them:

TIP$ = "\Option 1,VK_xF101;-------,;Option 2,VK_xF102;"

Same menu, but with instant display as soon as mouse enters control:

TIP$ = "\@Hover=0\Option 1,VK_xF101;-------,;Option 2,VK_xF102;"

Same menu, appearing after the standard hover time:

TIP$ = "\@Hover\Option 1,VK_xF101;-------,;Option 2,VK_xF102;"

Same menu, appearing after 100 ms, and with an icon (in its default size) from the ashico1 library next to the first option and the separator removed:

TIP$ = "\@Hover=100\|gear::ashico1|Option 1,VK_xF101;Option 2,VK_xF102;"

Same as above, but with a different icon image spec, including an explicit size of 24 pixels:

TIP$ = "\@Hover=100\|gear.ico=24|Option 1,VK_xF101;Option 2,VK_xF102;"

Standard context menu and tooltip together:

TIP$ = ">Right click for options\Option 1,VK_xF101;Option 2,VK_xF102;"

Note that combining a tooltip and a menu only makes sense for the standard right-click menus. Those with the Hover option (that appear automatically) will end up clobbering the tooltip display.