(FILECREATED "30-Jan-86 09:22:25" {QV}<NOTECARDS>1.3K>FGHPATCH016.;1 3825   

      changes to:  (VARS FGHPATCH016COMS)
		   (FNS NC.CopyButtonEventFn))


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

(PRETTYCOMPRINT FGHPATCH016COMS)

(RPAQQ FGHPATCH016COMS ((* * Fix to the stack overflow on liunk icon copy problem. Redefined from 
			     NCLINKS and NCINTERFACE.)
			  (FNS NC.LinkIconCopyFn NC.CopyButtonEventFn)))
(* * Fix to the stack overflow on liunk icon copy problem. Redefined from NCLINKS and 
NCINTERFACE.)

(DEFINEQ

(NC.LinkIconCopyFn
  (LAMBDA (ImageObject)                                      (* fgh: "29-Jan-86 15:58")

          (* * Return a copy of image object. IF it is a system link label, then make its label unspecified.)



          (* * rht 11/18/84: No longer worries about system link labels. All that is handled by WhenCopiedFn and WhenMovedFn.
	  Caches the new copy on the prop list of the original imageobj.)



          (* * rht 8/22/85: Added call to NC.CoerceToExternalPutLinkIcon to make the imageobj look like a external link icon.
	  If we're in a normal imageobj copy then the whencopiedfn will get called and replace the contents of 
	  ImageObjectCopy anyway. However, if only the CopyFn gets called, then this will stick.)



          (* * fgh 1/29/86 Removed the "copying ImageObj" clause in the create of ImageObjectCopy to fix bug where the 
	  copying was causing a stack overflow thru infinite recursive COPYALL calls. Copying clause was unnecessary.)


    (LET ((ImageObjectCopy (create IMAGEOBJ))
	  (Link (NC.FetchLinkFromLinkIcon ImageObject)))
         (NC.CoerceToExternalPutLinkIcon ImageObjectCopy (fetch (Link SourceCard) of Link)
					   (fetch (Link DestinationCard) of Link)
					   (fetch (Link Label) of Link))
         (IMAGEOBJPROP ImageObject (QUOTE ImageObjectCopy)
			 ImageObjectCopy)
     ImageObjectCopy)))

(NC.CopyButtonEventFn
  (LAMBDA (Window)                                           (* fgh: "30-Jan-86 09:21")

          (* * Return NoteCardsObject if button is in title bar, else call the old copy button event fn or just the button 
	  event fn.)



          (* * fgh 1/30/86 Added check to make sure that the OldCopyButtonEventFn is not this function before it is APPLYed.
	  Otherwise you get an infinite recursion.)


    (LET (CopyButtonEventFn TTYWindow)
         (if (NOT (INSIDEP (DSPCLIPPINGREGION NIL (WINDOWPROP Window (QUOTE DSP)))
				 (LASTMOUSEX Window)
				 (LASTMOUSEY Window)))
	     then (until (OR (MOUSESTATE UP)
				   (NEQ Window (WHICHW))
				   (INSIDEP (DSPCLIPPINGREGION NIL (WINDOWPROP Window
										     (QUOTE DSP)))
					      (LASTMOUSEX Window)
					      (LASTMOUSEY Window)))
		       do (BLOCK))
		    (if (MOUSESTATE UP)
			then (if (AND (WINDOWP (SETQ TTYWindow (PROCESSPROP (TTY.PROCESS
											  )
											(QUOTE
											  WINDOW))))
					    (WINDOWPROP TTYWindow (QUOTE SelectingCards)))
				   then (COPYINSERT (NC.MakeCardImageObject
							  (WINDOWPROP Window (QUOTE 
										   NoteCardObject)))))
			  )
	   elseif (AND (SETQ CopyButtonEventFn (WINDOWPROP Window (QUOTE 
									     OldCopyButtonEventFn)))
			   (NEQ CopyButtonEventFn (QUOTE NC.CopyButtonEventFn)))
	     then (APPLY* CopyButtonEventFn Window)
	   elseif (SETQ CopyButtonEventFn (WINDOWPROP Window (QUOTE BUTTONEVENTFN)))
	     then (APPLY* CopyButtonEventFn Window)))))
)
(PUTPROPS FGHPATCH016 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (558 3743 (NC.LinkIconCopyFn 568 . 2003) (NC.CopyButtonEventFn 2005 . 3741)))))
STOP