173 lines
15 KiB
Plaintext
173 lines
15 KiB
Plaintext
;; TESTER FOR FREEMENU
|
||
;;
|
||
;; Created By: Jim Blum
|
||
;;
|
||
;; Creation Date: FEB 20, 1987
|
||
;;
|
||
;; Last Update: MAR 5, 1987
|
||
;;
|
||
;; Filed As: {ERIS}<LISPCORE>TEST>FREEMENU>FREEMENU.TEST
|
||
;;
|
||
;; A Free Menu is built from a description of the contents and layout of the
|
||
;; menu. As a Free Menu is simply a group of items, a Free Menu Description
|
||
;; is simply a specification of a group of items. Each group has properties
|
||
;; associated with it, as does each Free Menu Item. These properties specify
|
||
;; the format of the items in the group, and the behavior of each item. The
|
||
;; function FREEMENU takes a Free Menu Description, and returns a closed
|
||
;; window with the Free Menu in it.
|
||
;;
|
||
;; The easiest way to make a Free Menu is to define a function which calls
|
||
;; FREEMENU with the Free Menu Description right there in your function.
|
||
;; This function can then also set up the Free Menu window as required by
|
||
;; the application. The Free Menu Description is then saved as part of the
|
||
;; function when you save an atplication.
|
||
;;
|
||
;; Alternatively, the Free Menu Description can be saved as a variable in a
|
||
;; file. FREEMENU can be called with the name of the variable.
|
||
;; See the real documentations &hr more details
|
||
;;
|
||
;; Call format: (FREEMENU description title background border)
|
||
;;
|
||
;; Arguments:
|
||
;; description - A Free Menu Description, specifying a group of items, is a
|
||
;; list structure. The first thing in the list is an op‚ §õõº¾µxÃõÿõʵôõ©çç¿z?<04>ôƒµôxõÿõʵµxõ÷?¤ÀÍõÿõƒô´x·ººõʵôõñ?å©çç©çç¿“€˜•ŒPUTPROP˜•ŒGABRIEL-TIMERSCOMS˜•Œ FILEDATES˜•ŒGABRIEL-TIMERS˜“˜“˜•Œ*˜•Œ;;˜Œ?Main file for running [Gabriel] Benchmark suites in Xerox Lisp:˜“˜•ŒCOMS˜“™™˜Œ:Definitions for the TIMERS type, and the definer for them:˜“˜•ŒDEFINE-TYPES˜’ŒTIMERS˜‘˜ŒGABRIEL˜“˜•Œ FUNCTIONS˜’ŒDEFINE-TIMER™#˜“™˜“™™˜ŒCONTROL VARIABLES˜“™™˜ŒD *ALL-TIMERS* - List of all the benchmark definitions you've loaded.˜“™™˜ŒB *MINIMUM-TESTS* - Min # of times to run each test, defaults to 2.˜“˜•Œ VARIABL <ITEM DESCRIPTION>
|
||
;; <ITEM DESCRIPTION> ...)
|
||
;;
|
||
;; When using ROW or TABLE formatting, the rest of the description is
|
||
;; any number of item groups, each group corresponding to a row in the
|
||
;; menu. These groups are identical in syntax to an EXPLICIT group
|
||
;; description, with an optional PROPS list and then any number of
|
||
;; Item Descriptions, except that the items need not have LEFT and
|
||
;; BOTTOM properties, as the location of each item is figured out by the
|
||
;; formatter. But the order of the rows and items is important. The
|
||
;; menu is layed out top to bottom by row, and left to right withi
|
||
;; each row. The syntax is (the comments qre not part of the description):
|
||
;;
|
||
;; ((PROPS FORMAT ROW) ; props of this group
|
||
;; (<ITEM FESCRIPTION> ; items in first row
|
||
;; <ITEM DESCRIPTION>)
|
||
;; ((PROPS ...) ; props of second row
|
||
;; <ITEM DESCRIPTION> ; items in second row
|
||
;; <ITEM DESCRIPTION>))
|
||
;;
|
||
;; When using COLUMN formatting, the syntax is identical to that of
|
||
;; ROW formatting. However each group of items corresponds to a
|
||
;; column in the menu, rather than a row. The menu is layed out left to
|
||
;; right by column, top to bottom within each column.
|
||
;;
|
||
;; Finally, a Free Menu Description can have recursively nested groups.
|
||
;; Anywhere the description can take an Item Description, it can take a
|
||
;; group, marked by the key word GROUP. A nested group inherits all
|
||
;; of the properties of its mother group, by default. However, any of
|
||
;; these properties can be overridden in the nested groups PROPS list,
|
||
;; including the FORMAT. The syntax is:
|
||
;;
|
||
;; ( ; no PROPS list, default row format
|
||
;; (<ITEM DESCRIPTION> ; first in row
|
||
;; (GROUP ; nested group, second in row
|
||
;; (PROPS FORMAT COLUMN) ; optional props
|
||
;; (<ITEM DESCRIPTION> ) ; first column
|
||
;; (<ITEM DESCRIPTION> ))
|
||
;; <ITEM DESCRIPTION>)) ; third in row
|
||
;;
|
||
;; title - The title can be a string or atom which goes in the window title
|
||
;;
|
||
;; background - The background shade of the entire Free Menu.
|
||
;;
|
||
;; border - The window border size, which must be 4 or greater when a Free
|
||
;; Menu background is used, due to the way the Window System handles
|
||
;; window borders.
|
||
;;
|
||
;;
|
||
;; Returns - a window, when then can be opened for display and use
|
||
;;
|
||
;;
|
||
;; Here is an example of a simple Free Menu Description, for a menu which
|
||
;; might provide access to a simple data base:
|
||
(DO-TEST "Simple name and address freemenu example"
|
||
(TEST-DEFUN MYLOOKUPFN (ITEM WIN POS)
|
||
(COND ((EQUAL (IL:FM.ITEMPROP (IL:FM.GETITEM 'NAME NIL WIN) 'IL:LABEL) "Perry")
|
||
(IL:FM.CHANGELABEL 'NAME "Herbert Q Perry" WIN)
|
||
(IL:FM.CHANGELABEL 'ADDRESS "13 Middleperry Dr" WIN)
|
||
(IL:FM.CHANGELABEL 'PHONE "(411) ÷67-1òó:" WIN))
|
||
(T (IL:FM.CHANGELABEL 'NAMEÀ **not found**" WIN))
|
||
)
|
||
)
|
||
(TEST-DEFUN MYEXITFN (ITEM WIN POS) (IL:CLOSEW WIN))
|
||
(TEST-SETQ FM-WIN (IL:OPENW (IL:FREEMENU '(((IL:LABEL LOOKUP IL:SELECTEDFN MYLOOKUPFN)
|
||
(IL:LABEL EXIT IL:SELECTEDFN MYEXITFN))
|
||
((IL:LABEL Name\: IL:TYPE IL:DISPLAY)
|
||
(IL:LABEL "" IL:TYPE IL:EDIT IL:ID '’ŒPPRINT-DEFINER™
|
||
˜“€€˜<E282AC>ŒBODY |