Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter NineDialog Functions (continued)

DialogSetAdHocMenu Function

Overview

The DialogSetAdHocMenu function adds or replaces an ad hoc menu to a single page dialog.

Syntax/Parameters

Syntax

int = DialogSetAdHocMenu ( string list[] );

Parameters

list

A string array containing menu strings and codes to present on the menu. The first empty item or the end of the array determines the last item added. The ‘&’ character can be used as a key code for keyboard selection of the menu item. Prefixing the menu item with ‘-’ will disable the item. 

Return Value

Returns an int value as ERROR_NONE or a formatted error code. Use the GetLastError function to retrieve error information.

Remarks

Legato does not support the MENU resource control since it requires resources to be embedded in the executable. The alternative is to set a menu during dialog setup.

DialogSetAdHocMenu differs from DialogSetMenu in that the menu items do not have to be predefined as application level menu functions.

The list parameter can contain display strings or three control terms:

‘separator’

Adding this string results in a separator line being added to the menu.

‘popup string’

Adding this string creates a popup group and adds a named position to the current menu node. The ‘string’ becomes the text of the popup. All following items are added to the popup sub menu until the ‘endpopup’ is found. An endpopup is not required if the list of menu function codes simply ends. The string is required.

‘endpopup’

Using this string ends a popup section and moves up the tree to the parent menu.

Menu function selections are posted via the ‘action’ procedure. The control id is the position in the array or’d with 0x00008000. Therefore the first item available would be 0x00008001 since the very first declaration in the array should be a popup.

An exit event can occur from a button with the control id as IDCANCEL (2), IDOK (1), the user pressing the Esc or Enter keys, the user pressing the [X] close icon or selecting ‘Close’ from the system menu or double clicking on the window icon. Programmers can use the ok and cancel procedures to prevent exit.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic