(FILECREATED "21-Mar-87 18:11:41" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH218.;2 3496   

      changes to:  (VARS RHTPATCH218COMS)

      previous date: "21-Mar-87 18:10:34" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH218.;1)


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

(PRETTYCOMPRINT RHTPATCH218COMS)

(RPAQQ RHTPATCH218COMS ((* * Got rid of most, but not all, of scroll bar space when moving card's 
			     window back onto screen.)
			  (* * Change to NCUTILITIES)
			  (FNS NC.MoveWindowOntoScreen)))
(* * Got rid of most, but not all, of scroll bar space when moving card's window back onto 
screen.)

(* * Change to NCUTILITIES)

(DEFINEQ

(NC.MoveWindowOntoScreen
  (LAMBDA (Window)                                           (* rht: "21-Mar-87 18:08")
                                                             (* Make sure a window and all its attachments are on 
							     the screen.)

          (* * rht 8/28/85: Hacked to handle very big card windows that together with attached windows might be too big to 
	  fit on screen.)



          (* * kirk 12Feb86 Added room for scroll bars.)



          (* * rht 3/4/86: Changed to use RELMOVEW because otherwise it screws up when there's an attached window on the left
	  or bottom of the window.)



          (* * rht 3/19/87: Undid Kirk's change of 12Feb86. No longer leaves room for scroll bars.)


    (PROG (OldWindowRegion NewWindowRegion OldTop OldBottom NewLeft NewTop)
	    (if (AND (WINDOWP Window)
			 (NOT (SUBREGIONP WHOLEDISPLAY (SETQ OldWindowRegion (WINDOWREGION
						  Window)))))
		then (SETQ NewWindowRegion (COPY OldWindowRegion))
		       (SETQ OldTop (fetch (REGION TOP) of NewWindowRegion))
		       (if (GREATERP (fetch (REGION RIGHT) of NewWindowRegion)
					 (fetch (REGION RIGHT) of WHOLEDISPLAY))
			   then (SETQ NewLeft (replace (REGION LEFT) of NewWindowRegion
						     with (DIFFERENCE (fetch (REGION RIGHT)
									     of WHOLEDISPLAY)
									  (fetch (REGION WIDTH)
									     of NewWindowRegion)))))
		       (if (MINUSP (OR NewLeft (fetch (REGION LEFT) of NewWindowRegion)))
			   then (replace (REGION LEFT) of NewWindowRegion with 0))
		       (if (MINUSP (SETQ OldBottom (fetch (REGION BOTTOM) of 
										  NewWindowRegion)))
			   then (replace (REGION BOTTOM) of NewWindowRegion with 0)
				  (SETQ NewTop (PLUS OldTop (MINUS OldBottom))))
		       (if (GREATERP (OR NewTop (fetch (REGION TOP) of NewWindowRegion))
					 (fetch (REGION TOP) of WHOLEDISPLAY))
			   then (replace (REGION BOTTOM) of NewWindowRegion
				     with (DIFFERENCE (fetch (REGION TOP) of WHOLEDISPLAY)
							  (fetch (REGION HEIGHT) of 
										  NewWindowRegion))))
		       (RELMOVEW Window (create POSITION
						    XCOORD ←(DIFFERENCE (fetch (REGION LEFT)
									     of NewWindowRegion)
									  (fetch (REGION LEFT)
									     of OldWindowRegion))
						    YCOORD ←(DIFFERENCE (fetch (REGION BOTTOM)
									     of NewWindowRegion)
									  (fetch (REGION BOTTOM)
									     of OldWindowRegion)))))
      )))
)
(PUTPROPS RHTPATCH218 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (666 3414 (NC.MoveWindowOntoScreen 676 . 3412)))))
STOP