(FILECREATED "15-Jul-86 18:13:55" {QV}<NOTECARDS>1.3K>RHTPATCH074.;2 5122   

      changes to:  (VARS RHTPATCH074COMS)
		   (FNS NC.GRAPHERCOPYBUTTONEVENTFN NC.IsSubTypeOfP)

      previous date: "15-Jul-86 17:56:55" {QV}<NOTECARDS>1.3K>RHTPATCH074.;1)


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

(PRETTYCOMPRINT RHTPATCH074COMS)

(RPAQQ RHTPATCH074COMS ((* * New function for NCCONVERTVERSION2TO3)
			  (* * Add this function to NCCONVERTVERSION2TO3 next to NC.ReadLink. Like 
			     NC.ReadLink, it's being redefined in the converter.)
			  (FNS NC.LinkIconPutFn)
			  (* * Change to NCGRAPHCARD)
			  (FNS NC.GRAPHERCOPYBUTTONEVENTFN)
			  (* * Change to NCTYPESMECH)
			  (FNS NC.IsSubTypeOfP)))
(* * New function for NCCONVERTVERSION2TO3)

(* * Add this function to NCCONVERTVERSION2TO3 next to NC.ReadLink. Like NC.ReadLink, it's 
being redefined in the converter.)

(DEFINEQ

(NC.LinkIconPutFn
  (LAMBDA (ImageObject Stream)                               (* rht: "15-Jul-86 14:52")

          (* * Writes the Link information in the link icon specified by ImageObject onto the file specified by Stream)



          (* * fgh 11/16/85 Updated to handle Link DATATYPE)



          (* * rht 7/15/86: Now checks for old style links. If so, then put down a placeholder imageobj.)


    (LET ((Link (NC.FetchLinkFromLinkIcon ImageObject)))
         (if (type? Link Link)
	     then (NC.WriteLink Link Stream)
	   else (IMAGEOBJPROP ImageObject (QUOTE OBJECTDATUM)
				  "[[Old style link.]]")
		  (replace (IMAGEOBJ IMAGEOBJFNS) of ImageObject with 
								   NC.ExternalPutLinkIconImageFns)
		  (NC.ExternalPutLinkIconPutFn ImageObject Stream)))))
)
(* * Change to NCGRAPHCARD)

(DEFINEQ

(NC.GRAPHERCOPYBUTTONEVENTFN
  (LAMBDA (Window)                                           (* rht: "15-Jul-86 18:12")

          (* * Handle a COPYBUTTONEVENT in a NC Grapher window. If the button is down over a node and the TTY PROCESS is a 
	  selecting cards process, process it as such, otherwise do the standard grapher copy button event fn of 
	  copyinserting he whole graph.)



          (* * fgh 6/30/86 First created.)



          (* * rht 7/15/86: Now calls NC.MakeExternalGraphCopy to smash NC links.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH)))
	  InNode PositionAndLastState TTYWindow (Position (CONS 0 0)))
         (if (NOT (AND (WINDOWP (SETQ TTYWindow (PROCESSPROP (TTY.PROCESS)
									 (QUOTE WINDOW))))
			     (WINDOWPROP TTYWindow (QUOTE SelectingCards))))
	     then 

          (* * The current TTY PROCESS is not a selecting cards process -- insert a copy of the graph with the nc links 
	  smashed.)


		    (COPYINSERT (GRAPHEROBJ (NC.MakeExternalGraphCopy Graph)))
	   else 

          (* * We want to handle this special for NoteCards to allow shift-select of link icons in the graph)



          (* * First track the cursor until its let up)


		  (SETQ PositionAndLastState (NC.TrackCursorInGrapherWindow Window Graph)) 

          (* * Cursor up -- determine what to do)


		  (if (NULL (CAR PositionAndLastState))
		      then 

          (* * Let up outside the window -- get out of here)


			     NIL
		    else 

          (* * Find the node the mouse was when the buttons were let up -- if any)


			   (SETQ InNode (for GraphNode in (fetch (GRAPH GRAPHNODES)
								   of Graph)
					     thereis (NC.InsideGrapherNodeP
							 (PROGN (replace (POSITION XCOORD)
								     of Position
								     with (LASTMOUSEX Window))
								  (replace (POSITION YCOORD)
								     of Position
								     with (LASTMOUSEY Window))
								  Position)
							 GraphNode)))
			   (if (OR (NULL InNode)
				       (NULL (NC.LinkIconImageObjP (fetch (GRAPHNODE NODELABEL)
									  of InNode))))
			       then 

          (* * Let up innside the window, but not in a node. Or the Node is not a LinkIcon node. Do the standard COPYINSERTFN
	  for GRAPHER)


				      (COPYINSERT (GRAPHEROBJ (NC.MakeExternalGraphCopy Graph)))
			     else 

          (* * Let up inside a node, must want to select it.)


				    (COPYINSERT (fetch (GRAPHNODE NODELABEL) of InNode))))))))
)
(* * Change to NCTYPESMECH)

(DEFINEQ

(NC.IsSubTypeOfP
  (LAMBDA (SubTypeName SupposedSuperTypeName)                (* rht: "15-Jul-86 18:06")

          (* * Is SubTypeName the name of a Card type that is a sub type of carrd type SupposedSuperTypeName.)


    (LET (SuperType)
         (OR (EQ SubTypeName SupposedSuperTypeName)
	       (AND (SETQ SuperType (NC.GetCardTypeField SuperType SubTypeName))
		      (NC.IsSubTypeOfP SuperType SupposedSuperTypeName))))))
)
(PUTPROPS RHTPATCH074 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (920 1768 (NC.LinkIconPutFn 930 . 1766)) (1803 4533 (NC.GRAPHERCOPYBUTTONEVENTFN 1813 . 
4531)) (4568 5040 (NC.IsSubTypeOfP 4578 . 5038)))))
STOP