<<

Contents

Search

>>

 

ADD_POPUPMENU

 

 

Function

 

 

Syntax:

ADD_POPUPMENU(<Menu Level>,<Mainmenu>,<Submenu>,<Macroname>)

 

<Menu Level>

= <STRING-EXPRESSION>

<Mainmenu>

= <STRING-EXPRESSION>

<Submenu>

= <STRING-EXPRESSION>

<Macroname>

= <MACRONAME>

 

 

Meaning:

The function ADD_POPUPMENU creates a popupmenu, which can then be called by START_POPUPMENU.

 

The rules and returncodes of the function ADD_MENU also apply to ADD_POPUPMENU.

 

When creating a popupmenu the following steps have to be taken:

 

1. Create branches of the popupmenu with the function ADD_POPUPMENU

2. Start the popupmenu with START_POPUPMENU.

 

ADD_POPUPMENU returns the following values:

 

Returncode

Meaning

0

No error

6001

Faulty or invalid menu level

 

Parameter:

Menu Level

Specifies where in the menu tree the new branch is positioned. <Menu Level> may only consist of numbers and points between the numbers.

 

Examples:

"1" defines menu level 1.

"1.2" refers to the second submenu item of menu level "1".

"1.2.1" refers to the 1st submenu item of menu level "1.2".

 

The top menu levels ("1", "2", ...) do not have to be ascending in gapless order. They do not have to be defined by the function ADD_POPUPMENU in ascending order either. Subordinate menu branches can only be defined, however, if the respective higher branch already exists. 

Mainmenu

Specifies the name of the higher menu item.

 

If a subordinate menu branch is created, the name submenu name is replaced for the main menu name in the higher menu item.

 

Example:

H% = ADD_POPUPMENU("1","File","Create;Close;;Exit"

H% = ADD_POPUPMENU("1.2","Open","Image file;Text file"

 

The 2nd menu item is no longer called Create but Open.

Submenu

In <Submenu> the names of the submenu items are listed and separated by semi-colons. Empty entries are allowed. An empty entry creates a separator line in the menu. At the beginning of a submenu name two images, separated by commas, can be specified. The first image @<Image-1> is displayed if the menu item is not selected, the second image @<Image-2> is displayed if the menu item is selected.

 

Thus a submenu item has the following structure:

 

[@<Image-1>,[@<Image-2>,]]<Submenu Name>

Macroname

The macro is called if a menu item has been selected. It is allowed to use the same macro with several menu branches. When the macro is executed the variable EBUS_MENU$ contains the name of the selected menu item.

 

Sample:

H% = ADD_POPUPMENUE("1","&Search","&Name;&Town",POPUPMENU.MACRO)

 

See also:

DEL_POPUPMENU

START_POPUPMENU

EBUS_MENU$

POPUPACTIVATE

POPUPDEACTIVATE

ADD_MENU