(FILECREATED "10-Feb-86 10:07:35" {QV}<NOTECARDS>1.3K>FGHPATCH021.;1 3405   

      changes to:  (VARS FGHPATCH021COMS)
		   (FNS NC.AddPropToPropList))


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

(PRETTYCOMPRINT FGHPATCH021COMS)

(RPAQQ FGHPATCH021COMS ((* * Fix bug in which edit window is closed by add property to prop list.)
			  (FNS NC.AddPropToPropList)))
(* * Fix bug in which edit window is closed by add property to prop list.)

(DEFINEQ

(NC.AddPropToPropList
  (LAMBDA (editW)                                            (* fgh: "10-Feb-86 10:05")
                                                             (* Add a new prop to the propList being edited in 
							     editW)

          (* * fgh 2/10/86 Fix problem with ClearMsg deleting editing window.)


    (PROG ((promptWindow (GETPROMPTWINDOW editW 5 NIL NIL))
	     selectedObject propName propValue insertPtr insertChars beginPtr
	     (stream (WINDOWPROP editW (QUOTE TEXTSTREAM)))
	     (tobj (WINDOWPROP editW (QUOTE TEXTOBJ))))
	    (SETQ propName (MKATOM (NC.AskUser "New Property Name is = " NIL NIL T promptWindow)
				       ))
	    (NC.PrintMsg promptWindow NIL (CHARACTER 13))
	    (SETQ propValue (NC.AskUser (CONCAT "Value for " propName " property = ")
					    NIL NIL T promptWindow))
                                                             (* Insert these values into the editW)
                                                             (* Position just before selected button)
	    (NC.PrintMsg promptWindow T 
			   "Please select a property before which to insert this new property."
			   (CHARACTER 13))
	    (SETQ selectedObject (NC.SelectProperty editW))
	    (NC.ClearMsg promptWindow T)
	    (AND (NULL selectedObject)
		   (RETURN NIL))
	    (SETQ insertPtr (TEDIT.FIND.OBJECT tobj selectedObject))
	    (SETQ beginPtr insertPtr)                      (* Insert a button with this property name)
	    (TEDIT.INSERT.OBJECT (MBUTTON.CREATE propName (FUNCTION NC.EditPropButtonFN)
						     (FONTCREATE (QUOTE HELVETICA)
								   10
								   (QUOTE BOLD)))
				   stream insertPtr)         (* Spacer between Prop and Value)
	    (add insertPtr 1)
	    (TEDIT.INSERT stream (CHARACTER 9)
			    insertPtr)
	    (TEDIT.LOOKS (TEXTOBJ stream)
			   (QUOTE (PROTECTED ON))
			   insertPtr 1)
	    (add insertPtr 1)                              (* Create a new field (Copied from JBS's 
							     \TEXTMENU.DOC.CREATE))
	    (TEDIT.INSERT stream (CONCAT "  {}" (CHARACTER 13))
			    insertPtr)
	    (TEDIT.LOOKS (TEXTOBJ stream)
			   (QUOTE (PROTECTED ON))
			   insertPtr 5)
	    (TEDIT.LOOKS (TEXTOBJ stream)
			   (QUOTE (PROTECTED ON SELECTPOINT ON))
			   (IPLUS insertPtr 2)
			   1)
	    (TEDIT.INSERT stream (MKSTRING propValue)
			    (IPLUS insertPtr 3))
	    (TEDIT.LOOKS (TEXTOBJ stream)
			   (QUOTE (PROTECTED OFF SELECTPOINT OFF))
			   (IPLUS insertPtr 3)
			   (NCHARS (MKSTRING propValue)))
	    (add insertPtr (NCHARS (MKSTRING propValue)))
	    (add insertPtr 5))))
)
(PUTPROPS FGHPATCH021 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (480 3323 (NC.AddPropToPropList 490 . 3321)))))
STOP