(FILECREATED "13-Nov-84 18:42:17" {PHYLUM}<PSA>NOTECARDS>RELEASE1.1>NCGESTURES.;3 3783   

      changes to:  (VARS NCGESTURESCOMS))


(* Copyright (c) 1984 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT NCGESTURESCOMS)

(RPAQQ NCGESTURESCOMS ((GLOBALVARS LASTMOUSEBUTTONS)
		       (FNS NC.GrabWindow)
		       (P (SETQ BACKGROUNDBUTTONEVENTFN (FUNCTION NC.GrabWindow)))))
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS LASTMOUSEBUTTONS)
)
(DEFINEQ

(NC.GrabWindow
  (LAMBDA NIL                                                (* NoteCards% User "12-Jun-84 15:36")
    (PROG ((InOutList NIL)
	   Window WindowRegionLeft WindowRegionBottom WindowRegionWidth WindowRegionHeight INX INY 
	   OUTX OUTY)
          (AND (NEQ LASTMOUSEBUTTONS 7)
	       (until (MOUSESTATE UP)
		  do (RESETLST (RESETSAVE (CURSOR BOXCURSOR))
			       (until (OR (MOUSESTATE UP)
					  (NEQ Window (WHICHW)))
				  do (BLOCK))
			       (SETQ InOutList (CONS (LIST Window LASTMOUSEX LASTMOUSEY)
						     InOutList))
			       (SETQ WindowRegionLeft (fetch (REGION LEFT)
							 of (WINDOWPROP Window (QUOTE REGION))))
			       (SETQ WindowRegionBottom (fetch (REGION BOTTOM)
							   of (WINDOWPROP Window (QUOTE REGION))))
			       (SETQ WindowRegionWidth (fetch (REGION WIDTH)
							  of (WINDOWPROP Window (QUOTE REGION))))
			       (SETQ WindowRegionHeight (fetch (REGION HEIGHT)
							   of (WINDOWPROP Window (QUOTE REGION))))
			       (SETQ OUTX (CADAR InOutList))
			       (SETQ OUTY (CADDAR InOutList))
			       (SETQ INX (CADR (CADR InOutList)))
			       (SETQ INY (CADDR (CADR InOutList)))
			       (COND
				 ((AND Window (NOT (LASTMOUSESTATE UP))
				       (AND (OR (AND (ILESSP INX (IPLUS WindowRegionLeft
									(FTIMES .25 WindowRegionWidth)
									))
						     (ILESSP OUTX (IPLUS WindowRegionLeft
									 (FTIMES .25 
										WindowRegionWidth))))
						(AND (IGREATERP INX (IPLUS WindowRegionLeft
									   (FTIMES .75 
										WindowRegionWidth)))
						     (IGREATERP OUTX (IPLUS WindowRegionLeft
									    (FTIMES .75 
										WindowRegionWidth)))))
					    (OR (AND (ILESSP INY (IPLUS WindowRegionBottom
									(FTIMES .25 
									       WindowRegionHeight)))
						     (ILESSP OUTY (IPLUS WindowRegionBottom
									 (FTIMES .25 
									       WindowRegionHeight))))
						(AND (IGREATERP INY (IPLUS WindowRegionBottom
									   (FTIMES .75 
									       WindowRegionHeight)))
						     (IGREATERP OUTY (IPLUS WindowRegionBottom
									    (FTIMES .75 
									       WindowRegionHeight)))))
					    ))
				   (MOVEW Window))
				 ((AND Window (NOT (LASTMOUSESTATE UP))
				       (for N from 3 to 3 by 2
					  always (AND (EQ Window (CAAR (NTH InOutList N)))
						      (NOT (INSIDEP (CREATEREGION (IPLUS 
										 WindowRegionLeft 20)
										  (IPLUS 
									       WindowRegionBottom 20)
										  (IDIFFERENCE 
										WindowRegionWidth 40)
										  (IDIFFERENCE 
									       WindowRegionHeight 40))
								    (CADAR (NTH InOutList
										(SUB1 N)))
								    (CADDAR (NTH InOutList
										 (SUB1 N))))))))
				   (CLOSEW Window)
				   (BLOCK)))
			       (SETQ Window (WHICHW))))))))
)
(SETQ BACKGROUNDBUTTONEVENTFN (FUNCTION NC.GrabWindow))
(PUTPROPS NCGESTURES COPYRIGHT ("Xerox Corporation" 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (465 3646 (NC.GrabWindow 475 . 3644)))))
STOP