A menu import file is a text file that describes the required menu structure as a series of FoldIt (a simple text editor installed with Match-IT) folds. A 'fold' is a set of lines preceded by a line of "{{{  'fold title'" and terminated by a line of "}}}". By convention, these files have a .MNU file extension. The default system menus can be seen in the configs folder and provide comprehensive examples.

Lines beginning with an '!' are ignored as are all lines up to the first fold line containing '[RIBBON]'.

There are five types of fold used:

...  [RIBBON]

...  [BUTTON]

...  [GAP]

...  [MENU]

...  [MESSAGE]

...  [RIBBON]

The syntax of the fold title is:

[RIBBON] ButtonText [IS] ButtonHint [AS] RibbonName [COLOUR] ColourNumber[,ColourNumber] [FOR] UserGroups

A [RIBBON] fold will create a new ribbon menu according to its contents. The [AS] component defines the name of the ribbon in the BMN file. If RibbonName is omitted then ButtonText is used instead. If a BMN with the name RibbonName, or ButtonText, does not already exist then a new BMN record is created. The [COLOUR] component defines the background colour to use for the ribbon and its processes. They're represented as hexadecimal numbers (e.g. 00FFh). If omitted or 'NONE' the default colours are used. The [FOR] component defines the user groups allowed to run the ribbon as a decimal number representing the 'or' of all the mask bits involved. E.g. 7 == group 1, 2 and 3. If omitted the current user group membership is used. Groups 1,2,3 are always included. Except for the outermost ribbon, a BMI record is created that is an item in the immediately enclosing [RIBBON] fold's BMN. The ButtonHint will be put in that BMI record. The lines within the fold, up to the first contained fold, are the ribbon description. Lines are appended unless it's just a '.', in which case a line break is inserted. This is put in the BMN record and a quick help page with the same name as the ribbon. Folds inside the [RIBBON] fold become buttons on the ribbon.

...  [BUTTON]

The syntax of the fold title is:

[BUTTON] ButtonText [IS] ProcessName [WITH] P1 [AND] P2

This is defining a Match-IT process to run. The ButtonText appears on the button face. The ProcessName must be the name of some ASP record. A BMI record is created that references the Process. The BMI will be an item in the immediately enclosing [RIBBON] fold's BMN. The first line of text inside a [BUTTON] fold is the button hint. The rest is ignored. If there is no text then the button hint will be that of the process being referenced. The [WITH] P1, if present, defines the LType and value for the first BMI parameter. The [AND] P2, if present, defines the LType and value for the second BMI parameter. In both cases, the LType name precedes the value and is separated by a comma, e.g. Template,~BookCase

...  [GAP]

The syntax of the fold title is:

[GAP]

The fold contents are ignored. This creates a BMI in the immediately enclosing [RIBBON] fold's BMN that is not a process. It just creates a visual gap in the menu.

...  [MENU]

The syntax of the fold title is:

[MENU] ButtonText [IS] MenuName

This creates a button that calls up an existing menu. The ButtonText appears on the button face. The MenuName must be the name of some BMN record. A BMI record is created that references the Menu. The BMI will be an item in the immediately enclosing [RIBBON] fold's BMN. The first line of text inside a [MENU] fold is the button hint. The rest is ignored. If there is no text then the button hint will be that of the menu being referenced.

...  [MESSAGE]

The syntax of the fold title is:

[MESSAGE] ButtonText

The ButtonText appears on the button face. A BMI record is created. The BMI will be an item in the immediately enclosing [RIBBON] fold's BMN. The first line of text inside a [MESSAGE] fold is the button hint. The rest is shown as a message when the button is pressed. Lines in the fold are appended unless it's just a '.', in which case a line break is inserted.

Note:

The import file is read via the ZB source file scanning system. This provides an 'include' capability. Lines beginning !#INCLUDE and !#SECTION implement this and are recognised by ZB. Thus these lines can appear anywhere in the script. See the Import File Include Sections for details.