(FILECREATED "24-Jul-87 19:47:08" {QV}<NOTECARDS>1.3KNEXT>RHTPATCH285.;1 5786   

      changes to:  (VARS RHTPATCH285COMS))


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

(PRETTYCOMPRINT RHTPATCH285COMS)

(RPAQQ RHTPATCH285COMS ((* * Fixes bug %#635: Can't select card from link icon in browser.)
			  (* * Change to NCINTERFACE)
			  (FNS NC.CopyButtonEventFn)
			  (* * Change to NCCARDS)
			  (FNS NC.MakeNoteCard)))
(* * Fixes bug %#635: Can't select card from link icon in browser.)

(* * Change to NCINTERFACE)

(DEFINEQ

(NC.CopyButtonEventFn
  (LAMBDA (Window)                                           (* rht: "24-Jul-87 19:40")

          (* * 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)))))
)
(* * Change to NCCARDS)

(DEFINEQ

(NC.MakeNoteCard
  (LAMBDA (NoteCardType NoteFile Title NoDisplayFlg TypeSpecificArgs Card)
                                                             (* rht: "24-Jul-87 19:40")
                                                             (* Make a new note card of type NoteCardType.
							     If type note specified, ask the user.)

          (* * rht 2/1/85: Added call to NC.MarkCardDirty.)



          (* * fgh 10/15/85 Added extra DatabaseStream argument for use by caching mechanism)



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



          (* * fgh 2/5/86 Added call to NC.ApplyFn)



          (* * kirk 15May86 Added call to NC.AttachNoteFileName)



          (* * rht 7/4/86: Now checks for read-only notefile before proceeding.)



          (* * kef 8/4/86: Updated to pass NoteCardType argument on to NC.GetNewCard.)



          (* * rht 7/24/87: Replaced WINDOWPROP thing with call to NC.InstallCopyButtonEventFn.)


    (if (NC.ReadOnlyNoteFileP NoteFile)
	then NIL
      else (LET (ReturnValue Window)
	          (COND
		    ((SETQ NoteCardType (OR NoteCardType (NC.AskNoteCardType
						  (fetch (NoteFile Menu) of NoteFile))))
		      (SETQ Card (OR (PROGN (type? Card Card)
						  Card)
					 (NC.GetNewCard NoteFile NoteCardType)))
		      (NC.SetNewCardFlg Card T)
		      (NC.ActivateCard Card)
		      (NC.SetType Card NoteCardType)
		      (COND
			((OR (NULL (ERSETQ (SETQ ReturnValue (NC.ApplyFn MakeFn Card Title 
										 NoDisplayFlg 
										 TypeSpecificArgs))))
			       (NULL ReturnValue))
			  (NC.SetStatus Card (QUOTE DELETED))
			  (NC.DeactivateCard Card T))
			(T (SETQ Window (WINDOWP ReturnValue))
			   (COND
			     ((NULL (NC.RetrieveTitle Card))
			       (SETQ Title (NC.SetTitle Card (SETQ Title
							      (COND
								((STRINGP Title)
								  Title)
								((AND Title (OR (LITATOM Title)
										    (NUMBERP Title))
									)
								  (MKSTRING Title))
								(T "Untitled")))))
			       (AND Window (WINDOWPROP Window (QUOTE TITLE)
							   Title)))
			     (T (NC.SetTitle Card (MKSTRING (NC.RetrieveTitle Card)))))
			   (COND
			     (Window (WINDOWADDPROP Window (QUOTE CLOSEFN)
						      (FUNCTION NC.QuitCard)
						      (QUOTE FIRST))
				     (WINDOWPROP Window (QUOTE NoteCardObject)
						   Card)
				     (NC.InstallCopyButtonEventFn Window)))
			   (NC.SetTitleDirtyFlg Card T)    (* Reset the type in case of recursive calls change 
							     the type. Always want the highest level type in a 
							     recursive descent)
			   (NC.SetType Card NoteCardType)
                                                             (* Insure that a link ptr is set up during the first 
							     save)
			   (NC.SetLinksDirtyFlg Card T)
			   (NC.SetPropListDirtyFlg Card T)
                                                             (* Mark that substance is dirty.)
			   (NC.MarkCardDirty Card T)
			   (if NC.ShowNoteFileOnCards
			       then (NC.AttachNoteFileName Window))))
		      ReturnValue))))))
)
(PUTPROPS RHTPATCH285 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (561 2309 (NC.CopyButtonEventFn 571 . 2307)) (2340 5704 (NC.MakeNoteCard 2350 . 5702))))
)
STOP