(FILECREATED "11-Jul-85 19:19:48" {PHYLUM}<NOTECARDS>RELEASE1.2I>FGHPATCH017.;1 8349   

      changes to:  (VARS FGHPATCH017COMS)
		   (FNS NC.ProcessEditedPropList))


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

(PRETTYCOMPRINT FGHPATCH017COMS)

(RPAQQ FGHPATCH017COMS ((* * Redefined from NCCARDS - show dates in prop list editor)
			(FNS NC.EditProperties NC.OpenPropListEditor NC.ProcessEditedPropList 
			     NC.DelPropFromList)))
(* * Redefined from NCCARDS - show dates in prop list editor)

(DEFINEQ

(NC.EditProperties
  (LAMBDA (TextStream)                                       (* fgh: "11-Jul-85 19:06")
                                                             (* Open a property list editor for the card 
							     corresponding to TextStream.
							     Called from Title bar menus.)
    (PROG ((ID (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING TextStream)))
	   PropList)
          (SETQ PropList (NC.FetchPropList ID))
          (NC.OpenPropListEditor TextStream (NCONC (for SubList on PropList by (CDDR SubList)
						      when (NEQ (CAR SubList)
								(QUOTE Updates))
						      join (LIST (CAR SubList)
								 (CADR SubList)))
						   (LIST (QUOTE ID)
							 ID
							 (QUOTE ItemDate)
							 (NC.FetchItemDate ID)
							 (QUOTE LinksDate)
							 (NC.FetchLinksDate ID)
							 (QUOTE PropsDate)
							 (NC.FetchPropListDate ID)
							 (QUOTE TitleDate)
							 (NC.FetchTitleDate ID)
							 (QUOTE Updates)
							 (LISTGET PropList (QUOTE Updates))))
				 "Edit Property List"))))

(NC.OpenPropListEditor
  (LAMBDA (WindowOrTextStream PropList Title ShowOnlyFlg MakeImageObjFlg)
                                                             (* fgh: "11-Jul-85 18:44")
                                                             (* Open a property list editor above the card specified
							     by TextStream , which is either a TextStream or a 
							     Window)
    (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))
	   (SystemProperties (QUOTE (ID Updates ItemDate LinksDate PropsDate TitleDate)))
	   EditWindow ID)                                    (* Make sure there is no prop list editor already 
							     there)
          (AND (NC.PropListEditorOpenP Window)
	       (RETURN))
          (SETQ ID (NC.IDFromWindow 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
				   ((NLISTP (CADR Item))
				     (LIST (create PropListItem
						   PropertyName ←(CAR Item)
						   Value ←(CADR Item)
						   OriginalListFlg ← NIL
						   AllowEditFlg ← NIL
						   AllowSelectFlg ← NIL
						   ButtonFn ← NIL)))
				   (T (for Element in (CADR Item) collect (create PropListItem
										  PropertyName ←(CAR
										    Item)
										  Value ← Element
										  OriginalListFlg ← T
										  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? NOTECARDLINK
									       (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)
          (ATTACHWINDOW (SETQ EditWindow (CREATEW (CREATEREGION 1000 2000 100 100)
						  (OR Title "Edit Property List")
						  NIL T))
			Window
			(QUOTE TOP)
			(QUOTE JUSTIFY))
          (WINDOWADDPROP EditWindow (QUOTE CLOSEFN)
			 (FUNCTION NC.ClosePropListEditor))
          (WINDOWPROP EditWindow (QUOTE PropListEditor)
		      (COND
			(ShowOnlyFlg (QUOTE ShowOnly))
			(T T)))
          (NC.EditPropList PropList EditWindow ShowOnlyFlg)
          (RETURN EditWindow))))

(NC.ProcessEditedPropList
  (LAMBDA (EditedPropList OldPropList)                       (* fgh: "11-Jul-85 19:17")
                                                             (* Take an edited prop list and set the prop list of 
							     the card as required.)

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


    (PROG (ID NewPropList Prop ListItem oldItem Value)
          (SETQ ID (fetch (PropListItem Value) of (FASSOC (QUOTE ID)
							  OldPropList)))
          (for Item in EditedPropList
	     do (SETQ Prop (fetch (PropListItem PropertyName) of Item))
		(SETQ oldItem (FASSOC Prop OldPropList))
		(COND
		  ((FMEMB Prop (QUOTE (ID ItemDate LinksDate PropsDate TitleDate))))
		  ((NULL NewPropList)
		    (SETQ NewPropList (LIST Prop (COND
					      ((fetch (PropListItem OriginalListFlg) of oldItem)
						(LIST (CADR Item)))
					      (T (CADR Item))))))
		  ((SETQ Value (LISTGET NewPropList Prop))
		    (LISTPUT NewPropList Prop (COND
			       ((LISTP Value)
				 (NCONC1 Value (CADR Item)))
			       (T (LIST (CADR Item)
					Value)))))
		  (T (LISTPUT NewPropList Prop (COND
				((fetch (PropListItem OriginalListFlg) of oldItem)
				  (LIST (CADR Item)))
				(T (CADR Item)))))))
          (NC.SetPropList ID NewPropList)
          (NC.SetPropListDirtyFlg ID T))))

(NC.DelPropFromList
  (LAMBDA (editW)                                            (* fgh: "11-Jul-85 19:12")
    (PROG ((tobj (WINDOWPROP editW (QUOTE TEXTOBJ)))
	   (stream (WINDOWPROP editW (QUOTE TEXTSTREAM)))
	   selectedObject CH#)
          (NC.PrintMsg editW T "Please select property to be deleted.")
          (SETQ selectedObject (NC.SelectProperty editW))
          (NC.ClearMsg editW T)
          (COND
	    ((COND
		((NOT (IMAGEOBJPROP selectedObject (QUOTE EditPropListNoDelete)))
		  (SETQ CH# (TEDIT.FIND.OBJECT tobj selectedObject))
		  (MBUTTON.FIND.NEXT.FIELD tobj CH#)         (* Delete everything between the imageobj and the 
							     end-of-line.)
		  (TEDIT.LOOKS tobj (QUOTE (PROTECTED OFF))
			       CH#
			       (IPLUS 2 (IDIFFERENCE (fetch CHLIM of (fetch SCRATCHSEL of tobj))
						     CH#)))
		  (TEDIT.DELETE stream CH# (IPLUS 2 (IDIFFERENCE (fetch CHLIM
								    of (fetch SCRATCHSEL
									  of tobj))
								 CH#)))
		  (TEDIT.SETSEL stream (GETEOFPTR stream)
				0
				(QUOTE RIGHT)))
		(T (NC.PrintMsg editW T "Selected property:value pair cannot be deleted."
				(CHARACTER 13)))))))))
)
(PUTPROPS FGHPATCH017 COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (539 8267 (NC.EditProperties 549 . 1708) (NC.OpenPropListEditor 1710 . 5465) (
NC.ProcessEditedPropList 5467 . 6966) (NC.DelPropFromList 6968 . 8265)))))
STOP