(FILECREATED " 2-Dec-87 18:28:15" {QV}<NOTECARDS>1.3KNEXT>RGPATCH068.;1 4267   

      changes to:  (VARS RGPATCH068COMS)
		   (FNS NC.MakeTextCardReadOnly))


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

(PRETTYCOMPRINT RGPATCH068COMS)

(RPAQQ RGPATCH068COMS ((* * rg 12/2/87 puts back some things that were apparently lost in 
			    integration)
			 (* * changes to NCCARDS)
			 (FNS NC.EditProperties)
			 (* * changes to NCTEXTCARD)
			 (FNS NC.MakeTextCardReadOnly)))
(* * rg 12/2/87 puts back some things that were apparently lost in integration)

(* * changes to NCCARDS)

(DEFINEQ

(NC.EditProperties
  [LAMBDA (TextStream)                                       (* Randy.Gobbel " 2-Dec-87 18:15")
                                                             (* Open a property list editor for the card 
							     corresponding to TextStream.
							     Called from Title bar menus.)

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



          (* * rht 4/11/86: No longer sticks dates and Updates in property list. Only user-defined stuff.)



          (* * kef 7/22/86: Added call to card's obtain write permission function for the PROPLIST.)



          (* * fgh 8/30/86 Converted APPLY* to NC.ApplyFn.)



          (* * rht 1/16/87: Now uses NC.SystemCardPropNames globalvar.)



          (* * rg 4/1/87 added NC.ProtectedCardOperation wrapper)



          (* * rg 21/2/87 Now editor will be read-only if card is read-only)


    (DECLARE (GLOBALVARS NC.SystemCardPropNames))
    (LET ((Card (NC.CoerceToCard (WINDOW.FROM.TEDIT.THING TextStream)))
	  PropList PropEditorWindow)
         (NC.ProtectedCardOperation Card "Edit Properties" NIL (SETQ PropList (NC.FetchPropList
					Card))
				    (COND
				      ((NC.ApplyFn ObtainWritePermissionFn Card (QUOTE PROPLIST))
					(WINDOWPROP [SETQ PropEditorWindow
							(NC.OpenPropListEditor
							  TextStream
							  (for SubList on PropList
							     by (CDDR SubList)
							     when (NOT (FMEMB (CAR SubList)
										    
									   NC.SystemCardPropNames))
							     join (LIST (CAR SubList)
									    (CADR SubList)))
							  "Edit Property List"
							  (NC.FetchUserDataProp Card (QUOTE
										    ReadOnly]
						      (QUOTE ReleaseWritePermissionP)
						      T)
					PropEditorWindow)
				      (T (NC.CardPartBusy Card (QUOTE PROPLIST])
)
(* * changes to NCTEXTCARD)

(DEFINEQ

(NC.MakeTextCardReadOnly
  [LAMBDA (Card)                                             (* Randy.Gobbel " 2-Dec-87 18:13")
    (DECLARE (GLOBALVARS NC.ShowPropListMenu))
    (LET ((Window (NC.FetchWindow Card))
	  PropListEditor)
         (NC.ProtectedCardOperation Card "Make Read-Only" Window
				    (if (NC.CardSomehowDirtyP Card)
					then (ALLOW.BUTTON.EVENTS)
					       (if (MENU (create MENU
								       TITLE ← "Card has been edited"
								       ITEMS ←
								       (QUOTE (("Save Changes"
										    T 
							"Save edited version of card in NoteFile")
										  ("Revert" NIL 
					     "Discard edits, refetch card contents from NoteFile")))
								       CENTERFLG ← T))
						   then (NC.CardSaveFn Card NIL Window)
						 else (NC.RevertTextCard Card)))
				    (NC.SetUserDataProp Card (QUOTE ReadOnly)
							  T)
				    (if (WINDOWP (SETQ PropListEditor (NC.PropListEditorOpenP
							 Window)))
					then (NC.MakeTEditReadOnly PropListEditor)
					       (WINDOWPROP PropListEditor (QUOTE TEDIT.MENU)
							     NC.ShowPropListMenu))
				    (if (WINDOWP (SETQ PropListEditor (NC.PropListEditorOpenP
							 Window T)))
					then (NC.MakeTEditReadOnly PropListEditor))
				    (NC.MakeTEditReadOnly Window
							    (QUOTE (Assign% Title Title/FileBoxes 
										Add% Global% Link 
										    Insert% Link 
										 Put% Cards% Here 
										  Restart% Editor))
							    (QUOTE (Delete% Card])
)
(PUTPROPS RGPATCH068 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (623 2554 (NC.EditProperties 633 . 2552)) (2589 4186 (NC.MakeTextCardReadOnly 2599 . 
4184)))))
STOP