(FILECREATED " 1-Oct-87 12:19:52" {QV}<NOTECARDS>1.3KNEXT>RHTPATCH289.;7 29261  

      changes to:  (VARS RHTPATCH289COMS)
		   (FNS NC.DelReferencesToCardFromShowLinks NC.UpdateLinkImages 
			NC.FetchLinkIconFromShowLinksWin NC.ChangeLinkLabelInShowLinksWin 
			NC.RelabelLink NC.FetchShowLinksWindow NC.ShowLinks NC.EditPropList 
			NC.UpdateLinkImagesInShowLinks)

      previous date: "30-Sep-87 13:00:49" {QV}<NOTECARDS>1.3KNEXT>RHTPATCH289.;1)


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

(PRETTYCOMPRINT RHTPATCH289COMS)

(RPAQQ RHTPATCH289COMS ((* * Fixes bug %#339: ShowLinks windows now automatically track things of 
			     interest like link creation, deletion, link type changes, card title 
			     changes. Also can recompute the ShowLinks contents by asking again for 
			     ShowLinks from card's titlebar.)
			  (* * New functions for NCLINKS)
			  (FNS NC.UpdateLinkImagesInShowLinks NC.FetchShowLinksWindow 
			       NC.ChangeLinkLabelInShowLinksWin)
			  (* * Changes for NCLINKS)
			  (FNS NC.UpdateLinkImages NC.DelReferencesToCardFromShowLinks NC.ShowLinks 
			       NC.RelabelLink)
			  (* * Changes to NCCARDS)
			  (FNS NC.PropListEditorOpenP NC.OpenPropListEditor NC.EditPropList)))
(* * Fixes bug %#339: ShowLinks windows now automatically track things of interest like link 
creation, deletion, link type changes, card title changes. Also can recompute the ShowLinks 
contents by asking again for ShowLinks from card's titlebar.)

(* * New functions for NCLINKS)

(DEFINEQ

(NC.UpdateLinkImagesInShowLinks
  (LAMBDA (SourceCard DestinationCard)                       (* rht: "30-Sep-87 15:17")

          (* * If there's a ShowLinks window up, then update the affected link icons if any.)


    (LET ((ShowLinksWindow (NC.FetchShowLinksWindow SourceCard))
	  TextObject)
         (if (AND (OPENWP ShowLinksWindow)
		      (SETQ TextObject (TEXTOBJ ShowLinksWindow)))
	     then (for LinkIconPair in (TEDIT.LIST.OF.OBJECTS TextObject
								      (FUNCTION 
									NC.LinkIconImageObjP))
		       bind Link when (PROGN (SETQ Link (NC.FetchLinkFromLinkIcon
						       (CAR LinkIconPair)))
						   (OR (NC.SameCardP (fetch (Link 
										  DestinationCard)
									    of Link)
									 DestinationCard)
							 (NC.SameCardP (fetch (Link SourceCard)
									    of Link)
									 DestinationCard)))
		       do (TEDIT.OBJECT.CHANGED TextObject (CAR LinkIconPair)))))))

(NC.FetchShowLinksWindow
  (LAMBDA (Card)                                             (* rht: "30-Sep-87 15:33")

          (* * Return the ShowLinks window if there is one for Card, else NIL.)


    (LET ((Window (NC.FetchWindow Card)))
         (if Window
	     then (for AttachedWindow in (ALLATTACHEDWINDOWS Window)
		       when (WINDOWPROP AttachedWindow (QUOTE ShowLinks)) do (RETURN 
										   AttachedWindow)))))
)

(NC.ChangeLinkLabelInShowLinksWin
  (LAMBDA (Link ShowLinksWin NewLinkLabel)                   (* rht: "30-Sep-87 20:49")

          (* * Find the Link Icon corresponding to Link in a ShowLinks window and change its label.)


    (for LinkIconPair in (TEDIT.LIST.OF.OBJECTS (TEXTOBJ ShowLinksWin)
						      (FUNCTION NC.LinkIconImageObjP))
       do (LET (FoundLink)
	         (if (NC.SameLinkP Link (SETQ FoundLink (NC.FetchLinkFromLinkIcon
					   (CAR LinkIconPair))))
		     then (replace (Link Label) of FoundLink with NewLinkLabel))))))
)
(* * Changes for NCLINKS)

(DEFINEQ

(NC.UpdateLinkImages
  (LAMBDA (SourceWindowOrCard DestinationCard)               (* rht: "30-Sep-87 19:35")

          (* * Update the Link Image Objects in SourceCard that point to DestinationID)



          (* * rht 10/2/85: Now checks if card's window was shrunk. If so, unshrink, modify and reshrink.)



          (* * fgh 11/17/85 Updated to handle card objects.)



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



          (* * rht 9/30/87: Added calls to NC.UpdateLinkImagesInShowLinks.)


    (LET (SourceWindow SourceCard NoteCardType ShrunkenWin)
         (COND
	   ((WINDOWP SourceWindowOrCard)
	     (SETQ SourceWindow SourceWindowOrCard)
	     (SETQ SourceCard (NC.CoerceToCard SourceWindowOrCard)))
	   (T (SETQ SourceWindow (NC.FetchWindow SourceWindowOrCard))
	      (SETQ SourceCard SourceWindowOrCard)))
         (COND
	   ((SETQ ShrunkenWin (NC.GetShrunkenWin SourceWindow))
	     (EXPANDW ShrunkenWin)))
         (SETQ NoteCardType (NC.RetrieveType SourceCard))
         (NC.UpdateLinkImagesInShowLinks SourceCard DestinationCard)
         (NC.UpdateLinkImagesInShowLinks DestinationCard SourceCard)
         (NC.ApplyFn UpdateLinkIconsFn SourceCard DestinationCard)
         (COND
	   (ShrunkenWin (SHRINKW SourceWindow)))
     NIL)))

(NC.DelReferencesToCardFromShowLinks
  (LAMBDA (Card Link)                                        (* rht: "30-Sep-87 20:56")

          (* * Delete any references to link from the show links editor above Card, if any)



          (* * fgh 5/2/86 First created.)



          (* * rht 9/30/87: Now calls NC.FetchShowLinksWindow making things a bit cleaner.)


    (DECLARE (GLOBALVARS NC.NoDeleteImageFns NC.DeletedLinkImageObject))
    (LET ((ShowLinksWindow (NC.FetchShowLinksWindow Card))
	  TextStream OldSel)
         (if (AND (OPENWP ShowLinksWindow)
		      (SETQ TextStream (TEXTSTREAM ShowLinksWindow)))
	     then (for LinkIconPair in (TEDIT.LIST.OF.OBJECTS (TEXTOBJ TextStream)
								      (FUNCTION 
									NC.LinkIconImageObjP))
		       when (NC.SameLinkP Link (NC.FetchLinkFromLinkIcon (CAR LinkIconPair)))
		       do (replace (IMAGEOBJ IMAGEOBJFNS) of (CAR LinkIconPair) with 
									      NC.NoDeleteImageFns)
                                                             (* WHENDELETEDFN taken care of earlier in delete 
							     cycle)
			    (SETQ OldSel (TEDIT.GETSEL TextStream))
			    (TEDIT.DELETE TextStream (CADR LinkIconPair)
					    1)
			    (TEDIT.INSERT.OBJECT NC.DeletedLinkImageObject TextStream (CADR
						     LinkIconPair))
			    (TEDIT.SETSEL TextStream OldSel))))))

(NC.ShowLinks
  (LAMBDA (CardIdentifier)                                   (* rht: "30-Sep-87 15:31")
                                                             (* Open an inspector for the links for note card 
							     specified by TextStream above the window for the note 
							     card.)

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



          (* * fgh 5/2/86 Included calls to NC.InsureLinkDisplayMode to handle litatom link display modes.
	  Added InsdiePropListEditor and Reverse indicators to UserData field of Links in show links editor.
	  Also added ShowLinks property onto the editor window so other functions can detect that a window is a show links 
	  window.)



          (* * rht 8/11/86: Now passes non-nil ShowLinksFlg to NC.OpenPropListEditor.)



          (* * rg 4/6/87 removed NC.ProtectedCardOperation wrapper.)



          (* * pmi 6/19/87: Now places each link's UID on the corresponding link created for the inspector.
	  Checks for the validity of each link's source and destination cards and deletes links that are bad 
	  (half-links.))



          (* * rht 9/30/87: Now takes arbitrary CardIdentifier as arg.)


    (LET ((Card (NC.CoerceToCard CardIdentifier))
	  Links EditWindow)
         (SETQ Links (NCONC (for Link in (NC.FetchToLinks Card)
				   when (if (NC.ValidCardP (fetch (Link DestinationCard)
								    of Link))
					      then         (* The link is good, include it in the show links 
							     window.)
						     T
					    else           (* The link is bad, delete it and don't include it in 
							     the show links window.)
						   (NC.DeleteLink Link)
						   NIL)
				   join (LIST (COND
						    ((EQ (fetch (Link AnchorMode) of Link)
							   (QUOTE GlobalGlobal))
						      "Global TO")
						    (T "TO"))
						  (LIST (create Link
							     using
							      Link DisplayMode ←(create 
										  LINKDISPLAYMODE
										   copying
										    (
									 NC.InsureLinkDisplayMode
										      (fetch
											(Link 
										      DisplayMode)
											 of Link))
										    SHOWTITLEFLG ← T 
										  SHOWLINKTYPEFLG ← T)
							      UserData ←(QUOTE (InsidePropListEditor
										   T))
							      UID ←(fetch (Link UID) of Link)))))
				(for Link in (NC.FetchFromLinks Card)
				   when (if (NC.ValidCardP (fetch (Link SourceCard)
								    of Link))
					      then         (* The link is good, include it in the show links 
							     window.)
						     T
					    else           (* The link is bad, delete it and don't include it in 
							     the show links window.)
						   (NC.DeleteLink Link)
						   NIL)
				   join (LIST "FROM"
						  (LIST (create Link
							     using
							      Link DisplayMode ←(create 
										  LINKDISPLAYMODE
										   copying
										    (
									 NC.InsureLinkDisplayMode
										      (fetch
											(Link 
										      DisplayMode)
											 of Link))
										    SHOWTITLEFLG ← T 
										  SHOWLINKTYPEFLG ← T)
							      SourceCard ←(fetch (Link 
										  DestinationCard)
									     of Link)
							      DestinationCard ←(fetch (Link 
										       SourceCard)
										  of Link)
							      UserData ←(QUOTE (InsidePropListEditor
										   T Reversed T))
							      UID ←(fetch (Link UID) of Link))))))
	   )
         (WINDOWPROP (SETQ EditWindow (NC.OpenPropListEditor (NC.FetchWindow Card)
								   Links "List of Links" T T T))
		       (QUOTE ShowLinks)
		       T)
     EditWindow)))

(NC.RelabelLink
  (LAMBDA (LinkOrLinkIcon Window NewLinkLabel ForceRedisplayFlg)
                                                             (* rht: "30-Sep-87 20:52" pp pp)
                                                             (* Relabel a NoteCard link.
							     Ask user for new label. Update all the proper 
							     references to this link.)

          (* * rht 11/19/84: Fixed so that Card is defined before first use.)



          (* * kirk 14Nov85: deleted use of and LinkID)



          (* * kef 8/8/86: Added obtaining write lock and NC.PutFromLinks.)



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



          (* * rht 9/29/86: Changed Ken's call to NC.CardBeingEditedP to NC.ActiveCardP and other minor mod's.)



          (* * rg 5/15/87 now calls NC.LinksCachedP instead of NC.ActiveCardP)



          (* * rht 5/27/87: Now passes new label through cross file link if its dest notefile is open.)



          (* * pmi 9/11/87: Fixes bug 692 -
	  can no longer change link label when notefile is open read-only.)



          (* * rht 9/30/87: Now tries to update ShowLinks windows if any.)


    (LET (Link LinkIcon Card DestinationCard OldLabel NoteCardType GlobalLinkFlg)
         (if (NC.LinkIconImageObjP LinkOrLinkIcon)
	     then (SETQ Link (NC.FetchLinkFromLinkIcon LinkOrLinkIcon))
		    (SETQ LinkIcon LinkOrLinkIcon)
	   else (SETQ Link LinkOrLinkIcon)
		  (OR (SETQ GlobalLinkFlg (NC.GlobalLinkP Link))
			(SETQ LinkIcon (NC.FetchLinkIconForLink Link))))
         (SETQ Card (fetch (Link SourceCard) of Link))
         (if (NC.CheckForNotReadOnly Card Window "Can't change link type of links in ")
	     then (COND
		      ((WINDOWP Window))
		      ((NC.ActiveCardP Card)
			(SETQ Window (NC.FetchWindow Card))))
		    (SETQ DestinationCard (fetch (Link DestinationCard) of Link))
		    (NC.IfCardPartNotBusy DestinationCard (QUOTE FROMLINKS)
					  (COND
					    ((NC.SystemLinkLabelP (fetch (Link Label)
								       of Link))
					      (NC.PrintMsg Window T 
							   "This is a system maintained pointer."
							     (CHARACTER 13)
							     "You cannot change its label."
							     (CHARACTER 13))
					      (SPAWN.MOUSE)
					      (DISMISS 1500)
					      (NC.ClearMsg Window T))
					    ((SETQ NewLinkLabel
						(OR NewLinkLabel (NC.AskLinkLabel Window NIL NIL 
										      T T)))
					      (SETQ NoteCardType (NC.RetrieveType Card))

          (* * Put new label in Link Icon or global links list)


					      (if GlobalLinkFlg
						  then (for GlobalLink in (NC.FetchGlobalLinks
										  Card)
							    when (NC.SameLinkP GlobalLink Link)
							    do (replace (Link Label)
								    of GlobalLink with 
										     NewLinkLabel)
								 (NC.SetLinksDirtyFlg Card T)
								 (RETURN))
						else (replace (Link Label) of (
									 NC.FetchLinkFromLinkIcon
										      LinkIcon)
							  with NewLinkLabel)
						       (NC.MarkCardDirty Card))

          (* * Update ToLink list of the SourceCard card)


					      (for ToLink in (NC.FetchToLinks Card)
						 when (NC.SameLinkP ToLink Link)
						 do (replace (Link Label) of ToLink
							 with NewLinkLabel)
						      (NC.SetLinksDirtyFlg Card T)
						      (RETURN))

          (* * Update link icons in any displayed ShowLinks windows.)


					      (LET ((ShowLinksWin (NC.FetchShowLinksWindow Card)))
					           (if ShowLinksWin
						       then (NC.ChangeLinkLabelInShowLinksWin
								Link ShowLinksWin NewLinkLabel)))
					      (LET ((ShowLinksWin (NC.FetchShowLinksWindow 
										  DestinationCard)))
					           (if ShowLinksWin
						       then (NC.ChangeLinkLabelInShowLinksWin
								Link ShowLinksWin NewLinkLabel)))

          (* * Update FromLink list of DestinationCard card)


					      (if (NC.LinksCachedP DestinationCard)
						  then (for FromLink in (NC.FetchFromLinks
										DestinationCard)
							    when (NC.SameLinkP FromLink Link)
							    do (replace (Link Label)
								    of FromLink with NewLinkLabel)
								 (NC.SetLinksDirtyFlg 
										  DestinationCard T)
								 (RETURN))
						else (WITH.MONITOR (NC.FetchMonitor
								       (fetch (Card NoteFile)
									  of DestinationCard))
								     (NC.GetLinks DestinationCard)
								     (for FromLink
									in (NC.FetchFromLinks
									       DestinationCard)
									when (NC.SameLinkP 
											 FromLink 
											     Link)
									do (replace (Link Label)
										of FromLink
										with NewLinkLabel)
									     (NC.SetLinksDirtyFlg
									       DestinationCard T)
									     (RETURN))
								     (NC.PutFromLinks 
										  DestinationCard)
								     (NC.UncacheLinks 
										  DestinationCard)))

          (* * Pass change through cross-file link to other notefile if open.)


					      (if (NC.CrossFileLinkCardP Card)
						  then (LET ((RemoteCrossFileLinkCard (
								  NC.FetchRemoteCrossFileLinkCard
											  Card)))
							      (AND RemoteCrossFileLinkCard
								     (NC.CheckCrossFileLinkType
								       RemoteCrossFileLinkCard Card 
								       Link))))
					      (if (NC.CrossFileLinkCardP DestinationCard)
						  then (LET ((RemoteCrossFileLinkCard (
								  NC.FetchRemoteCrossFileLinkCard
											  
										  DestinationCard)))
							      (AND RemoteCrossFileLinkCard
								     (NC.CheckCrossFileLinkType
								       RemoteCrossFileLinkCard 
								       DestinationCard Link))))

          (* * Update images in SourceCard window)


					      (if (WINDOWP Window)
						  then (NC.UpdateLinkImages Window
										(fetch
										  (Link 
										  DestinationCard)
										   of Link)))
					      (if (AND (NULL ForceRedisplayFlg)
							   (NC.TEditBasedP NoteCardType))
						  then (QUOTE CHANGED)
						else NIL))))))))
)
(* * Changes to NCCARDS)

(DEFINEQ

(NC.PropListEditorOpenP
  (LAMBDA (Window ShowLinksFlg)                              (* rht: "30-Sep-87 12:10")
                                                             (* Is there a prop list editor opened on this window?)

          (* * rht 8/11/86: Now doesn't return NIL unless there's an open proplist editor of our type.)



          (* * rht 9/30/87: Now returns the attached window if successful.)


    (for AttachedWindow in (ALLATTACHEDWINDOWS Window)
       thereis (AND (WINDOWPROP AttachedWindow (QUOTE PropListEditor))
			(LET ((ShowLinks (WINDOWPROP AttachedWindow (QUOTE ShowLinks))))
                                                             (* Check that ShowLinksFlg iff ShowLinks.)
			     (OR (AND ShowLinksFlg ShowLinks)
				   (AND (NULL ShowLinksFlg)
					  (NULL ShowLinks))))
			AttachedWindow))))

(NC.OpenPropListEditor
  (LAMBDA (WindowOrTextStream PropList Title ShowOnlyFlg MakeImageObjFlg ShowLinksFlg)
                                                             (* rht: "30-Sep-87 12:21")
                                                             (* Open a property list editor above the card 
							     specified by TextStream , which is either a TextStream
							     or a Window)

          (* * rht 8/11/86: Now takes ShowLinksFlg arg and passes to NC.PropListEditorOpenP so that we don't bail out if 
	  there's an open proplist not of our type.)



          (* * rht 11/13/86: Now hangs Card object off prop list editor's window so that we can get to the card from the 
	  proplist editor at close time.)



          (* * rht 12/11/86: Now only breaks out list if we're under ShowLinks.)



          (* * rht 9/30/87: Now allows reuse of ShowLinks editor window.)


    (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))
	     (SystemProperties (QUOTE (ID Updates ItemDate LinksDate PropsDate TitleDate)))
	     EditWindow CardUID Card)                        (* Make sure there is no prop list editor already 
							     there. Okay, however, to reuse ShowLinks editor.)
	    (if (AND (SETQ EditWindow (NC.PropListEditorOpenP Window ShowLinksFlg))
			 (NOT ShowLinksFlg))
		then (RETURN))
	    (SETQ CardUID (fetch (Card UID) of (SETQ Card (NC.CoerceToCard Window))))
                                                             (* FOR each prop/value pair with LISTP value.
							     Make a series of individual prop/value pairs 
							     corresponding to the elements of the LISTP)
	    (SETQ PropList (for Item on PropList by (CDDR Item)
				join (COND
					 ((AND (LISTP (CADR Item))
						 (type? Link (CAADR Item)))
					   (for Element in (CADR Item)
					      collect (create PropListItem
								  PropertyName ←(CAR Item)
								  Value ← Element
								  OriginalListFlg ← T
								  AllowEditFlg ← NIL
								  AllowSelectFlg ← NIL
								  ButtonFn ← NIL)))
					 (T (LIST (create PropListItem
							      PropertyName ←(CAR Item)
							      Value ←(CADR Item)
							      OriginalListFlg ← NIL
							      AllowEditFlg ← NIL
							      AllowSelectFlg ← NIL
							      ButtonFn ← NIL))))))
                                                             (* If specified, translate all NOTECARDLINK values 
							     into Image Objects for display.)
	    (AND MakeImageObjFlg (for Item in PropList bind LinkIcon
				      when (type? Link (fetch (PropListItem Value)
							      of Item))
				      do (replace (PropListItem Value) of Item
					      with (SETQ LinkIcon (NC.MakeLinkIcon
							 (fetch (PropListItem Value) of Item)))
						     (IMAGEOBJPROP LinkIcon (QUOTE 
									     InsidePropListEditor)
								     T))))
                                                             (* Indicate which properties can be edited by user.)
	    (for Item in PropList do (COND
					     ((FMEMB (fetch (PropListItem PropertyName)
							  of Item)
						       SystemProperties)
					       (replace (PropListItem AllowEditFlg) of Item
						  with T)
					       (replace (PropListItem AllowSelectFlg) of Item
						  with T))
					     (ShowOnlyFlg (replace (PropListItem AllowEditFlg)
							     of Item with NIL)
							  (replace (PropListItem AllowSelectFlg)
							     of Item with T))
					     (T (replace (PropListItem AllowEditFlg) of Item
						   with NIL)
						(replace (PropListItem AllowSelectFlg)
						   of Item with NIL))))
                                                             (* Call the prop list editor)
	    (OR (WINDOWP EditWindow)
		  (ATTACHWINDOW (SETQ EditWindow (CREATEW (CREATEREGION 1000 2000 100 100)
								(OR Title "Edit Property List")
								NIL T))
				  Window
				  (QUOTE TOP)
				  (QUOTE JUSTIFY)
				  (QUOTE LOCALCLOSE)))
	    (WINDOWADDPROP EditWindow (QUOTE CLOSEFN)
			     (FUNCTION FREEATTACHEDWINDOW)
			     T)
	    (WINDOWPROP EditWindow (QUOTE PropListEditor)
			  (COND
			    (ShowOnlyFlg (QUOTE ShowOnly))
			    (T T)))
	    (WINDOWPROP EditWindow (QUOTE SavedCardObject)
			  Card)
	    (NC.EditPropList PropList EditWindow ShowOnlyFlg)
	    (RETURN EditWindow))))

(NC.EditPropList
  (LAMBDA (propList window showOnlyFlg)                      (* rht: "30-Sep-87 18:19")

          (* * propList is a list of RECORDS of type PropListItem)



          (* * Edit a property list using the TEDIT menu-based editor. The var window is the window to use.
	  If none supplied, get one from user.)



          (* * rht 4/11/86: Now stashes length of propList on WINDOWPROP.)



          (* * rht 8/12/86: Moved code to add NC.ClosePropListEditor on CLOSEFN from NC.OpenPropListEditor to here so that it
	  can before TEDIT.DEACTIVATE.WINDOW on the CLOSEFN list.)



          (* * rht 1/16/87: Now stashes prop names on windowprop rather than number of props.)



          (* * pmi 3/25/87: Added NC.MenuFont to all menus)



          (* * rht 9/30/87: Now kills any existing edit process in editW before starting new one.)


    (DECLARE (GLOBALVARS NC.MenuFont))
    (PROG (menuStream textObj editW button (font (FONTCREATE (QUOTE HELVETICA)
								 8))
			(CH# 1)
			(ENDCH# 1))                          (* Init the editList and the propFnsList)
                                                             (* Create a TEDITMenu that reflects the structure of 
							     the proplist)
	    (SETQ menuStream
	      (\TEXTMENU.DOC.CREATE
		(for X in propList
		   join (NCONC (LIST (LIST (QUOTE MB.BUTTON)
						   (MKSTRING (fetch (PropListItem PropertyName)
								  of X))
						   (OR (fetch (PropListItem ButtonFn)
							    of X)
							 (FUNCTION NC.EditPropButtonFN))))
				   (COND
				     ((NOT (IMAGEOBJP (fetch (PropListItem Value) of X)))
				       (COND
					 ((fetch (PropListItem AllowEditFlg) of X)
					   (LIST (LIST (QUOTE MB.TEXT)
							   (CONCAT (CHARACTER 9)
								     "  ["
								     (MKSTRING (fetch
										   (PropListItem
										     Value)
										    of X))
								     "]"
								     (CHARACTER 13))
							   font)))
					 (T (LIST (LIST (QUOTE MB.TEXT)
							    (CHARACTER 9)
							    font)
						    (LIST (QUOTE MB.INSERT)
							    (MKSTRING (fetch (PropListItem Value)
									   of X)))
						    (LIST (QUOTE MB.TEXT)
							    (CHARACTER 13)
							    font)))))
				     (T (LIST (LIST (QUOTE MB.TEXT)
							(CHARACTER 9)
							font)
						(LIST (QUOTE MB.INSERT))
						(LIST (QUOTE MB.TEXT)
							(CHARACTER 13)
							font))))))))
	    (SETQ textObj (TEXTOBJ menuStream))          (* Go back and insert the ImageObjects into their 
							     value fields.)
	    (SETQ CH# 0)
	    (for prop in propList when (OR (IMAGEOBJP (fetch (PropListItem Value)
								   of prop))
						   (NULL (fetch (PropListItem AllowEditFlg)
							      of prop)))
	       do (MBUTTON.FIND.NEXT.FIELD textObj (SETQ CH# (ADD1 CH#)))
		    (SETQ CH# (fetch CH# of (fetch SCRATCHSEL of textObj)))
		    (COND
		      ((IMAGEOBJP (CADR prop))
			(TEDIT.INSERT.OBJECT (fetch (PropListItem Value) of prop)
					       menuStream CH#))))
	    (SETQ CH# 0)
	    (for prop in propList
	       do (SETQ button (MBUTTON.FIND.NEXT.BUTTON textObj (ADD1 CH#)))
		    (SETQ CH# (CDR button))              (* If the buttonProtect flag is on, protect the 
							     button)
		    (AND (fetch (PropListItem AllowSelectFlg) of prop)
			   (IMAGEOBJPROP (CAR button)
					   (QUOTE EditPropListNoDelete)
					   T)))              (* Set up window and window title)
	    (SETQ editW (COND
		(window window)
		(T (CREATEW (GETREGION)
			      "Edit Property List"))))       (* Point to the proplist being edited so we can update
							     it when this menu is closed.
							     (See NC.CloseEditPropListWindow))
	    (WINDOWPROP editW (QUOTE PROPERTYLIST.BEING.EDITED)
			  propList)
	    (WINDOWPROP editW (QUOTE PROPERTYLIST.PROPNAMES)
			  (for Item in propList collect (CAR Item)))
                                                             (* Set the right margin to very-far-away.
							     Prevents stuff from wrapping around)
	    (TEDIT.PARALOOKS textObj (QUOTE (RIGHTMARGIN 1000 TABS (50 (80 . LEFT))))
			       1
			       (GETFILEINFO menuStream (QUOTE LENGTH)))
                                                             (* Set the first tab so the fields will line up 
							     correctly)
                                                             (* Set selection to the top -- make it look pretty)
	    (replace (SELECTION SET) of (fetch (TEXTOBJ SEL) of textObj) with NIL)
                                                             (* Kill any existing tedit process.
							     Notice we have to do WINDOWPROP because calling 
							     TEXTSTREAM breaks if window doesn't have one.)
	    (LET ((OldTextStream (WINDOWPROP editW (QUOTE TEXTSTREAM))))
	         (if (TEXTSTREAMP OldTextStream)
		     then (TEDIT.KILL OldTextStream)))
	    (TEDIT menuStream editW NIL (LIST
		       (QUOTE MENU)
		       (create MENU
				 ITEMS ←(COND
				   (showOnlyFlg (QUOTE (("Quit" (NC.ClosePropListEditor
								    W
								    (QUOTE NoSave))
								  "Quit from pointer list display.")))
						)
				   (T (QUOTE (("Add New Property" (NC.AddPropToPropList W)
								    
					       "Add a new property to this card's property list.")
						 ("Delete Selected Property" (NC.DelPropFromList
									       W)
									     
				       "Delete selected property from this card's property list.")
						 ("Quit w/o Saving Changes" (NC.ClosePropListEditor
									      W
									      (QUOTE NoSave))
									    
					   "Quit from property list edit. Changes are not saved.")
						 ("Quit - Saving Changes" (NC.ClosePropListEditor
									    W
									    (QUOTE Save))
									  
						  "Quit from property list editor. Save changes.")))))
				 MENUFONT ← NC.MenuFont
				 CENTERFLG ← T
				 ITEMHEIGHT ←(IPLUS (FONTPROP NC.MenuFont (QUOTE HEIGHT))
						      1))))
	    (WINDOWADDPROP editW (QUOTE CLOSEFN)
			     (FUNCTION NC.ClosePropListEditor)
			     T))))
)
(PUTPROPS RHTPATCH289 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1543 3681 (NC.UpdateLinkImagesInShowLinks 1553 . 2577) (NC.FetchShowLinksWindow 2579 . 
3061) (NC.ChangeLinkLabelInShowLinksWin 3063 . 3679)) (3714 16918 (NC.UpdateLinkImages 3724 . 5091) (
NC.DelReferencesToCardFromShowLinks 5093 . 6557) (NC.ShowLinks 6559 . 10448) (NC.RelabelLink 10450 . 
16916)) (16950 29179 (NC.PropListEditorOpenP 16960 . 17873) (NC.OpenPropListEditor 17875 . 22569) (
NC.EditPropList 22571 . 29177)))))
STOP