XEROX TOGMENU 2 4 1 TogMenu 1 4 By: Henry Thompson (HThompson.pa@Xerox.com) INTRODUCTION This is a facility for building single-region menus which cycle through a sequence of options as you left-button. It can be used for start/stop buttons, or for parameter setting with a permanent display of the value selected. FUNCTIONS (MakeTogMenu list-of-items) [Function] Creates a TogMenu from the list of items. An item is of the form (name valSet outFn explainString hidden), or just a non-list which is both name and valSet. Listp name/valSet is evaluated for display/value respectively. Otherwise used as is, with NIL valSet defaulting to name. OutFn is called as you leave a setting, useful for Start/Stop sorts of things. Items with non-NIL hidden do not appear as you cycle with left button, but will appear in pop-up menu. (TogMenu tm ...) [Function] Displays a TogMenu, tm, created by MakeTogMenu. Drive it with left button - middle button makes an ordinary pop-up menu of it - selecting in this sets you in that state. The outFn of the state you thereby leave is NOT called. (TogMenuReset menu item) [Function] to reset menu to item or initial state if item is unspecified. (TogMenuValue menu) [Function] Gets the current value. Use it with no argument as the name of an item to make an item which shows its value. EXAMPLES For example as items: (One 1) displays the word "One" and has value 1 ((TogMenuValue)(RAND 1 100) NIL "A random number") has as value a random number, which is displayed (Start NIL (DoIt) "Start running") will display Start, and call (DoIt) when you left-button it, and finally, ((TogMenuValue) (RESETFORM (TTYDISPLAYSTREAM someWindow)(READ)) NIL "Input a value" Other) will not appear as you cycle through, but will show up as an item labelled "Other" if you middle-button, and if selected will read a value which will also be displayed. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))1È È(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEAD(TERMINAL MODERN MODERN MODERN MODERN MODERNLOGO?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN - ã    +&$ N^N /    o (31#'d©h{zº