(FILECREATED "30-Jun-86 23:51:55" {QV}<NOTECARDS>1.3K>FGHPATCH084.;2 5994   

      changes to:  (FNS NC.SK.COPY.BUTTONEVENTFN NC.MakeSketchCard NC.BringUpSketchCard)
		   (VARS FGHPATCH084COMS)

      previous date: "30-Jun-86 23:31:16" {QV}<NOTECARDS>1.3K>FGHPATCH084.;1)


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

(PRETTYCOMPRINT FGHPATCH084COMS)

(RPAQQ FGHPATCH084COMS ((* * Fix to allow shift-selecting from Sketches)
			  (* * Old fns from NCSKETCHCARD)
			  (FNS NC.MakeSketchCard NC.BringUpSketchCard)
			  (* * New fns for NCSKETCHCARD)
			  (FNS NC.SK.COPY.BUTTONEVENTFN)))
(* * Fix to allow shift-selecting from Sketches)

(* * Old fns from NCSKETCHCARD)

(DEFINEQ

(NC.MakeSketchCard
  (LAMBDA (Card Title NoDisplayFlg)                          (* fgh: "30-Jun-86 23:13")

          (* * rht 2/1/85: Added windowprop to prevent sketch asking about saving changes.)



          (* * fgh 11/14/85 Updated to handle Card object.)



          (* * rht 5/6/86 Replaced call to NC.SetupTitleBarMenu with calls to NC.InstallTitleBarButtonEventFn and 
	  NC.InstallTitleBarLeftMenu and NC.InstallSketchTitleBarMiddleMenu.)



          (* * fgh 6/30/86 Added NC.SK.COPY.BUTTONEVENTFN on Sketch Window. Added SKETCH.ADD.ELEMENT call when NoDisplayFlg)


    (if NoDisplayFlg
	then (NC.SetSubstance Card (SKETCH.ADD.ELEMENT NIL NIL))
	       Card
      else (LET (Window CardType)
	          (SETQ CardType (NC.RetrieveType Card))
	          (SETQ Window (SKETCHW.CREATE NIL NIL (NC.DetermineDisplayRegion Card NIL)
						   (OR Title "Untitled")
						   NIL
						   (SKETCH.COMMANDMENU (NC.GetCardTypeField 
									    MiddleButtonMenuItems 
											 CardType))))
	          (WINDOWPROP Window (QUOTE DONTQUERYCHANGES)
				T)
	          (WINDOWPROP Window (QUOTE COPYBUTTONEVENTFN)
				(FUNCTION NC.SK.COPY.BUTTONEVENTFN))
	          (WINDOWPROP Window (QUOTE SHRINKFN)
				(FUNCTION NC.SketchCardShrinkFn))
	          (NC.InstallTitleBarButtonEventFn Window (FUNCTION 
						       NC.SketchTitleBarButtonEventFn))
	          (NC.InstallTitleBarLeftMenu Window CardType)
	          (NC.SetSubstance Card (INSURE.SKETCH Window))
	      Window))))

(NC.BringUpSketchCard
  (LAMBDA (Card Substance Region/Position)                   (* fgh: "30-Jun-86 23:16")
                                                             (* Bring up a sketch card containing substance in 
							     specified region)

          (* * rht 2/1/85: Added windowprop to prevent sketch asking about saving changes.)



          (* * rht 10/10/85: Now sets substance if was nil.)



          (* * fgh 11/14/85 Updated to handle Card object.)



          (* * rht 5/5/86: Replaced call to NC.SetupTitleBarMenu with calls to NC.InstallTitleBarButtonEventFn and 
	  NC.InstallTitleBarLeftMenu and NC.InstallSketchTitleBarMiddleMenu.)



          (* * fgh 6/30/86 Added NC.SK.COPY.BUTTONEVENTFN to sketch window. Made Substance to be INSURE.SKETCH of the sketch 
	  window.)


    (LET ((SketchName (AND (NULL Substance)
			     (MKATOM (fetch (Card UID) of Card))))
	  Region Title SketchViewer CardType)
         (COND
	   ((SETQ SketchViewer (NC.FetchWindow Card))
	     (RPTQ 2 (FLASHW SketchViewer))
	     (TOTOPW SketchViewer)
	     (TTY.PROCESS (WINDOWPROP SketchViewer (QUOTE PROCESS))))
	   (T (SETQ CardType (NC.RetrieveType Card))
	      (SETQ SketchViewer (SKETCHW.CREATE (OR Substance SketchName)
						     (NC.FetchRegionViewed Card)
						     (NC.DetermineDisplayRegion Card 
										  Region/Position)
						     (NC.RetrieveTitle Card)
						     (NC.FetchScale Card)
						     (SKETCH.COMMANDMENU (NC.GetCardTypeField
									     MiddleButtonMenuItems 
									     CardType))))
	      (WINDOWPROP SketchViewer (QUOTE DONTQUERYCHANGES)
			    T)
	      (WINDOWPROP SketchViewer (QUOTE COPYBUTTONEVENTFN)
			    (FUNCTION NC.SK.COPY.BUTTONEVENTFN))
	      (WINDOWPROP SketchViewer (QUOTE SHRINKFN)
			    (FUNCTION NC.SketchCardShrinkFn))
	      (NC.InstallTitleBarButtonEventFn SketchViewer (FUNCTION 
						   NC.SketchTitleBarButtonEventFn))
	      (NC.InstallTitleBarLeftMenu SketchViewer CardType)
	      (OR Substance (NC.SetSubstance Card (INSURE.SKETCH SketchViewer)))))
     SketchViewer)))
)
(* * New fns for NCSKETCHCARD)

(DEFINEQ

(NC.SK.COPY.BUTTONEVENTFN
  (LAMBDA (Window)                                           (* fgh: "30-Jun-86 23:50")

          (* * Check to see if the TTY PROCESS is a Select NoteCards, if so then ask get user to choose a link icon and pass 
	  it back. Otherwise, just call the normal sketch copybuttoneventfn.)


    (if (AND (WINDOWP (PROCESSPROP (TTY.PROCESS)
					   (QUOTE WINDOW)))
		 (WINDOWPROP (PROCESSPROP (TTY.PROCESS)
					      (QUOTE WINDOW))
			       (QUOTE SelectingCards)))
	then 

          (* * Okay, TTY is a select NC process.)


	       (LET ((ChosenElement (SKETCH.GET.ELEMENTS
				      Window T (SKETCH.LIST.OF.ELEMENTS
					(INSURE.SKETCH Window)
					(FUNCTION (LAMBDA (Element)
					    (AND (EQ (GETSKETCHELEMENTPROP Element
										 (QUOTE TYPE))
							 (QUOTE SKIMAGEOBJ))
						   (NC.LinkIconImageObjP (GETSKETCHELEMENTPROP
									     Element
									     (QUOTE DATA))))))))))
		    (if ChosenElement
			then (COPYINSERT (GETSKETCHELEMENTPROP ChosenElement (QUOTE DATA)))))
      else 

          (* * TTY is not select NC, do what sketch does.)


	     (SK.COPY.BUTTONEVENTFN Window))))
)
(PUTPROPS FGHPATCH084 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (714 4585 (NC.MakeSketchCard 724 . 2333) (NC.BringUpSketchCard 2335 . 4583)) (4623 5912 
(NC.SK.COPY.BUTTONEVENTFN 4633 . 5910)))))
STOP