(FILECREATED "30-Nov-84 10:10:36" {AZTEC}<TRILLIUM>BIRTHDAY84>ITEMTYPES>IDO-REDEF-ITEMTYPES.;1 19251  

      changes to:  (VARS IDO-REDEF-ITEMTYPESCOMS)

      previous date: "29-Aug-84 14:31:30" {AZTEC}<TRILLIUM>BIRTHDAY84>IDO-REDEF-ITEMTYPES.;1)


(PRETTYCOMPRINT IDO-REDEF-ITEMTYPESCOMS)

(RPAQQ IDO-REDEF-ITEMTYPESCOMS [(ITEMTYPES CASCADE.BUTTON FLASHING.SENSITIVE.REGION 
					   INVERTING.CASCADE.TWO.BUTTONS NUMBER.PAD TIMEOUT 
					   TIMEOUT.SENSOR)
				(P (COMPILE.INTERNAL.FNS.IF.NECESSARY))
				(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS
					  (ADDVARS (NLAMA)
						   (NLAML DISABLE.TIMEOUT START.TIMEOUT 
							  ACTON.CASCADE.BUTTON)
						   (LAMA])
(READ.ITEMTYPE CASCADE.BUTTON 5)
(\TYPE ITEM.TYPE NAME CASCADE.BUTTON COMMENT  
"A small button, with a label on it, which flashes when pushed, and does internal action" KIND 
COMPOSITE PARAMETERS  ((\TYPE PARAMETER NAME PLACEMENT TYPE  (POSITION) DEFAULT  (170 . 170) COMMENT  
"The grid position of the lower left corner of the button" GRID.TYPE  (LOCATION))  (\TYPE PARAMETER 
NAME BUTTONS TYPE  (LIST  (STRUCTURE  ((TEXT  (LIST  (STRING)))  (VALUE  (CONSTANT))))) DEFAULT  (((
"LABEL 1") VALUE.1)  (("LABEL 2") VALUE2)) COMMENT  "The buttons themselves")  (\TYPE PARAMETER NAME 
PICTURE TYPE  (BITMAP.NAME) DEFAULT SIMPLE.BUTTON.BITMAP COMMENT  "The graphic for the button")  (
\TYPE PARAMETER NAME CELL TYPE  (CELL) DEFAULT CELL.1 COMMENT  "The cell changed by the button")  (
\TYPE PARAMETER NAME RESPONSE TYPE  (ONEOF  (NONE BLACK.WHILE.DEPRESSED INVERTS.WHEN.DEPRESSED)) 
DEFAULT BLACK.WHILE.DEPRESSED COMMENT  "The response to being depressed")  (\TYPE PARAMETER NAME 
CONTINUOUS? TYPE  (ONEOF  (YES NO)) DEFAULT NO COMMENT  
"Whether or not to keep going if the button is held down")  (\TYPE PARAMETER NAME RATE TYPE  (INTEGER)
 DEFAULT 300 COMMENT  "Rate it changes (in milliseconds) if continuous")  (\TYPE PARAMETER NAME 
AT.LIMIT TYPE  (ONEOF  (WRAP.AROUND STICK.AT.LIMIT)) DEFAULT WRAP.AROUND COMMENT  
"What to do when it reaches the limit")  (\TYPE PARAMETER NAME DIRECTION TYPE  (ONEOF  (UP DOWN)) 
DEFAULT UP COMMENT  "The direction in which to walk through the BUTTONS list")) SUBITEM.SPECS  ((LABEL
 BUTTON  (ITEM PICTURE  (PLACEMENT  (PTRANSLATE PLACEMENT  (MINUS BUTTON.BITMAP.EXTRA) 0))  (BITMAP 
PICTURE)))  (SELECT RESPONSE  (NONE  (ITEM SENSITIVE.REGION  (PLACEMENT  (BOUNDING.BOX BUTTON))  (
ACTION.FORM  (LIST  (QUOTE ACTON.CASCADE.BUTTON) BUTTONS CELL  (AND  (EQ CONTINUOUS?  (QUOTE YES)) 
RATE)  (EQ DIRECTION  (QUOTE DOWN))  (EQ AT.LIMIT  (QUOTE WRAP.AROUND))))))  (BLACK.WHILE.DEPRESSED  (
ITEM FLASHING.SENSITIVE.REGION  (PLACEMENT  (BOUNDING.BOX BUTTON))  (ACTION.FORM  (LIST  (QUOTE 
ACTON.CASCADE.BUTTON) BUTTONS CELL  (AND  (EQ CONTINUOUS?  (QUOTE YES)) RATE)  (EQ DIRECTION  (QUOTE 
DOWN))  (EQ AT.LIMIT  (QUOTE WRAP.AROUND))))))  (INVERTS.WHEN.DEPRESSED  (ITEM 
INVERTING.SENSITIVE.REGION  (PLACEMENT  (BOUNDING.BOX BUTTON))  (ACTION.FORM  (LIST  (QUOTE 
ACTON.CASCADE.BUTTON) BUTTONS CELL  (AND  (EQ CONTINUOUS?  (QUOTE YES)) RATE)  (EQ DIRECTION  (QUOTE 
DOWN))  (EQ AT.LIMIT  (QUOTE WRAP.AROUND)))))))) OTHER  (FNS  ((ACTON ACTON.CASCADE.BUTTON)  (NIL 
INCREMENT.CASCADE.BUTTON))) CLASSES  (BUTTON COMPOSITE))
(DEFINEQ

(ACTON.CASCADE.BUTTON
  [NLAMBDA (BUTTONS CELL RATE DOWN WRAP.AROUND)              (* KKM "17-MAY-83 15:04")
    (INCREMENT.CASCADE.BUTTON BUTTONS CELL DOWN WRAP.AROUND)
    (COND
      (RATE (do (TRILLIUM.DISMISS RATE)
		(COND
		  ((MOUSESTATE UP)
		    (RETURN)))
		(INCREMENT.CASCADE.BUTTON BUTTONS CELL DOWN WRAP.AROUND])

(INCREMENT.CASCADE.BUTTON
  [LAMBDA (BUTTONS CELL DOWN WRAP.AROUND)                    (* KKM "20-MAY-83 16:19")
    (PROG (CURRENT.VALUE N NEW.VALUE)
          (SETQ N (LENGTH BUTTONS))
          (SETQ CURRENT.VALUE (GET.CURRENT.VALUE CELL))
          [COND
	    [DOWN (for I from 1 to (SUB1 N) as ELEM on BUTTONS when (EQUAL (CADADR ELEM)
									   CURRENT.VALUE)
		     do (SETQ NEW.VALUE (CADAR ELEM))
			(RETURN)
		     finally (SETQ NEW.VALUE (COND
				 (WRAP.AROUND (CADAR (NTH BUTTONS N)))
				 (T CURRENT.VALUE]
	    (T (for I from 1 to (SUB1 N) as ELEM on BUTTONS when (EQUAL (CADAR ELEM)
									CURRENT.VALUE)
		  do (SETQ NEW.VALUE (CADADR ELEM))
		     (RETURN)
		  finally (SETQ NEW.VALUE (COND
			      (WRAP.AROUND (CADAR BUTTONS))
			      (T CURRENT.VALUE]
          (CHANGE.CURRENT.VALUE CELL NEW.VALUE])
)
(READ.ITEMTYPE FLASHING.SENSITIVE.REGION 5)
(\TYPE ITEM.TYPE NAME FLASHING.SENSITIVE.REGION COMMENT  
"A sensor, which goes black on depression, takes action, goes white again on release" KIND SENSOR 
PARAMETERS  ((\TYPE PARAMETER NAME PLACEMENT TYPE  (REGION) DEFAULT  (100 100 30 30) COMMENT  
"An area sensitive to touch")  (\TYPE PARAMETER NAME ACTION.FORM TYPE  (FORM) DEFAULT  (ACTION.PRINT  
"This action is brought to you by a FLASHING.SENSITIVE.REGION") COMMENT  
"The action to be taken as the sensitive region is touched")  (\TYPE PARAMETER NAME 
WHEN.TO.TAKE.ACTION TYPE  (ONEOF  (BUTTON.UP BUTTON.DOWN)) DEFAULT BUTTON.DOWN COMMENT  
"Take the action on the rising or the falling edge of the button press")) OTHER  (FNS  ((SENSE 
SENSE.FLASHING.SENSITIVE.REGION))) CLASSES  (SENSOR))
(DEFINEQ

(SENSE.FLASHING.SENSITIVE.REGION
  [LAMBDA (ITEM TOUCH XCOORD YCOORD)                         (* edited: "25-Aug-84 18:41")
                                                             (* TRB "12-JAN-84 17:09")
    (COND
      (TOUCH (PROG [BOX ACTION (REGION (GET.PARAMQ ITEM PLACEMENT))
			(ON.DOWN (EQ (GET.PARAMQ ITEM WHEN.TO.TAKE.ACTION)
				     (QUOTE BUTTON.DOWN]
	           (COND
		     ((INSIDEP REGION XCOORD YCOORD)
		       (BEGIN.EVENT ITEM)
		       (SETQ BOX (BIGGER.BOX REGION))
		       (SETQ ACTION (GET.PARAMQ ITEM ACTION.FORM))
		       (AND ON.DOWN (TRILLIUM.EVAL ACTION))
		       (FLIP.BOX BOX)
		       (WAITNOBUG)
		       (FLIP.BOX BOX)
		       (AND (NOT ON.DOWN)
			    (TRILLIUM.EVAL ACTION))
		       (END.EVENT)
		       (RETURN T])
)
(READ.ITEMTYPE INVERTING.CASCADE.TWO.BUTTONS 5)
(\TYPE ITEM.TYPE NAME INVERTING.CASCADE.TWO.BUTTONS COMMENT  "A cascade which lights its indicators" 
KIND COMPOSITE PARAMETERS  ((\TYPE PARAMETER NAME PLACEMENT TYPE  (POSITION) DEFAULT  (340 . 255) 
COMMENT  "Offset for the whole bunch" GRID.TYPE  (LOCATION))  (\TYPE PARAMETER NAME BUTTONS TYPE  (
LIST  (STRUCTURE  ((TEXT  (LIST  (STRING)))  (VALUE  (CONSTANT))))) DEFAULT  ((("LABEL 1") 1)  ((
"LABEL 2") 2)  (("LABEL 2") 3)) COMMENT  "The buttons themselves")  (\TYPE PARAMETER NAME 
BUTTON/INDICATOR.SPACING TYPE  (OFFSET.VECTOR) DEFAULT  (0 . 51) COMMENT  
"Spacing between button and bottom indicator")  (\TYPE PARAMETER NAME BUTTON.SPACING TYPE  (
OFFSET.VECTOR) DEFAULT  (51 . 0) COMMENT  "Spacing between the buttons")  (\TYPE PARAMETER NAME 
INDICATOR.SPACING TYPE  (OFFSET.VECTOR) DEFAULT  (0 . 34) COMMENT  "Spacing between indicators")  (
\TYPE PARAMETER NAME UP.PICTURE TYPE  (BITMAP.NAME) DEFAULT UP.BUTTON COMMENT  
"Bitmap picture for Up button")  (\TYPE PARAMETER NAME DOWN.PICTURE TYPE  (BITMAP.NAME) DEFAULT 
DOWN.BUTTON COMMENT  "Bitmap picture for Down button")  (\TYPE PARAMETER NAME CONTINUOUS? TYPE  (ONEOF
  (YES NO)) DEFAULT NO COMMENT  "Whether or not to keep going if the button is held down")  (\TYPE 
PARAMETER NAME RATE TYPE  (INTEGER) DEFAULT 300 COMMENT  
"Rate it changes (in milliseconds) if continuous")  (\TYPE PARAMETER NAME AT.LIMIT TYPE  (ONEOF  (
WRAP.AROUND STICK.AT.LIMIT)) DEFAULT WRAP.AROUND COMMENT  "What to do when you reach the limit")  (
\TYPE PARAMETER NAME FONT TYPE  (FONT) DEFAULT  (HELVETICA 10) COMMENT  
"The font in which to print the information")  (\TYPE PARAMETER NAME TEXT.DISPLACEMENT TYPE  (
OFFSET.VECTOR) DEFAULT  (17 . 17) COMMENT  "Offset for the text")  (\TYPE PARAMETER NAME 
HORIZONTAL.ALIGNMENT TYPE  (ONEOF  (LEFT CENTER RIGHT)) DEFAULT CENTER COMMENT  
"Horizontal alignment of the text")  (\TYPE PARAMETER NAME VERTICAL.ALIGNMENT TYPE  (ONEOF  (TOP 
CENTER BOTTOM)) DEFAULT CENTER COMMENT  "Vertical alignment of the text")  (\TYPE PARAMETER NAME CELL 
TYPE  (CELL) DEFAULT CELL.1 COMMENT  "The affected cell")  (\TYPE PARAMETER NAME INITIAL.VALUE TYPE  (
CONSTANT) DEFAULT VALUE.1 COMMENT  "An initial value for the cell")  (\TYPE PARAMETER NAME 
SHOW.INITIAL.VALUE? TYPE  (ONEOF  (YES NO)) DEFAULT YES COMMENT  
"Whether or not the default is visible - ala 1075")) SUBITEM.SPECS  ((ITEM CASCADE.UP.DOWN.BUTTONS  (
PLACEMENT PLACEMENT)  (INDICATORS BUTTONS)  (CELL CELL)  (BUTTON.SPACING BUTTON.SPACING)  (UP.PICTURE 
UP.PICTURE)  (DOWN.PICTURE DOWN.PICTURE)  (CONTINUOUS? CONTINUOUS?)  (AT.LIMIT AT.LIMIT)  (RATE RATE))
  (FOREACH  (BUTTON IN  (COND  ((EQ SHOW.INITIAL.VALUE?  (QUOTE YES)) BUTTONS)  (T  (for B in BUTTONS 
collect B when  (NOT  (EQUAL  (CADR B) INITIAL.VALUE))))))  (I FROM 0) DO  (ITEM 
INVERTING.CASCADE.LIGHT  (PLACEMENT  (PTRANSLATE PLACEMENT  (NEW.POSITION  (IPLUS  (ITIMES I  (CAR 
INDICATOR.SPACING))  (CAR BUTTON/INDICATOR.SPACING))  (IPLUS  (ITIMES I  (CDR INDICATOR.SPACING))  (
CDR BUTTON/INDICATOR.SPACING)))))  (TEXT  (CAR BUTTON))  (FONT FONT)  (TEXT.OFFSET TEXT.DISPLACEMENT) 
 (HORIZONTAL.ALIGNMENT HORIZONTAL.ALIGNMENT)  (VERTICAL.ALIGNMENT VERTICAL.ALIGNMENT)  (CELL CELL)  (
VALUE  (CADR BUTTON))))  (ITEM INITIALIZATION  (PLACEMENT PLACEMENT)  (ACTION.FORM  (LIST  (QUOTE 
SET.CELL) CELL  (KWOTE INITIAL.VALUE))))) OTHER  (FNS  ((1 
CONVERT.INVERTING.CASCADE.TWO.BUTTONS.OFFSETS))) CLASSES  (BUTTON COMPOSITE) VERSION 1)
(DEFINEQ

(CONVERT.INVERTING.CASCADE.TWO.BUTTONS.OFFSETS
  [LAMBDA (ITEM)                                             (* edited: "16-Aug-84 12:32")
    (PROG NIL
          (CONVERT.GRIDDED.OFFSETSQ ITEM BUTTON/INDICATOR.HORIZONTAL.SPACING BUTTON/INDICATOR.SPACING 
				    BUTTON/INDICATOR.SPACING)
          (CONVERT.GRIDDED.OFFSETSQ ITEM TEXT.DISPLACEMENT TEXT.DISPLACEMENT.↑ TEXT.DISPLACEMENT)
          (CONVERT.GRIDDED.OFFSETSQ ITEM HORIZONTAL.SPACING VERTICAL.SPACING INDICATOR.SPACING)
          (CONVERT.GRIDDED.OFFSETSQ ITEM HORIZONTAL.BUTTON.SPACING VERTICAL.BUTTON.SPACING 
				    BUTTON.SPACING])
)
(READ.ITEMTYPE NUMBER.PAD 5)
(\TYPE ITEM.TYPE NAME NUMBER.PAD COMMENT  "A classic Xerox number pad, putting its value in a cell" 
KIND COMPOSITE PARAMETERS  ((\TYPE PARAMETER NAME PLACEMENT TYPE  (POSITION) DEFAULT  (170 . 170) 
COMMENT  "The lower left corner of the number pad" GRID.TYPE  (LOCATION))  (\TYPE PARAMETER NAME CELL 
TYPE  (CELL) DEFAULT CELL.1 COMMENT  "The cell affected by pushing the pad's buttons")  (\TYPE 
PARAMETER NAME INITIAL.VALUE TYPE  (INTEGER) DEFAULT 1 COMMENT  
"How to initialize the cell when entering the frame")  (\TYPE PARAMETER NAME PICTURE TYPE  (
BITMAP.NAME) DEFAULT SIMPLE.BUTTON.BITMAP COMMENT  "The graphic for the button")  (\TYPE PARAMETER 
NAME FONT TYPE  (FONT) DEFAULT  (GACHA 10) COMMENT  "The font for the button labels")  (\TYPE 
PARAMETER NAME BORDER.THICKNESS TYPE  (INTEGER) DEFAULT 2 COMMENT  
"The thickness in screen points of the border")  (\TYPE PARAMETER NAME BORDER.COLOR TYPE  (SHADE) 
DEFAULT 65535 COMMENT  "The color of the border")  (\TYPE PARAMETER NAME PRINT.FONT TYPE  (FONT) 
DEFAULT  (HELVETICA 10) COMMENT  "The font of the print region")  (\TYPE PARAMETER NAME PRINT.MARGIN 
TYPE  (INTEGER) DEFAULT 2 COMMENT  "The margin of the printing region")  (\TYPE PARAMETER NAME 
PRINT.BACKGROUND TYPE  (SHADE) DEFAULT 0 COMMENT  "The background of the printing region")  (\TYPE 
PARAMETER NAME PRINT.TEXTURE TYPE  (SHADE) DEFAULT 65535 COMMENT  
"The texture with which the print is combined")  (\TYPE PARAMETER NAME PRINT.SOURCE TYPE  (ONEOF  (
INPUT INVERT MERGE TEXTURE)) DEFAULT INPUT COMMENT  "How the texture is combined with the print")  (
\TYPE PARAMETER NAME PRINT.OPERATION TYPE  (ONEOF  (REPLACE PAINT INVERT ERASE)) DEFAULT REPLACE 
COMMENT  "How the print is combined with the background")) SUBITEM.SPECS  ((ITEM VALUE.BAR  (PLACEMENT
  (NEW.REGION  (NEW.POSITION  (IDIFFERENCE  (CAR PLACEMENT) BUTTON.BITMAP.EXTRA)  (IPLUS  (YCOORD  (
ITIMES 4  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE)))))  (CDR PLACEMENT)))  (IDIFFERENCE  (XCOORD  (
ITIMES 3  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE)))))  (IDIFFERENCE  (ITIMES  (ADD1  (XGRID  (
BITMAP.WIDTH PICTURE))) 17)  (BITMAP.WIDTH PICTURE)))  (IPLUS  (FONTPROP PRINT.FONT  (QUOTE SIZE)) 20)
))  (CELL CELL)  (XALIGNMENT  (QUOTE CENTER))  (YALIGNMENT  (QUOTE CENTER))  (FONT PRINT.FONT)  (
BORDER.THICKNESS BORDER.THICKNESS)  (BORDER.COLOR BORDER.COLOR)  (PRINT.MARGIN PRINT.MARGIN)  (
PRINT.BACKGROUND PRINT.BACKGROUND)  (PRINT.TEXTURE PRINT.TEXTURE)  (PRINT.SOURCE PRINT.SOURCE)  (
PRINT.OPERATION PRINT.OPERATION))  (ITEM INITIALIZATION  (PLACEMENT PLACEMENT)  (ACTION.FORM  (LIST  (
QUOTE SET.CELL) CELL  (KWOTE INITIAL.VALUE))))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 1)  (PLACEMENT 
 (TRANSLATE PLACEMENT 0  (ITIMES 3  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 1
)  (PICTURE PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 2)  (PLACEMENT  (TRANSLATE 
PLACEMENT  (ITIMES 1  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE))))  (ITIMES 3  (ADD1  (YGRID  (
BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 2)  (PICTURE PICTURE)  (FONT FONT))  (ITEM 
NUMBER.BUTTON.NEXT.DIGIT  (LABEL 3)  (PLACEMENT  (TRANSLATE PLACEMENT  (ITIMES 2  (ADD1  (XGRID  (
BITMAP.WIDTH PICTURE))))  (ITIMES 3  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 
3)  (PICTURE PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 4)  (PLACEMENT  (TRANSLATE
 PLACEMENT 0  (ITIMES 2  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 4)  (PICTURE
 PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 5)  (PLACEMENT  (TRANSLATE PLACEMENT  
(ITIMES 1  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE))))  (ITIMES 2  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE)
)))))  (CELL CELL)  (DIGIT 5)  (PICTURE PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL
 6)  (PLACEMENT  (TRANSLATE PLACEMENT  (ITIMES 2  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE))))  (ITIMES 2 
 (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 6)  (PICTURE PICTURE)  (FONT FONT)) 
 (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 7)  (PLACEMENT  (TRANSLATE PLACEMENT 0  (ITIMES 1  (ADD1  (
YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 7)  (PICTURE PICTURE)  (FONT FONT))  (ITEM 
NUMBER.BUTTON.NEXT.DIGIT  (LABEL 8)  (PLACEMENT  (TRANSLATE PLACEMENT  (ITIMES 1  (ADD1  (XGRID  (
BITMAP.WIDTH PICTURE))))  (ITIMES 1  (ADD1  (YGRID  (BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 
8)  (PICTURE PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 9)  (PLACEMENT  (TRANSLATE
 PLACEMENT  (ITIMES 2  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE))))  (ITIMES 1  (ADD1  (YGRID  (
BITMAP.HEIGHT PICTURE))))))  (CELL CELL)  (DIGIT 9)  (PICTURE PICTURE)  (FONT FONT))  (ITEM 
GENERAL.BUTTON  (TEXT  (QUOTE  ("")))  (PLACEMENT PLACEMENT)  (ACTION  (LIST  (QUOTE ACTION.DONOTHING)
))  (PICTURE PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON.NEXT.DIGIT  (LABEL 0)  (PLACEMENT  (TRANSLATE
 PLACEMENT  (ITIMES 1  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE)))) 0))  (CELL CELL)  (DIGIT 0)  (PICTURE 
PICTURE)  (FONT FONT))  (ITEM NUMBER.BUTTON  (LABEL  "C")  (PLACEMENT  (TRANSLATE PLACEMENT  (ITIMES 2
  (ADD1  (XGRID  (BITMAP.WIDTH PICTURE)))) 0))  (CELL CELL)  (DIGIT 0)  (PICTURE PICTURE)  (FONT FONT)
)) CLASSES  (BUTTON COMPOSITE))
(READ.ITEMTYPE TIMEOUT 5)
(\TYPE ITEM.TYPE NAME TIMEOUT COMMENT  "A sensor which takes action if CELL > BASE + DELAY" KIND 
COMPOSITE PARAMETERS  ((\TYPE PARAMETER NAME NAME TYPE  (CONSTANT) DEFAULT  "Un-named timeout" COMMENT
  "The item's name")  (\TYPE PARAMETER NAME PLACEMENT TYPE  (POSITION) DEFAULT  (170 . 170) COMMENT  
"A location for identification purposes" GRID.TYPE  (LOCATION))  (\TYPE PARAMETER NAME BASE TYPE  (
CELL) DEFAULT CELL.1 COMMENT  "A cell which is the reference time")  (\TYPE PARAMETER NAME DELAY TYPE 
 (INTEGER) DEFAULT 10000 COMMENT  "The time (in milliseconds) before the action should be taken")  (
\TYPE PARAMETER NAME INITIAL.STATE TYPE  (ONEOF  (ON OFF)) DEFAULT OFF COMMENT  
"The status of the timeout when the frame is initialized")  (\TYPE PARAMETER NAME ACTION.FORM TYPE  (
FORM) DEFAULT  (ACTION.PRINT  "This action is brought to you by a TIMEOUT") COMMENT  
"The action to be taken on timeout")) SUBITEM.SPECS  ((ITEM TIMEOUT.SENSOR  (PLACEMENT PLACEMENT)  (
BASE BASE)  (DELAY DELAY)  (ACTION.FORM ACTION.FORM))  (ITEM INITIALIZATION  (PLACEMENT PLACEMENT)  (
ACTION.FORM  (BQUOTE  (CHANGE.CELL , BASE ,  (COND  ((EQ INITIAL.STATE  (QUOTE OFF))  (KWOTE 
INITIAL.STATE))  (T  (LIST  (QUOTE CELL.VALUE)  (QUOTE CLOCK))))))))) CLASSES  (COMPOSITE))
(READ.ITEMTYPE TIMEOUT.SENSOR 5)
(\TYPE ITEM.TYPE NAME TIMEOUT.SENSOR COMMENT  "A sensor which takes action if CELL > BASE + DELAY" 
KIND SENSOR PARAMETERS  ((\TYPE PARAMETER NAME PLACEMENT TYPE  (POSITION) DEFAULT  (170 . 170) COMMENT
  "A location for identification purposes" GRID.TYPE  (LOCATION))  (\TYPE PARAMETER NAME BASE TYPE  (
CELL) DEFAULT CELL.1 COMMENT  
"A cell which is the reference time; if the value of the cell is 'OFF, then the timeout is disabled") 
 (\TYPE PARAMETER NAME DELAY TYPE  (INTEGER) DEFAULT 10000 COMMENT  
"The time (in milliseconds) before the action should be taken")  (\TYPE PARAMETER NAME ACTION.FORM 
TYPE  (FORM) DEFAULT  (ACTION.PRINT  "This action is brought to you by a TIMEOUT") COMMENT  
"The action to be taken on timeout")) OTHER  (FNS  ((BOUNDING.BOX BOUNDING.BOX.TIMEOUT.SENSOR)  (SENSE
 SENSE.TIMEOUT.SENSOR)  (NIL START.TIMEOUT)  (NIL DISABLE.TIMEOUT))) CLASSES  (SENSOR))
(DEFINEQ

(BOUNDING.BOX.TIMEOUT.SENSOR
  [LAMBDA (ITEM)                                             (* edited: "22-MAR-83 10:43")
    (PROG (LOCATION)
          (SETQ LOCATION (GET.FIELDQ ITEM PLACEMENT TIMEOUT.SENSOR))
          (RETURN (BOUNDING.BOX.FOR.SEGMENTS (fetch (LOCATION X) of LOCATION)
					     (fetch (LOCATION Y) of LOCATION)
					     1 1])

(SENSE.TIMEOUT.SENSOR
  [LAMBDA (ITEM TOUCH XCOORD YCOORD)                         (* edited: "28-Aug-84 16:53")
    (PROG ((BASE (GET.PARAMQ ITEM BASE TIMEOUT.SENSOR))
	   (DELAY (GET.PARAMQ ITEM DELAY TIMEOUT.SENSOR))
	   (ACTION (GET.PARAMQ ITEM ACTION.FORM TIMEOUT.SENSOR))
	   CURRENT.BASE)
          (COND
	    ((AND (NEQ (SETQ CURRENT.BASE (GET.CURRENT.VALUE BASE))
		       (QUOTE OFF))
		  (IGREATERP (CELL.VALUE CLOCK)
			     (IPLUS DELAY CURRENT.BASE)))
	      (BEGIN.EVENT ITEM)
	      (TRILLIUM.EVAL ACTION)
	      (END.EVENT)
	      (RETURN T])

(START.TIMEOUT
  [NLAMBDA (CELL.NAME DONT.TRACE)                            (* edited: "22-MAR-83 10:04")
    (CHANGE.CURRENT.VALUE CELL.NAME (CELL.VALUE CLOCK)
			  (EVAL DONT.TRACE])

(DISABLE.TIMEOUT
  [NLAMBDA (CELL.NAME DONT.TRACE)                            (* edited: "22-MAR-83 10:05")
    (CHANGE.CURRENT.VALUE CELL.NAME (QUOTE OFF)
			  (EVAL DONT.TRACE])
)
(COMPILE.INTERNAL.FNS.IF.NECESSARY)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML DISABLE.TIMEOUT START.TIMEOUT ACTON.CASCADE.BUTTON)

(ADDTOVAR LAMA )
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (3249 4507 (ACTON.CASCADE.BUTTON 3259 . 3604) (INCREMENT.CASCADE.BUTTON 3606 . 4505)) (
5305 6094 (SENSE.FLASHING.SENSITIVE.REGION 5315 . 6092)) (9582 10201 (
CONVERT.INVERTING.CASCADE.TWO.BUTTONS.OFFSETS 9592 . 10199)) (17677 19011 (BOUNDING.BOX.TIMEOUT.SENSOR
 17687 . 18057) (SENSE.TIMEOUT.SENSOR 18059 . 18626) (START.TIMEOUT 18628 . 18820) (DISABLE.TIMEOUT 
18822 . 19009)))))
STOP