User Tools

Site Tools


jvs:cigal:manual:chapter2:menujunk

CIGAL Reference Manual===== menujunk – ===== When a menu name is specified in a MENU command, it is looked up in the in-core MNUTBL. If it is not found there, it is looked up in the system menu file (in MFILE). If it is found in either place, reading the display text into core memory, and loading the appropriate values into the MENUHDR table activate the menu. If it was not already in the in-core table its entry is copied there. If it was not already loaded at all, the file is found, loaded into the system menu file, and entered into the MNUTBL before it is activated as described above. NOTE: The very first MENU call opens the system menu file. If the the file does not exist, then it is created. If the file already exists, the old MNUTBL is read from that file and loaded into the in-core copy of MNUTBL. Because all the information about a menu is contained within the menu file, this is a quick way of initializing many menus at once. Only a limited number (⇐ INIT_MENUS, currently 256) of menus can be loaded this way. Individual menus are specified by name. The name is usually the name of a text file with a .MNU suffix. For example, menu 1 screen would expect to find a disk file named SCREEN.MNU, which contains all of the information needed to specify a pull-down menu. The format for the menu specification file is described below. You can also define menus explicitly, without first needing to create a text file, by putting a '{' after the MENUNAME argument and then entering the menu text on the following lines, ending with a '}' on a line of its own. For example: menu 1 test { … ; menu text – see format below } The MENU command manipulates menus by reading a menu file (or an explicit menu if you use the { … } syntax), converting the menu text into an internal format, and then storing the converted version in the menu table. This menu table is kept as a direct access disk file that allows up to 65 menus of any size, to be loaded simultaneously. Of these, up to 10 pull-down menus, 1 function menu, and 1 tablet or graphics menu can be active at any one time. Menus only need to be loaded into the table once; after that the MENU command can be used to rapidly switch which menus are active simply by modifying the menu table. The MENU command looks after checking whether a particular menu name has already been loaded and, if so, skips the reading and converting steps. You can use MENU as often as you wish to change which menus are active. When you activate pull-down menus, the MENU command creates a menu bar across the top of the computer screen. For each active menu, the menu name is displayed as the menu title on the menu bar. You can redraw this menu bar (for example if some command accidentally erases it) by entering the MENU command with no arguments. Normally, the very first use of the MENU command causes the menu table to be created and loads the first entries. However, if the first call to MENU has no arguments, it checks to see whether a menu table file (called CIGALMNU.TMP) is present in the current directory, and if so, that file is used as the menu table. This saves time by letting you begin with all the same menus that you were using the last time you ran CIGAL, without having to reload each menu individually again. The MENU command is used to manipulate CIGAL command menus. All 4 types of menus – Pull-down, Function, Screen, and Tablet – are controlled by this command (see [MENUS][1] for a general discussion of CIGAL menus). If you want to use more menus, the additional menus will have to be loaded as temporary menus (that is, they do not get stored in the syetem menu file.) The format of a menu specification for a PULL-DOWN menu is: “Identifier Command(s) ? Help line(s) “Identifier Command(s) ? Help line(s) … or for a screen menu, the format specification is: % X0 Y0 NX NY BckgdIntens VideoMode ; for whole display region “Header Text ; Centered at top of display X1:X2 Y1:Y2 Boxflg Intens BckgdIntens “Identifier Command(s) ? Help line(s) X1:X2 Y1:Y2 Boxflg Intens BckgdIntens “Identifier Command(s) ? Help line(s) … or, for TABLET type menus: X1:X2 Y1:Y2 Command(s) ? Help line(s) X1:X2 Y1:Y2 Command(s) ? Help line(s) … For all menus, the COMMANDs can be any legal CIGAL commands, or group of CIGAL commands. Multi-line commands are permitted because MENU does not move on to the next entry until it reads a blank line. (If you want to insert a blank line within the commmands you can use the BACKSLASH character (\) on a line by itself.) HELP LINES are text lines starting with a question mark '?' character. Have as many of these for each command as space permits. For the PULL-DOWN and GRAPHICS menus, the IDENTIFIER is a short text string (eg., 6-16 characters), which will be displayed on the menu screen. For the FUNCTION menu, the IDENTIFIER strings are not displayed, they are used to identify which key is associated with each command string. In this case, the IDENTIFIERs must be one of the following strings: ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 M1 M2 M3 … Of these, ESC, and F1-F12 correspond to the keys with those names on the computer keyboard, whereas M1 - M?? correspond to the buttons on the computer's mouse if available. For a two button Mouse, M1 will usually be the Left button, M2 the right, and M3 the two together. If there are more than two buttons you will also be able to specify higher “M” values for the extra possible combinations. For a TABLET menu, it is assumed that the command lines correspond to positions along the side of a digitizing tablet and that the prompts will already be displayed on the tablet itself. Therefore, no IDENTIFIER lines are expected in TABLET commands. The COMMANDS should simply be entered in the same order as the corresponding positions on the tablet.* new above – old below usage: menu flag menuname [menuname2 menuname3 … ] or: menu flag menuname { … } or: menu The MENU command is used to create, read, select, or delete command menus. There are 4 different types of menus, all of which are controlled by this Command. See help for [MENUS][1] for a general description of the 4 types of menus used in CIGAL. The FLAG argument indicates which type is being specified. The following FLAG values specify menu types: 1-10 Pull-down menus – values correspond to the 10 menu positions across the menu bar 0 Graphics menu -1 Function key commands -2 Tablet menu In addition, FLAG can be used with the following values and meanings: -3 Replace the named menu -4 Delete the named menu If the FLAG argument is omitted, its value defaults to the next unused pull-down menu position. USING MENUS Once menus have been activated their usage is fairly straightforward. Function menus define the meaning of the function keys, so to execute these commands you simply press the appropriate keys on the keyboard. The Pull-down menus appear across the title bar on the screen. You can call up the menu itself by moving the cursor, using the arrow keys on the keyboard, or by using the mouse. With the arrows, the menus appear automatically. With the mouse, you get the menu by pressing the left button when the cursor is over the menu title. You move around within the menu by moving the cursor. You execute an entry by pressing the <RETURN> or <ENTER> key or by pressing the left button on the mouse. To get help for a particular menu entry, move the cursor to that entry and press the ?' key on the keyboard or the right button on the mouse. If nothing happens then no help information is available for that entry (see below). The Pull-down menu will disappear as soon as you move the cursor off the menu or press any keyboard key (except '?' as mentioned above). Note: You cannot use a menu after you have started to type a command. You must either finish the command or erase the text before the menus can be used again. MENU FORMAT To specify a menu you usually need to provide three pieces of information for each menu entry: - an IDENTIFIER - the COMMANDS to be executed - HELP information For all menus, the COMMANDs can be any legal CIGAL commands, or group of CIGAL commands. Multi-line commands are permitted by putting a backslash (\) at the end of each line except the last. HELP INFORMATION is entered after the COMMANDS as text lines that start with a question mark (?) as the very first character (not preceded by any blank spaces); you can have as many of these for each command as space permits (which is generally much more than you need). Help information is optional but recommended. For the Pull-down and Graphics menus, the IDENTIFIER is a short text string (eg., 6-16 characters), which will be displayed on the menu screen when the menu is activated. For Function menus, the IDENTIFIER strings are not displayed, they are used to identify which key is associated with each command string. In this case, each IDENTIFIER must be one of the following strings: ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 M1 M2 M3 … Of these, ESC, and F1-F12 correspond to the keys with those names on the computer keyboard, whereas M1 - M?? correspond to the buttons on the computer's mouse if available. For a two button Mouse, M1 will usually be the Left button, M2 the right, and M3 the two together. If there are more than two buttons you will also be able to specify higher “M” values for the extra possible combinations. For a TABLET menu, it is assumed that the command lines correspond to positions along the side of a digitizing tablet and that the prompts will already be displayed on the tablet itself. Therefore, no IDENTIFIER lines are expected in TABLET menus; the COMMANDS should simply be entered in the same order as the corresponding positions on the tablet. You can put comments on any line in a menu file, EXCEPT help lines that begin with a '?', by using a semicolon, ';'. The semicolon and everything to its right are ignored (except a '\' continuation mark at the end). Sample Pull-down menu entered in a text file named TEST.MNU: Help type { ; this command is continued over 4 lines\ To get help for a menu item, move the cursor to that item and\ type a question mark (?) or press the right mouse button.\ } ; this is the last line of the first command ? This menu entry tells you how to get help for menu entries. Clear Screen erase 0\ menu ; menu with no arguments redraws the title bar ? Erase the active portion of the display Quit CIGAL quit ? Leave the CIGAL program altogether Sample Function menu, entered explicitly: menu -1 funcs1 { ESC ^^6(1,1) = ^^5(1,0)\ menu F1 type {\ ESC Reset screen window\ F1 Print this help message\ F2 Help\ F3 Erase Screen\ M2 Beep\ } M2 ; key commands can be entered in any order type '\7' ; sound bell F2 help F3 vwindow=1\ ; go to top half of display erase 0\ vwindow=0\ ; go back to bottom of display erase 0 } ; this is the end of the menu specification [SCREEN][1]. See Also:**
COMMANDS(1), KEYBOARD(1), MENUS(1), SCREEN(1)

CIGAL Home, CIGAL Manual, Manual Help

jvs/cigal/manual/chapter2/menujunk.txt · Last modified: 2023/02/23 18:43 (external edit)