(FILECREATED "17-May-87 00:24:19" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH265.;1 4254   

      changes to:  (VARS RHTPATCH265COMS))


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

(PRETTYCOMPRINT RHTPATCH265COMS)

(RPAQQ RHTPATCH265COMS ((* * Fixes problem whereby NC.DetermineDisplayRegion wasn't taking attached 
			     windows into account when passed a Region.)
			  (* * Change to NCCARDS)
			  (FNS NC.DetermineDisplayRegion)))
(* * Fixes problem whereby NC.DetermineDisplayRegion wasn't taking attached windows into 
account when passed a Region.)

(* * Change to NCCARDS)

(DEFINEQ

(NC.DetermineDisplayRegion
  (LAMBDA (Card RegionOrPosition)                            (* rht: "17-May-87 00:09")

          (* * fgh 11/13/85 Updated to handle Card object.)



          (* * fgh 2/5/86 Changed names DefaultcardWidth to FeatchDefaultWidth ...)



          (* * rht 3/25/87: Changed so as to account for the NoteFile indicator window height if present.)



          (* * pmi 3/31/87: Changed prompt message for placing card to not say "... Card NIL" for a new card.)



          (* * rht 5/16/87: Now takes attached windows into account for cases when RegionOrPosition is a region.
	  But only when the card's window is already open.)


    (DECLARE (GLOBALVARS NC.BringUpCardAtOldPosFlg NC.ShowNoteFileOnCards))
    (LET ((Window (NC.FetchWindow Card))
	  CardWinRegion TotalWinRegion Region)
         (if (WINDOWP Window)
	     then (SETQ CardWinRegion (WINDOWPROP Window (QUOTE REGION)))
		    (SETQ TotalWinRegion (WINDOWREGION Window)))
         (COND
	   ((POSITIONP RegionOrPosition)
	     (if (SETQ Region (OR TotalWinRegion (NC.FetchRegion Card)))
		 then (CREATEREGION (fetch (POSITION XCOORD) of RegionOrPosition)
					(fetch (POSITION YCOORD) of RegionOrPosition)
					(fetch (REGION WIDTH) of Region)
					(fetch (REGION HEIGHT) of Region))
	       else (CREATEREGION (fetch XCOORD of RegionOrPosition)
				      (fetch YCOORD of RegionOrPosition)
				      (NC.FetchDefaultWidth Card)
				      (NC.FetchDefaultHeight Card))))
	   ((SETQ Region (OR (REGIONP RegionOrPosition)
				 (AND NC.BringUpCardAtOldPosFlg (NC.FetchRegion Card))))
	     (if Window
		 then (create REGION using Region HEIGHT ←(PLUS (fetch HEIGHT of 
										   TotalWinRegion)
									(DIFFERENCE (fetch HEIGHT
											 of Region)
										      (fetch HEIGHT
											 of 
										    CardWinRegion)))
						 WIDTH ←(PLUS (fetch WIDTH of TotalWinRegion)
								(DIFFERENCE (fetch WIDTH
										 of Region)
									      (fetch WIDTH
										 of CardWinRegion)))
				  )
	       else Region))
	   (Window TotalWinRegion)
	   (T (LET (Width Height TotalHeight CardTitle NewRegion)
	           (if (SETQ Region (NC.FetchRegion Card))
		       then (SETQ Width (fetch WIDTH of Region))
			      (SETQ Height (fetch HEIGHT of Region))
		     else (SETQ Width (NC.FetchDefaultWidth Card))
			    (SETQ Height (NC.FetchDefaultHeight Card)))
	           (SETQ TotalHeight (if NC.ShowNoteFileOnCards
					   then (PLUS Height (NC.NoteFileIndicatorWinHeight))
					 else Height))
	           (SETQ CardTitle (NC.FetchTitle Card))
	           (replace (REGION HEIGHT) of (SETQ NewRegion
						     (GETBOXREGION Width TotalHeight (GETMOUSEX)
								     (IDIFFERENCE (GETMOUSEY)
										    TotalHeight)
								     NIL
								     (if CardTitle
									 then (CONCAT
										  
							 "Please specify location for Note Card "
										  (NC.FetchTitle
										    Card))
								       else (CONCAT 
							       "Please specify location for new "
											(
										  NC.RetrieveType
											  Card)
											" Card"))))
		      with Height)
	       NewRegion))))))
)
(PUTPROPS RHTPATCH265 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (617 4172 (NC.DetermineDisplayRegion 627 . 4170)))))
STOP