Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SeventeenApplication Integration Functions (continued)

17.5 Popup Menu Functions

17.5.1 Overview

This section describes functions that can be used to present, use and replace popup menus. Popup menus can be part of the existing application or an extension based solely on the script code.

A popup can appear as follows:

Positioning of the popup is normally by either the mouse location (such as a right click) or as a drop down from a ribbon and ‘tools’ dialog button. The menu consists of predefined functions or can be presented as an ad hoc series of strings.

Each menu entry is defined by a function code, separator or a popup. Function codes must be predefined. The state of the function code is set at the time the menu is displayed. The script cannot control the enable/disable or highlighting of the function.

Separators are simple dividing lines. Popups are submenus, as shown above with the “Insert Table Item”. For the most part, popup text is not defined as a function code. When creating popups with a script, a function must be defined with menu text set for the popup text.

17.5.2 Application Popup Menus

Obviously, the hosting application can have dozens of menus. Some of the menus can be overridden using the MenuReplacePopup function. This does not replace the actual functions but rather the function codes placed on the menu. By replacing a menu, the application is being directed to create a menu based on a specified series of predefined functions which, in turn, may be executed should the user select an item. The actual execution of function codes is left to the application which may then be hooked to connect a script.

Since application function codes must be defined prior to using them within a popup menu, scripts that define menu functions must perform the definitions prior to attempting to replace a menu.

See Appendix B, Application Menu Guide for the published list of popup menu names.

17.5.3 Ad Hoc Popup Menus

Ad hoc popups allow a menu to be created and displayed on the fly. Ad hoc popup menus do not actually execute the selected function but rather return the function code to the caller which then can execute the function as it sees fit.

17.5.4 Function Overview