(FILECREATED "25-Mar-87 15:12:24" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH223.;2 7655   

      changes to:  (FNS NC.NoteFileIndicatorWinHeight NC.DetermineDisplayRegion NC.AttachNoteFileName)
		   (VARS RHTPATCH223COMS)

      previous date: "25-Mar-87 15:10:37" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH223.;1)


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

(PRETTYCOMPRINT RHTPATCH223COMS)

(RPAQQ RHTPATCH223COMS ((* * Fixes bug #486: windowregion selection for new cards is too small when 
			     notefile indicators is turned on.)
			  (* * New function for NCINTERFACE)
			  (FNS NC.NoteFileIndicatorWinHeight)
			  (* * Changes to NCINTERFACE)
			  (FNS NC.AttachNoteFileName)
			  (* * Change to NCCARDS)
			  (FNS NC.DetermineDisplayRegion)))
(* * Fixes bug #486: windowregion selection for new cards is too small when notefile 
indicators is turned on.)

(* * New function for NCINTERFACE)

(DEFINEQ

(NC.NoteFileIndicatorWinHeight
  (LAMBDA NIL                                                (* rht: "25-Mar-87 15:11")

          (* * Return the height required by the NoteFile indicator attached window.)


    (DECLARE (GLOBALVARS NC.NoteFileIndicatorFont))
    (HEIGHTIFWINDOW (OR (FONTPROP NC.NoteFileIndicatorFont (QUOTE HEIGHT))
			    20))))
)
(* * Changes to NCINTERFACE)

(DEFINEQ

(NC.AttachNoteFileName
  (LAMBDA (CardWindow OffFlg)                                (* rht: "25-Mar-87 14:46")

          (* * Attach an indicator of the NoteFile for this Card to the Card)



          (* * fgh 5/29/86 Changed collection of old attached windows to prevent NILs in collection result.)



          (* * fgh 6/13/86 Put detachment and reattachment of previous attached windows into a RESETLST.
	  Added FREEATTACHEDWINDOW as the CLOSEFN of the indicator window. Added code to reset PASSTOMAINWINDOW COMS of the 
	  previously attachwed windows. Changed MINSIZE of indicator window to allow small fonts. Added a REPAINTFN to the 
	  indicator window.)



          (* * fgh 7/2/86 Replaced the CLEARW call in the indicator window REPAINTFN with a DSPRESET for two reasons: reset 
	  the X coor befre printining and CLEARW is not allowed in REPAINTFNS.)



          (* * fgh&rht 7/5/86: Changed the name "FileName" to "NameToPrint".)



          (* * rht 3/20/87: Moved Frank's hack that temporarily detaches windows into a macro called 
	  NC.WithWindowsUnattached.)



          (* * rht 3/25/87: Now calls NC.NoteFileIndicatorWinHeight.)


    (LET ((Card (NC.CardFromWindow CardWindow))
	  AttachedWindows FileName Window)
         (if (NC.CardP Card)
	     then (SETQ AttachedWindows (ATTACHEDWINDOWS CardWindow))
		    (if OffFlg
			then (CLOSEW (for window in AttachedWindows
					    thereis (WINDOWPROP window (QUOTE NoteFileIndicator)
								    )))
			       (REPOSITIONATTACHEDWINDOWS CardWindow)
		      else (TOTOPW CardWindow)
			     (if (SETQ Window (for window in AttachedWindows
						     thereis (WINDOWPROP window (QUOTE 
										NoteFileIndicator))))
				 then 

          (* * There already is an indicator window, open and redisplay it.)


					(OR (OPENWP Window)
					      (OPENW Window))
					(REDISPLAYW Window)
			       else 

          (* * No existing indicator window, make one.)


				      (NC.WithTopWindowsUnattached
					CardWindow

          (* * Make the indicator window.)


					(LET (NoteFile NameToPrint YSize IndicatorWindow)
					     (SETQ NoteFile (fetch (Card NoteFile) of Card))
					     (SETQ NameToPrint (NC.MakeNoteFileNameIndicator
						 NoteFile))
					     (SETQ YSize (NC.NoteFileIndicatorWinHeight))
					     (SETQ IndicatorWindow
					       (CREATEW (CREATEREGION 0 0 100 YSize)
							  NIL T))
					     (WINDOWPROP IndicatorWindow (QUOTE MAXSIZE)
							   (CONS 1000 YSize))
					     (WINDOWPROP IndicatorWindow (QUOTE MINSIZE)
							   (CONS 20 YSize))
					     (ATTACHWINDOW IndicatorWindow CardWindow (QUOTE
							       TOP)
							     (QUOTE JUSTIFY)
							     (QUOTE LOCALCLOSE))
					     (WINDOWPROP IndicatorWindow (QUOTE BUTTONEVENTFN)
							   (FUNCTION (LAMBDA (window)
							       (INVERTW window)
							       (NC.SetUpNoteFileInterface
								 (fetch (Card NoteFile)
								    of (NC.CardFromWindow
									   (MAINWINDOW window))))
							       (INVERTW window))))
					     (WINDOWPROP IndicatorWindow (QUOTE NameToPrint)
							   NameToPrint)
					     (WINDOWADDPROP IndicatorWindow (QUOTE CLOSEFN)
							      (FUNCTION FREEATTACHEDWINDOW)
							      T)
					     (WINDOWPROP IndicatorWindow (QUOTE REPAINTFN)
							   (FUNCTION (LAMBDA (Window Region)
							       (DSPRESET Window)
							       (PRIN1 (WINDOWPROP Window
										      (QUOTE 
										      NameToPrint))
									Window))))
					     (DSPFONT NC.NoteFileIndicatorFont IndicatorWindow)
					     (PRIN1 NameToPrint IndicatorWindow)
					     (OPENW IndicatorWindow)
					     (WINDOWPROP IndicatorWindow (QUOTE NoteFileIndicator)
							   (QUOTE Showing))))))))))
)
(* * Change to NCCARDS)

(DEFINEQ

(NC.DetermineDisplayRegion
  (LAMBDA (Card Region/Position)                             (* rht: "25-Mar-87 15:11")

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


    (DECLARE (GLOBALVARS NC.BringUpCardAtOldPosFlg NC.ShowNoteFileOnCards))
    (LET (Region)
         (COND
	   ((type? REGION Region/Position)
	     Region/Position)
	   ((POSITIONP Region/Position)
	     (if (SETQ Region (NC.FetchRegion Card))
		 then (CREATEREGION (fetch (POSITION XCOORD) of Region/Position)
					(fetch (POSITION YCOORD) of Region/Position)
					(fetch (REGION WIDTH) of Region)
					(fetch (REGION HEIGHT) of Region))
	       else (CREATEREGION (fetch XCOORD of Region/Position)
				      (fetch YCOORD of Region/Position)
				      (NC.FetchDefaultWidth Card)
				      (NC.FetchDefaultHeight Card))))
	   ((AND NC.BringUpCardAtOldPosFlg (NC.FetchRegion Card)))
	   (T (LET (Width Height TotalHeight 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))
	           (replace (REGION HEIGHT) of (SETQ NewRegion (GETBOXREGION
						       Width TotalHeight (GETMOUSEX)
						       (IDIFFERENCE (GETMOUSEY)
								      TotalHeight)
						       NIL
						       (CONCAT 
							 "Please specify location for Note Card "
								 (NC.FetchTitle Card))))
		      with Height)
	       NewRegion))))))
)
(PUTPROPS RHTPATCH223 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (930 1326 (NC.NoteFileIndicatorWinHeight 940 . 1324)) (1362 5421 (NC.AttachNoteFileName 
1372 . 5419)) (5452 7573 (NC.DetermineDisplayRegion 5462 . 7571)))))
STOP