(FILECREATED "27-Jun-86 10:28:22" {QV}<NOTECARDS>1.3K>KIRKPATCH010.;1 6314 changes to: (VARS KIRKPATCH010COMS CardTypeRecord)) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT KIRKPATCH010COMS) (RPAQQ KIRKPATCH010COMS ((* * fixes break when user Cancels) (FNS NC.MakeDocument))) (* * fixes break when user Cancels) (DEFINEQ (NC.MakeDocument (LAMBDA (Card Title NoDisplayFlg CardIdentifier) (* kirk: "27-Jun-86 10:16") (* * Called from a filebox's title bar. Makes a document by smashing all the descendant cards's text together. Ask user if wants numbered section headings and titles. The former are made from FileBox titles, the latter from notecard titles. Delete embedded links at the end if the user desires.) (* * rht 10/22/84: Hacked to be callable from Programmer's interface.) (* * rht 11/17/84: Checks for cancel when choosing rootID and also when setting parameters.) (* * rht 8/25/85: Now dumps sketch and graph cards as well as text cards.) (* * rht 9/16/85: Now handles cr's around titles using para leading.) (* * fgh 11/178/85 Updated to handle Card and NoteFile objects.) (* * kirk 27Jun86 Moved NC.RetrieveTitle call so does not break when user Cancels) (PROG (RootCard RootTitle DocWindow DocCard DocWindowOrCard DocStream HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks InspectWin WasActive RootType RootSubstanceType) (OR NoDisplayFlg (SPAWN.MOUSE)) (SETQ DocWindowOrCard (NC.MakeNoteCard (QUOTE Text) NoteFile "Document" NoDisplayFlg NIL Card)) (COND (NoDisplayFlg (SETQ DocWindow NIL) (SETQ DocCard DocWindowOrCard)) (T (SETQ DocWindow DocWindowOrCard) (SETQ DocCard (NC.CoerceToCard DocWindow)))) (* NC.MakeNoteCard either returned an Card or a window depending on NoDisplayFlg.) (SETQ RootCard (COND ((NC.CoerceToCard CardIdentifier)) (T (PROGN (NC.SelectNoteCards T NIL NC.SelectingCardMenu DocWindow NIL "Please select the Note Card or File Box the document should start from."))))) (COND ((NOT RootCard) (NC.DeleteNoteCards Card T) (RETURN NIL))) (SETQ RootTitle (NC.RetrieveTitle RootCard)) (NC.SetTitle DocCard (CONCAT "Document from %"" RootTitle "%"")) (AND DocWindow (WINDOWPROP DocWindow (QUOTE TITLE) (NC.RetrieveTitle DocCard))) (SETQ DocStream (NC.FetchSubstance DocCard)) (* * Get MakeDocument parameters from user via inspector window.) (COND ((NOT NoDisplayFlg) (SETQ InspectWin (NC.BuildMakeDocInspector DocWindow)) (TOTOPW InspectWin) (for while (OPENWP InspectWin) do (BLOCK)))) (COND ((EQ (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE --DONE--)) (QUOTE QUIT)) (PUTPROP (QUOTE NC.MakeDocParameters) (QUOTE --DONE--) (QUOTE --CANCEL--)) (NC.DeleteNoteCards Card T) (RETURN NIL))) (SETQ HeadingsFromFileboxes (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE HeadingsFromFileboxes))) (SETQ TitlesFromNoteCards (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE TitlesFromNoteCards))) (SETQ BuildBackLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE BuildBackLinks))) (SETQ CopyEmbeddedLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE CopyEmbeddedLinks))) (SETQ ExpandEmbeddedLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE ExpandEmbeddedLinks))) (* * Call recursive routine to dump filebox.) (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) (NC.PrintMsg DocWindow NIL "Collecting text from descendant cards ... ") (* * Clean up the SeenBefore markers placed on the cards and boxes just copied.) (RESETSAVE NIL (QUOTE (PROGN (for Card in (NC.FetchUserDataProp DocCard (QUOTE SeenCards)) do (NC.SetUserDataProp Card (QUOTE SeenBefore) NIL)) (NC.SetUserDataProp DocCard (QUOTE SeenCards) NIL)))) (* * Unbelievably kludgy hack to get around Intermezzo TEdit bug. Just insert and delete a CR.) (TEDIT.INSERT DocStream NC.CRString 1) (TEDIT.DELETE DocStream 1 1) (OR (SETQ WasActive (NC.ActiveCardP RootCard)) (NC.GetNoteCard RootCard)) (SETQ RootType (NC.RetrieveType RootCard)) (COND ((EQ RootType (QUOTE FileBox)) (NC.DumpFileBoxToDoc RootCard DocCard DocStream "" HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks)) (T (COND ((NC.TEditBasedP RootType) (NC.DumpNoteCardToDoc RootCard DocCard DocStream "" 1 HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks)) ((OR (NC.SketchBasedP RootType) (NC.GrapherBasedP RootType)) (NC.DumpGraphOrSketchCardToDoc RootCard DocCard DocStream "" 1 HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks RootType)) (NC.PrintMsg NIL NIL "Can't make document from non-text/sketch/graph card " (NC.RetrieveTitle RootCard) (CHARACTER 13))))) (OR WasActive (NC.DeactivateCard RootCard)) (NC.PrintMsg DocWindow NIL "Done!")) (COND ((NOT NoDisplayFlg) (BLOCK 250) (NC.ClearMsg DocWindow T))) (RETURN DocWindowOrCard)))) ) (PUTPROPS KIRKPATCH010 COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (385 6231 (NC.MakeDocument 395 . 6229))))) STOP