(FILECREATED " 7-Jun-86 02:59:41" {QV}<NOTECARDS>1.3K>FGHPATCH064.;2 10507  

      changes to:  (VARS FGHPATCH064COMS)
		   (FNS NC.GetPromptWindow NC.MakeFileBox NC.EditFileBox)

      previous date: " 7-Jun-86 02:58:21" {QV}<NOTECARDS>1.3K>FGHPATCH064.;1)


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

(PRETTYCOMPRINT FGHPATCH064COMS)

(RPAQQ FGHPATCH064COMS ((* * Fixes to Bugs %# 93 and 95 and some other assorted stuff.)
			  (FNS NC.GetPromptWindow NC.AddFileBoxCard NC.MakeTEditPropsList 
			       NC.MakeTEditCard NC.BringUpTEditCard NC.MakeFileBox)
			  (* * New FN for NCFILEBOXCARD)
			  (FNS NC.EditFileBox)))
(* * Fixes to Bugs %# 93 and 95 and some other assorted stuff.)

(DEFINEQ

(NC.GetPromptWindow
  (LAMBDA (MainWin)                                          (* fgh: " 7-Jun-86 02:49")

          (* * This gets a prompt window without affecting the open/close status of MainWin. If MainWin is open, then just 
	  GETPROMPTWINDOW. Otherwise, move off screen, do GETPROMPTWINDOW, close the new promptwindow, and move MainWin back 
	  to old loc.)



          (* * Fgh 6/7/86 Added RESETLST for moving window.)


    (if (OPENWP MainWin)
	then (GETPROMPTWINDOW MainWin 5)
      else (RESETLST (RESETSAVE (MOVEW MainWin NC.OffScreenPosition)
				      (BQUOTE (MOVEW , MainWin , (WINDOWPOSITION MainWin))))
			 (LET ((PromptWin (GETPROMPTWINDOW MainWin 5)))
			      (CLOSEW PromptWin)
			  PromptWin)))))

(NC.AddFileBoxCard
  (LAMBDA NIL                                                (* fgh: " 7-Jun-86 02:36")

          (* * fgh 2/17/86 Added attached bitmap field.)


    (NC.AddCardType (QUOTE FileBox)
		      (QUOTE Text)
		      (BQUOTE ((MakeFn , (FUNCTION NC.MakeFileBox))
				 (EditFn , (FUNCTION NC.EditFileBox))))
		      (BQUOTE ((LinkDisplayMode Title)
				 (DefaultHeight 200)
				 (DefaultWidth 335)
				 (DisplayedInMenuFlg , T)
				 (LinkIconAttachedBitMap , NC.FileBoxIcon)
				 (LeftButtonMenuItems
				   ,
				   (for Item in (NC.GetCardTypeField LeftButtonMenuItems
									 (QUOTE Text))
				      join (if (EQ (CAR Item)
							 (QUOTE Insert% Link))
						 then (LIST NC.GlobalInsertLinkMenuItem
								(QUOTE
								  (Put% Cards% Here
								    (FUNCTION 
								      NC.FileBoxCollectChildren)
								    
					    "Collect new cards and file boxes into this FileBox.")))
					       else (LIST Item)))))))))

(NC.MakeTEditPropsList
  (LAMBDA (TEditWindow Don'tIncludeExtraProps)               (* fgh: " 7-Jun-86 02:19")

          (* * Create the props list to hand to all TEdit and OPENTEXTSTREAM calls)



          (* * rht 9/10/85: Now takes a TEditWindow arg so can compute a prompt window.)



          (* * 5/1/86: Now appends NC-specific props in front of TEdit props specified as global param by user.)


    (APPEND (LIST (QUOTE FONT)
		      NC.DefaultFont
		      (QUOTE TITLEMENUFN)
		      (FUNCTION NC.TEditMenuFn)
		      (QUOTE PUTFN)
		      (FUNCTION NC.TEditPutFn)
		      (QUOTE GETFN)
		      (FUNCTION NC.TEditGetFn)
		      (QUOTE QUITFN)
		      (LIST (FUNCTION NC.TEditPropsListQuitFn)
			      (FUNCTION (LAMBDA NIL
				  (QUOTE DON'T))))
		      (QUOTE PROMPTWINDOW)
		      (AND TEditWindow (NC.GetPromptWindow TEditWindow)))
	      (if Don'tIncludeExtraProps
		  then NIL
		else NC.UserSpecifiedTEditProps))))

(NC.MakeTEditCard
  (LAMBDA (Card Title NoDisplayFlg)                          (* rht: " 6-May-86 12:21")
                                                             (* Make up a blank text card and display it.)

          (* * rht 9/10/85: Fixed call to NC.MakeTEditPropsList so prompt window gets fixed up before card is brought up.)



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



          (* * rht 4/11/86: Now passes type to NC.MakeTEditMiddleMenu.)



          (* * rht 5/6/86: Now calls NC.InstallTitleBarLeftMenu and NC.InstallTextTitleBarMiddleMenu.)


    (LET (TextStream Window Type)
         (COND
	   (NoDisplayFlg (SETQ TextStream (OPENTEXTSTREAM "" NIL NIL NIL (NC.MakeTEditPropsList)
							      ))
			 (NC.SetSubstance Card TextStream)
			 (STREAMPROP TextStream (QUOTE NoteCardObject)
				       Card)
			 Card)
	   (T (SETQ Window (CREATEW (NC.DetermineDisplayRegion Card NIL)
					(OR Title "Untitled")
					NIL T))
	      (SETQ Type (NC.RetrieveType Card))
	      (WINDOWPROP Window (QUOTE NoteCardObject)
			    Card)
	      (NC.InstallTitleBarLeftMenu Window Type)
	      (NC.InstallTextTitleBarMiddleMenu Window Type)
	      (WINDOWADDPROP Window (QUOTE SHRINKFN)
			       (FUNCTION NC.TextCardShrinkFn))
	      (TEDIT NIL Window NIL (NC.MakeTEditPropsList Window))
	      (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK))
	      (SETQ TextStream (WINDOWPROP Window (QUOTE TEXTSTREAM)))
	      (NC.SetSubstance Card TextStream)
	      (STREAMPROP TextStream (QUOTE NoteCardObject)
			    Card)
	      Window)))))

(NC.BringUpTEditCard
  (LAMBDA (Card TextStream Region/Position Don'tIncludeExtraTEditProps)
                                                             (* fgh: " 7-Jun-86 02:37")
                                                             (* Bring up a TEdit window for Card ID whose text 
							     stream is TextStream in Region specified by 
							     Region/Position or by the user.)

          (* * rht 9/10/85: Fixed call to NC.MakeTEditPropsList so prompt window gets fixed up before card is brought up.)



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



          (* * kirk 2Dec85 Removed illegal RETURN)



          (* * rht 4/11/86: Added Type arg to call to NC.MakeTEditMiddleMenu and changed names of menu windowprops.)



          (* * rht 5/5/86: Now calls NC.InstallTitleBarLeftMenu and NC.InstallTextTitleBarMiddleMenu.)



          (* * fgh 6/7/86 Added Don'tIncludeExtraTEditProps argument.)


    (LET (Region TEditWindow TEditProcess Title TextStreamDirtyFlg Type)
         (COND
	   ((AND (SETQ TEditWindow (WINDOW.FROM.TEDIT.THING TextStream))
		   (SETQ TEditProcess (WINDOWPROP TEditWindow (QUOTE PROCESS))))
	     (TOTOPW TEditWindow)
	     (RPTQ 2 (FLASHW TEditWindow))
	     (TTY.PROCESS TEditProcess)
	     TEditWindow)
	   (T (SETQ Region (NC.DetermineDisplayRegion Card Region/Position))
	      (SETQ Title (NC.RetrieveTitle Card))
	      (SETQ Type (NC.RetrieveType Card))
	      (SETQ TEditWindow (CREATEW Region Title NIL T))
	      (WINDOWADDPROP TEditWindow (QUOTE SHRINKFN)
			       (FUNCTION NC.TextCardShrinkFn))
	      (NC.InstallTitleBarLeftMenu TEditWindow Type)
	      (NC.InstallTextTitleBarMiddleMenu TEditWindow Type)
	      (SETQ TextStreamDirtyFlg (NC.CardDirtyP Card))
	      (TEDIT TextStream TEditWindow NIL (NC.MakeTEditPropsList TEditWindow 
								      Don'tIncludeExtraTEditProps))
	      (AND TextStreamDirtyFlg (NC.MarkCardDirty Card))))
     TEditWindow)))

(NC.MakeFileBox
  (LAMBDA (Card Title DontDisplay)                           (* fgh: " 7-Jun-86 02:55")
                                                             (* Make up a blank contents card, hook it to the user 
							     specified parent contents cards, and display it.)

          (* * rht 12/2/84: In DontDisplay case, changed to return ID rather than TextStream.)



          (* * rht 12/8/84: Massive shaving. Took out code to force filing now (at creation time))



          (* * rht 9/11/85: Took out insertion of spacer when no markers.)



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



          (* * fgh 2/6/86 Chaged calls to NC.FetchDefaultHeight & NC.FetchDefaultWidth)



          (* * fgh 2/6/86 Removed bug where NC.ClearMsg was deleteing card immediately.)



          (* * rht 4/11/86: Now passes Type and Window to NC.MakeTEditLeftMenu.)



          (* * fgh 6/7/86 removed spurious call to GETPROMPTWINDOW. And added DONTCREATE to CREATEW call.)


    (LET ((Spacer (CONCAT (CHARACTER 13)
			    (CHARACTER 13)))
	  Window TextStream Type)
         (SETQ TextStream (OPENTEXTSTREAM "" NIL NIL NIL (NC.MakeTEditPropsList Window T)))
         (COND
	   (NC.MarkersInFileBoxesFlg (TEDIT.INSERT.OBJECT (NC.MakePlaceMarker 
									     NC.SubBoxMarkerLabel)
							    TextStream 1)
				     (TEDIT.INSERT TextStream Spacer 2)
				     (TEDIT.INSERT.OBJECT (NC.MakePlaceMarker 
									  NC.FiledCardMarkerLabel)
							    TextStream 4)
				     (TEDIT.INSERT TextStream Spacer 5)))
         (NC.SetSubstance Card TextStream)
         (NC.SetRegion Card (CREATEREGION 0 0 (NC.FetchDefaultWidth Card)
					      (NC.FetchDefaultHeight Card)))
         (COND
	   (DontDisplay Card)
	   (T (SETQ Window (CREATEW (NC.DetermineDisplayRegion Card NIL)
					(NC.SetTitle Card (OR Title "Untitled"))
					NIL T))
	      (SETQ Type (NC.RetrieveType Card))
	      (NC.InstallTextTitleBarMiddleMenu Window Type)
	      (NC.InstallTitleBarLeftMenu Window Type)     (* Display the card)
	      (WINDOWADDPROP Window (QUOTE SHRINKFN)
			       (FUNCTION NC.TextCardShrinkFn))
	      (TEDIT TextStream Window NIL (NC.MakeTEditPropsList Window T))
	      (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK))
	      (NC.ActivateCard Card)
	      (COND
		(NC.AlphabetizedFileBoxChildrenFlg (NCP.CardProp Card (QUOTE OrderingFn)
								   (FUNCTION NC.IDAlphOrder))))
	      Window)))))
)
(* * New FN for NCFILEBOXCARD)

(DEFINEQ

(NC.EditFileBox
  (LAMBDA (Card TextStream Region/Position)                  (* fgh: " 7-Jun-86 02:35")

          (* * Edit a file box. Just call super editfn with proper TEdit props props flg)


    (NC.ApplySupersFn EditFn Card TextStream Region/Position T)))
)
(PUTPROPS FGHPATCH064 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (727 10101 (NC.GetPromptWindow 737 . 1538) (NC.AddFileBoxCard 1540 . 2577) (
NC.MakeTEditPropsList 2579 . 3610) (NC.MakeTEditCard 3612 . 5340) (NC.BringUpTEditCard 5342 . 7449) (
NC.MakeFileBox 7451 . 10099)) (10139 10425 (NC.EditFileBox 10149 . 10423)))))
STOP