AUI_Menu Simplified Method

The simplified menu calling syntax uses just five parameters, as shown here:

xcall AUI, AUI_MENU, opcode, mdfspec, state, status {,dlgid}

opcode, state, status, dlgid have the same meaning and usage as for the traditional method, described above.

mdfspec (String) should contain the filespec (AMOS or native format) of a "Menu Definition File" which consists of lines of the following format:

;(Blank lines and lines starting with semicolon are ignored)

;

MENUID,MNUTXT,TYPE,CMD

MENUID,MNUTXT,TYPE,CMD

etc.

 

By convention, the normal extension for such a file is MDF (Menu Definition File). If the mdfspec parameter is "", then it is assumed to refer to A-Shell's help menu definition file, $miame\doc\ashelp.mdf.

If running on a UNIX server with an ATE client, the mdfspec will be resolved on the PC side and must reside there in advance of the call. (You can transfer it via FTP necessary.) If just a filename and optional extension given, it will be treated as being in the local ATE current ppn, which by default is DSK0:[1,4].

The file can specify any number of menu items (subject to the maximum of 125 custom menu items at any one time), all of which will be added, deleted, or enabled/disabled in one operation.

Each of fields menuid, mnutxt, type and cmd have the same meaning as in the traditional calling format. As an added convenience, the TYPE field may also be specified as a three-character mnemonic:

Type

Mnemonic

0

CMD

1

<not supported in MDF format>

16

SUB

2048

SEP

65536

KBD

131072

REG

 

menuid can also be specified as a mnemonic, as shown in the following table. Note that this is the same table with the same values as shown and as used in the "Traditional Method." In the "Simplified Method," however, the mnemonics are allowed, whereas in the "Traditional Method" they are not.

MenuID

Meaning

0 or "Top"

Top level menu as a whole. Use this when adding or deleting an item that appears on the horizontal menu bar (which starts with items "File", "Edit", "Settings", "Help".

1 or "File"

The "File" menu. Use this to add or delete items to the drop down menu that appears when you click on "File".

2 or "Edit"

The "Edit" menu. Use this to add or delete items to the drop down menu that appears when you click on "Edit".

3 or "Settings"

The "Settings" menu. Use this to add or delete items to the drop down menu that appears when you click on "Settings".

4 or "Help"

The "Help" menu. Use this to add or delete items to the drop down menu that appears when you click on "Help".

5 or <name>

This would be the number of the first item added to the top level menu bar. You could also refer to it by the same text that you specified as mnutxt when you added it. Use this to add or delete items to the drop down menu that appears when you click on this menu.

6 – 14 or <name>

Same idea as for five, but for the sixth through fourteenth items on the top menu bar.

 

Any of the fields in the MDF may optionally be enclosed in quotes – this in only mandatory when the field itself contains a comma.

See the notes in the TYPE table and under the CMD definition for the traditional method above for details about how to format the CMD string for the various TYPEs.

As an example, consider the following call and sample MDF file. The comments in the sample.mdf should hopefully make clear what it does.

xcall MIAMEX, MX_WINMMU, 1, "sample.mdf", 0, STATUS

The Simplified Method does not support the more advanced capabilities added in 1154 (checked and radio button menus, nested submenus, menu icons.)