ADD_MENU_ITEM@

Platform

Win32, x64

Purpose

To create a dynamic menu using %mn.

Syntax

 SUBROUTINE ADD_MENU_ITEM@( HANDLE, NAME, ENABLE,
+ CHECK, CALLBACK_FUNCTION)
 INTEGER(7) HANDLE
 INTEGER ENABLE, CHECK, CALLBACK_FUNCTION
 CHARACTER(*)  NAME

Description

By using %mn (Menu), menu items can be added at run time. This is of greatest use when you wish to show a file history or a list of open windows. Items are added one at a time to the end of the pop down menu that contains the handle.

In %mn (see Menu format) an asterisk (*) must be added where a text description would previously have been placed and a integer (kind=7) argument, instead of a call-back, must be provided to hold the handle.

For example:

i=winio@('%mn[&Window[*]]&',HANDLE)

HANDLE can then be passed to ADD_MENU_ITEM@.

NAME is the new string to put into the menu i.e. the new menu item. ENABLE controls the enabling of the item (1 for enabled, zero for disabled, i.e. greyed) and the CHECK will add or remove a tick character (1 for checked, zero for unchecked). A call-back function must be provided so that ClearWin+ can act upon a menu selection. A separator is obtained if name is input as char(0).

Example

See Dynamic menus.

See also

REMOVE_MENU_ITEM@, %mn (Menu), Menu format

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited