(FILECREATED "29-May-86 13:09:32" {QV}<NOTECARDS>1.3K>FGHPATCH047.;1 3680   

      changes to:  (VARS FGHPATCH047COMS)
		   (FNS NC.AttachNoteFileName))


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

(PRETTYCOMPRINT FGHPATCH047COMS)

(RPAQQ FGHPATCH047COMS ((FNS NC.AttachNoteFileName)))
(DEFINEQ

(NC.AttachNoteFileName
  (LAMBDA (CardWindow OffFlg)                                (* fgh: "29-May-86 13:03")

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


    (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 (OR (OPENWP Window)
					      (OPENW Window))
			       else (SETQ AttachedWindows
					(bind Description for window in AttachedWindows
					   when (PROGN (SETQ WhereAttached (WINDOWPROP
							       window
							       (QUOTE WHEREATTACHED)))
							   (if (EQ (QUOTE TOP)
								       (CAR WhereAttached))
							       then (DETACHWINDOW window)
								      (SETQ Description
									(CONS window (CDR 
										    WhereAttached)))))
					   collect Description))
				      (LET (NoteFile FileName YSize IndicatorWindow)
				           (SETQ NoteFile (fetch (Card NoteFile) of Card))
				           (SETQ FileName (NC.MakeNoteFileNameIndicator NoteFile))
				           (SETQ YSize (IMAX 20 (FONTPROP 
									 NC.NoteFileIndicatorFont
										(QUOTE HEIGHT))))
                                                             (* Due to bug in ATTACHWINDOW region height must be 
							     20)
				           (SETQ IndicatorWindow (CREATEW (CREATEREGION 0 0 100 
											    YSize)
									      NIL T))
				           (ATTACHWINDOW IndicatorWindow CardWindow (QUOTE TOP)
							   (QUOTE JUSTIFY)
							   (QUOTE LOCALCLOSE))
				           (WINDOWPROP IndicatorWindow (QUOTE MAXSIZE)
							 (CONS 1000 YSize))
				           (WINDOWPROP IndicatorWindow (QUOTE MINSIZE)
							 (CONS 20 YSize))
				           (WINDOWPROP IndicatorWindow (QUOTE BUTTONEVENTFN)
							 (FUNCTION (LAMBDA (window)
							     (INVERTW window)
							     (NC.SetUpNoteFileInterface
							       (fetch (Card NoteFile)
								  of (NC.CardFromWindow
									 (MAINWINDOW window))))
							     (INVERTW window))))
				           (DSPFONT NC.NoteFileIndicatorFont IndicatorWindow)
				           (PRIN1 FileName IndicatorWindow)
				           (OPENW IndicatorWindow)
				           (WINDOWPROP IndicatorWindow (QUOTE NoteFileIndicator)
							 (QUOTE Showing)))
				      (for window in AttachedWindows do (ATTACHWINDOW
										(CAR window)
										CardWindow
										(QUOTE TOP)
										(CDR window)))))))))
)
(PUTPROPS FGHPATCH047 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (321 3598 (NC.AttachNoteFileName 331 . 3596)))))
STOP