File: menu.txt
Last modified: 29-sept-94

MENU


> MENU BLOCK  string  ADD / CREATE
                      DELETE / REMOVE
                      DOCUMENT file_name
                      COLOR int
                      INITIALIZE
                      ITEM  string  ADD
                                    MODIFY
                                    REMOVE
                                    RENAME string
                                    SHOW
TEXT "string ..."
                      RENAME string
                      SHOW / LIST
     DEFAULT
     DOCUMENT ON
              OFF
     LIST
     PAGE int  INITIALIZE
               ADD  string
               REMOVE  string
               COPY  int
               LIST

MAIN DIALOG mode MENU appears in the window named STRIKES. MENU is organized in PAGES. Only a single MENU PAGE is displayed at a time. EACH MENU PAGE can be composed of MENU BLOCKS. Some BLOCKS are defined inside the program, some can be loaded and organized while the program is running. A MENU BLOCK is a group of ITEMS, where each ITEM is designed to perform a specific task related to the other ones within a single BLOCK.

With MENU command sentences it is possible to (interactively) edit MAIN menu structures (PAGES, BLOCKS and ITEMS).

PAGE


...  PAGE int ...

Any PAGE menu command, except LIST, sets the current MENU page ass well.

INITIALIZE


... INITIALIZE

INITIALIZES a menu page (removes all BLOCKS entries).

ADD


... ADD string

ADDs the specified menu BLOCK to the current menu page.

REMOVE


... REMOVE string

REMOVES the specified menu BLOCK from the current page.

LIST


... LIST

LISTS all the BLOCKS within the current page.

COPY


... COPY int

Copies the BLOCK composition from the COPY page to the current page.

BLOCK


...  BLOCK   string  ADD / CREATE
                     DELETE / REMOVE
                     DOCUMENT file_name
                     COLOR
                     INITIALIZE
                     ITEM  string   ...
                     RENAME string
                     SHOW / LIST

Each MENU BLOCK has its own COLOR, name, documentation file and can be composed of a reasonable number of ITEMS. Each ITEM has a name which is connected with a single command sentence.

ADD

ADDs another menu BLOCK to already existing ones. BLOCK contains no ITEMS, is not exposed on any PAGE and has COLOR 1 (white). ADD is a synonym for CREATE.

CREATE

CREATES another menu BLOCK. Synonym for ADD.

DELETE

DELETES a menu BLOCK. (Only user created blocks can be deleted.)

DOCUMENT


... DOCUMENT file_name

The string 'file_name' is the file from which DOCUMENTation of the BLOCK will be retrieved when MENU DOCUMENT mode is ON.

REMOVE

See DELETE.

COLOR


... COLOR inte

Specifies or changes COLOR of a MENU BLOCK.

INITIALIZE

INITIALIZES the specified BLOCK. (Sets its item count to zero and color to 1 (white).)

ITEM


...  ITEM  string   ADD    TEXT ...
                    MODIFY TEXT ...
                    REMOVE
                    RENAME string
                    SHOW
...    TEXT "string(s)"

Each ITEM has its own identifier and corresponding command string (TEXT). ITEMs can be ADDed, REMOVED, RENAMED, MODIFIED and viewed (SHOW). The TEXT command must follow an ADD or MODIFY proposal. An ITEM can be viewed (SHOW) as soon as it exist.


MAIN> menu block YYY item STR_ON rename STR_OFF
MAIN> menu block YYY item STR_OFF text "<str_off.cmds"

RENAME

RENAMES the current BLOCK identifier to something else.

SHOW

SHOWS BLOCKs ITEM composition. It is a synonym for LIST.

LIST

LIST is a synonym for SHOW.

DEFAULT


... DEFAULT

Restores original composition of MENU PAGES by keeping contents of each USER editable menu BLOCK unchanged.

DOCUMENT


... DOCUMENT ON
             OFF

Turns the MENU DOCUMENT mode ON or OFF. When the document mode is ON description of each hited menu ITEM and its BLOCK is written to the standard output. No MENU commands are accepted except the page changes. If you want to apply the menu commands you have to turn the document mode OFF again. OFF is the default.

LIST


... LIST

Displays LIST of available MENU BLOCKs.

Examples


MAIN> menu block USER_1 init
MAIN> menu block USER_1 item AROUND add text "<around.inp"
MAIN> menu block USER_1 item DUMMIES add -
text "image col 1 select aro .and. weight 0.9 1.1 end atom cros"
MAIN> menu block USER_1 item DELE_RES add text "user_3.inp"
MAIN> menu block USER_1 item SYMMETRY add text "<user_4.inp"
MAIN> menu page 2 add USER_1

Initializes the menu BLOCK USER_1 and ADDs four ITEMS (AROUND, DUMMIES, DELE_RES and SYMMETRY) and connects each item with a command file "<user_1.inp" or a single command sentence and includes the menu menu BLOCK USER_1 to the second menu page.