(FILECREATED "16-Sep-87 17:27:25" {QV}<NOTECARDS>1.3KNEXT>RGPATCH060.;2 4499   

      changes to:  (FNS NC.DetermineDisplayRegion)
		   (VARS RGPATCH060COMS)

      previous date: "16-Sep-87 17:10:13" {QV}<NOTECARDS>1.3KNEXT>RGPATCH060.;1)


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

(PRETTYCOMPRINT RGPATCH060COMS)

(RPAQQ RGPATCH060COMS ((* * rg 9/16/87 now brings up card at old pos if BringUpCardAtOldPos prop is 
			    T)
			 (* * changes to NCCARDS)
			 (FNS NC.DetermineDisplayRegion)))
(* * rg 9/16/87 now brings up card at old pos if BringUpCardAtOldPos prop is T)

(* * changes to NCCARDS)

(DEFINEQ

(NC.DetermineDisplayRegion
  [LAMBDA (Card RegionOrPosition)                            (* Randy.Gobbel "16-Sep-87 17:25")

          (* * 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.)



          (* * rg 9/16/87 now brings up card at old pos if BringUpCardAtOldPos prop is T)


    (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 (OR NC.BringUpCardAtOldPosFlg (NC.GetProp Card
										      (QUOTE 
									      BringUpCardAtOldPos)))
					(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 RGPATCH060 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (648 4418 (NC.DetermineDisplayRegion 658 . 4416)))))
STOP