(FILECREATED "29-May-85 00:08:23" {PHYLUM}<NOTECARDS>RELEASE1.2>FGHPATCH012.;1 3671   

      changes to:  (VARS FGHPATCH012COMS)
		   (FNS NC.IDFromTextStream NC.TEditPutFn))


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

(PRETTYCOMPRINT FGHPATCH012COMS)

(RPAQQ FGHPATCH012COMS ((* * New FNS for NCTEXTSUBSTANCE)
			(FNS NC.IDFromTextStream NC.TEditPutFn)
			(* * From NCTEXTCARD)
			(FNS NC.MakeTEditCard)
			(* * From NCDATABASE)
			(FNS NC.GetTextSubstance)))
(* * New FNS for NCTEXTSUBSTANCE)

(DEFINEQ

(NC.IDFromTextStream
  (LAMBDA (TextStream)                                       (* fgh: "28-May-85 23:12")

          (* * Return the NoteCards ID for a TextStream)


    (STREAMPROP TextStream (QUOTE NoteCardID))))

(NC.TEditPutFn
  (LAMBDA (TextStream FileName When?)                        (* fgh: "28-May-85 23:10")

          (* * Mark the card dirty for NoteCards, if TEdit thinks the card is dirty. Necessary when a put is done outside the 
	  normal NoteCards mechanism. This function designed to be attached to the PUTFN Tedit property of NC textstreams.)


    (COND
      ((TEDIT.STREAMCHANGEDP TextStream)
	(NC.MarkCardDirty (NC.IDFromTextStream (TEXTSTREAM TextStream)))))))
)
(* * From NCTEXTCARD)

(DEFINEQ

(NC.MakeTEditCard
  (LAMBDA (ID Title NoDisplayFlg)                            (* fgh: "29-May-85 00:03")
                                                             (* Make up a blank text card and display it.)
    (PROG (TextStream Window)
          (COND
	    (NoDisplayFlg (SETQ TextStream (OPENTEXTSTREAM "" NIL NIL NIL
							   (LIST (QUOTE FONT)
								 NC.DefaultFont
								 (QUOTE TITLEMENUFN)
								 (FUNCTION NC.TEditMenuFn)
								 (QUOTE PUTFN)
								 (FUNCTION NC.TEditPutFn))))
			  (NC.SetSubstance ID TextStream)
			  (STREAMPROP TextStream (QUOTE NoteCardID)
				      ID)
			  (RETURN ID))
	    (T (SETQ Window (CREATEW (NC.DetermineDisplayRegion ID NIL)
				     (OR Title "Untitled")))
	       (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu)
			   (NC.MakeTEditLeftMenu (NC.FetchType ID)))
	       (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu)
			   (NC.MakeTEditMiddleMenu))
	       (WINDOWPROP Window (QUOTE SHRINKFN)
			   (FUNCTION NC.ShrinkFn))
	       (TEDIT NIL Window NIL (LIST (QUOTE FONT)
					   NC.DefaultFont
					   (QUOTE TITLEMENUFN)
					   (FUNCTION NC.TEditMenuFn)))
	       (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK))
	       (SETQ TextStream (WINDOWPROP Window (QUOTE TEXTSTREAM)))
	       (NC.SetSubstance ID TextStream)
	       (STREAMPROP TextStream (QUOTE NoteCardID)
			   ID)
	       (RETURN Window))))))
)
(* * From NCDATABASE)

(DEFINEQ

(NC.GetTextSubstance
  (LAMBDA (DatabaseStream ID Region)                         (* fgh: "28-May-85 23:17")
                                                             (* Get a text stream from the database file)
    (PROG (StartPtr EndPtr TextStream)
          (SETQ StartPtr (NC.GetPtr DatabaseStream))
          (SETQ EndPtr (NC.GetPtr DatabaseStream))
          (SETQ TextStream (OPENTEXTSTREAM DatabaseStream NIL StartPtr EndPtr (LIST (QUOTE FONT)
										    NC.DefaultFont)))
          (STREAMPROP TextStream (QUOTE NoteCardID)
		      ID)
          (RETURN TextStream))))
)
(PUTPROPS FGHPATCH012 COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (537 1294 (NC.IDFromTextStream 547 . 784) (NC.TEditPutFn 786 . 1292)) (1323 2913 (
NC.MakeTEditCard 1333 . 2911)) (2942 3589 (NC.GetTextSubstance 2952 . 3587)))))
STOP