ARPUS/ce, Version 2.6.2 (03/10/05) (SCCS 1.3) _______________________________________________________________________________ mi <pdname>/<line> [['<title>' <ce;cmd;list>] ke ] "Menu Item" DESCRIPTION: 'mi' is used to set, display, or erase a menu item in the named pull down menu. Changes made via the 'mi' command are propagated to all Ce windows on the current display. Note that the 'lmi' (Local Menu Item) command behaves just like the 'mi' command except that the changes are local to the window they are executed in. The three forms of the 'mi' command are as follows: mi <pdname>/<line> Display in ce's output window the definition currently assigned to the specified menu item. mi <pdname>/<line> 'title'<ce;cmd;list> ke Add or replace a menu item with a new definition. <ce;cmd;list> is parsed at definition time for validity, and if Ce detects a syntax error in the definition, it is rejected. Using the value '$' for the line number causes Ce to find the next available line in the menu item and use that line. This includes items previously erased. mi <pdname>/<line> ke Erases amenu item. The line is not displayed but exists internally. Using -1 as the value for line causes all the menu items in that pulldown to be erased. ARGUMENTS: <pdname> This is the name of the pulldown to be modified or added to. It is 1 to 8 alphameric characters. You can make up new pulldown names and add Menu Items to them. They can then be chained of existing pulldowns or activated from a key definition (kd), command file (cmdf) or from the 'Command:' prompt. The 'pd' (Pull Down) command causes a pulldown to be activated. To add menu items to the default pulldowns, you need to know their names. From left to right, the pull down names are: File Edit Modes Macro Help Their names are the same as their title in root pulldown whose name is Menubar. Note that in the processing of the root pulldown Menubar, item 'Help' is treated as a special case. <line> This is the zero based line number of the menu item to examine, update, or add. You may also use the value $ to indicate that the item is to be added to the end of the list. This is useful if you are augmenting the system defaults. When you add lines to an existing pulldown, make sure you do not skip any intermediate line numbers. The line numbers, starting at zero are checked until a not found condition is encountered. This is taken to be the end of the list. Thus a hole in the numbering sequence terminates the list. Also note that if the '<title>' matches the '<title>' of another member of the pulldown, the number will be overridden to replace the pulldown entry with the same title. '<title>' This is the string to be placed into menu item line. It is what is displayed on that line in the pull down. The string can be enclosed in single, double, or reverse quotes. If a menu item in the named pull down exists with the same title, the menu item replaces this item no matter what was specified in the line. <ce;cmd;list> This is the list of Ce commands separated by colons to be executed under this menu item. It is parsed just like a key definition. For an arbitrary list of Ce commands, the commands are executed when a the mouse button is released in the pulldown menu item corresponding to this list. Thus holding the left mouse down and dragging to a menu item or clicking a menu item produce the same result. The exception to the button release rule is when the Ce command list contains a single 'pd' (pulldown) command. In this case, the pulldown command is executed when the mouse button is pressed or when the mouse button is held down and the mouse is dragged into the pulldown menu item. This exception gives the pulldowns the expected behavior. A side effect of this is that you are not allowed to mix a 'pd' command in the command list with anything else. The Ce command list can either contain a single 'pd' command or some list of other Ce commands. Using cmdf, aliases, eval, or other techniques it is possible to hide the 'pd' command from the 'mi' check which disallows this mix. The effect of this is that the pulldown will appear on the button release and the corresponding menu item will not be marked with an arrow to show it is a cascading pulldown. Do this sort of thing at your own risk ke This is the terminator for the command list. If you create pulldowns which add key definitions, use the same rules for escaping "ke's" as when you nest key definitions. EXAMPLES: 1. REPLACE AN EXISTING PULLDOWN MENU ITEM: The default menu item for doing text flow is defined by: mi Edit/5 'Text Flow'tf ke This reads, "Define line 5 of the Edit pulldown as displaying the string "Text Flow" and when selected execute the 'tf' Ce command." We would prefer that to use the text flow options which do blank precompression (-p) and right justification (-b). We would also like to use default left and right boundaries of 9 and 80 if the user does not do a rectangular mark over the region to be text flowed. By adding the following line to your .Cekeys file, these changes will be implemented. mi Edit/5 'Text Flow'tf -p -b -l 9 -r 80 ke 2. ADD A CASCADING PULLDOWN: By default, the Pulldown for Macro is empty. We wish to add a cascading pulldown as the first menu item (item 0) which will perform some local functions. mi Macro/0 'My Stuff1'pd Mine ke mi Mine/0 'Find All'tmw;1,$! -c -m grep -c \\&'Find: ' ke mi Mine/1 'Print File'tmw;1,$! -c -m lp ke mi Mine/2 'Print Region'! -c -m lp ke mi Mine/3 'Count Words'! -c -m wc -w ke mi Mine/4 'Sort Region'! sort ke Note: If you want to try these out, copy them to the default paste buffer (using F1 and F2 for example), press Escape and execute the Ce command 'cmdf -p'. This will execute the contents of the paste buffer as a command file. 2. ADD AN ENTRY TO THE END OF THE MACRO PULLDOWN: alias ispell ro -off;pw;pn;tdmo;tl;dr;tr;xc -l file;tdm;tl;xd -l junk;icon -i;es'cpo -w "ceterm -geo c80x24 -autoclose y -vt on -w \\\'ispell ';xp file;tr;es'\\\'"';en;tmw;1,$xd -l junk;xd -l junk;tdm;es'xp -f ';xp file;tr;en;icon -w ke mi Macro/$ 'Ispell'ispell ke RELATED HELP FILES: lmi (Local Menu Item) pdm (Pull Down Menus) tmb (To Menu Bar) pd (Pull Down) kd (Key Definition) alias (Alias commands) cmdf (Command File) commands (List of Commands) menubarCon Menu Bar Concepts support (customer support) _______________________________________________________________________________ Copyright (c) 2005, Robert Styma Consulting. All rights reserved.