(FILECREATED "14-Nov-86 14:55:58" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH149.;5 4286   

      changes to:  (FNS NC.CrossFileLinkEditFn NC.ChangeCardTitleFromLinkIcon)
		   (VARS RHTPATCH149COMS)

      previous date: "13-Nov-86 18:21:42" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH149.;1)


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

(PRETTYCOMPRINT RHTPATCH149COMS)

(RPAQQ RHTPATCH149COMS ((* * This prevents titles of remote cards from being changed through a 
			     crossfile link.)
			  (* * Change to NCLINKS)
			  (FNS NC.ChangeCardTitleFromLinkIcon)
			  (* * Change to NCCROSSFILELINKS)
			  (FNS NC.CrossFileLinkEditFn)))
(* * This prevents titles of remote cards from being changed through a crossfile link.)

(* * Change to NCLINKS)

(DEFINEQ

(NC.ChangeCardTitleFromLinkIcon
  (LAMBDA (LinkIcon Window)                                  (* rht: "13-Nov-86 18:17")

          (* * From a link icon sitting in Window, change the title of the link's destination card.)



          (* * kirk 14Nov85: deleted use of PSA.Database)



          (* * fgh 6/4/86 Fixed so that moves card back to original location if moved to be on screen.
	  This fixes a bug in TEdit that'll mess up the screen if a window is mived under a ImageObj ButtonEventInFn.)



          (* * kef 7/16/86: Added mechanism for grabbing the write permission on the TITLE of the destination card.)



          (* * kef 7/30/86: Modified to check for Client's concept of whether he owns the write lock or not, thus deciding 
	  whether or not to setup the release of the write lock afterwards.)



          (* * fgh 8/30/86 Adpated to use NC.IfCardPartNotBusy.)



          (* * rht 11/13/86: Now checks for crossfile links and bails out.)


    (LET (Link Card DestinationCard OldTitle NewTitle)
         (RESETLST (RESETSAVE NIL (BQUOTE (MOVEW , Window , (LOWERLEFT (WINDOWPROP
										   Window
										   (QUOTE REGION))))
						))
		     (if (NC.LinkIconImageObjP LinkIcon)
			 then (SETQ Link (NC.FetchLinkFromLinkIcon LinkIcon))
				(SETQ Card (fetch (Link SourceCard) of Link))
				(SETQ DestinationCard (fetch (Link DestinationCard) of Link))
				(if (NC.CrossFileLinkCardP DestinationCard)
				    then (NC.PrintMsg Window T 
					    "Can't change card title from a cross notefile link.")
					   (DISMISS 1500)
					   (NC.ClearMsg Window T)
					   NIL
				  else (NC.IfCardPartNotBusy
					   DestinationCard
					   (QUOTE TITLE)
					   (if (SETQ NewTitle
						   (NC.AskUser (CONCAT 
							  "Enter new title for card with title '"
									   (NC.RetrieveTitle 
										  DestinationCard)
									   "'"
									   (CHARACTER 13))
								 "-->  "
								 (if (AND (STREQUAL
										(SETQ OldTitle
										  (NC.RetrieveTitle
										    DestinationCard))
										"Untitled")
									      (NC.FetchNewCardFlg
										DestinationCard))
								     then NIL
								   else OldTitle)
								 T Window))
					       then (NC.AssignTitle DestinationCard NIL NewTitle)
						      (QUOTE CHANGED)))))))))
)
(* * Change to NCCROSSFILELINKS)

(DEFINEQ

(NC.CrossFileLinkEditFn
  (LAMBDA (Card Substance RegionOrPosition TypeSpecificArgs)
                                                             (* rht: "14-Nov-86 14:55")

          (* * Given a CrossFileLink Substance, try to find the corresponding destination card in the destination notefile 
	  and bring it up.)



          (* * rht 11/13/86: Now updates title of crossfile link card to be the same as destination card if necessary.)


    (LET ((DestinationCard (NC.GetCrossFileLinkDestCard Card))
	  DestinationCardTitle)
         (if (NOT (STREQUAL (SETQ DestinationCardTitle (NC.FetchTitle DestinationCard))
				  (NC.FetchTitle Card)))
	     then (NC.AssignTitle Card NIL DestinationCardTitle))
         (AND DestinationCard (NC.EditNoteCard DestinationCard RegionOrPosition TypeSpecificArgs))
      )))
)
(PUTPROPS RHTPATCH149 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (777 3272 (NC.ChangeCardTitleFromLinkIcon 787 . 3270)) (3312 4204 (
NC.CrossFileLinkEditFn 3322 . 4202)))))
STOP