(FILECREATED " 9-Nov-84 12:20:12" {PHYLUM}<PSA>NOTECARDS>RELEASE1.1>RHTPATCH003.;8 14736 changes to: (VARS RHTPATCH003COMS) (FNS NC.GraphAddNodeFn NC.MakeGlobalLink NC.AddLinkToSketchCard NC.InsertLinkInText NC.LinkIconWhenCopiedFn NC.MakeCardTypesList) previous date: " 8-Nov-84 17:58:13" {PHYLUM}<PSA>NOTECARDS>RELEASE1.1>RHTPATCH003.;6) (* Copyright (c) 1984 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RHTPATCH003COMS) (RPAQQ RHTPATCH003COMS ((FNS NC.InspectorSelectionFn NC.TEditBasedP NC.CloseDatabaseFile NC.MakeSearchCard NC.MakeCardTypesList NC.BringUpBrowserCard) (* Fixes of functions that call NC.MakeLink) (FNS NC.GraphAddNodeFn NC.MakeGlobalLink NC.AddLinkToSketchCard NC.InsertLinkInText))) (DEFINEQ (NC.InspectorSelectionFn (LAMBDA (Property ValueFlg InspectWindow) (* rht: "25-Oct-84 15:48") (* * Actions to be taken when the user selects an item in the Inspector. If a value, then ignore. If a property, ask for a new value.) (* * KLUDGED to hadle the NC.DefaultcardType property --- should be fixed to be general!!!!!!! fgh 10/23/84) (* * rht 10/25/84: Rewritten to access the NC.NoteCardsParameters variable's prop list to get all info including the name of the relevant globalvar for this parameter and an optional function. The latter returns a list of possible values. If no such function, then just toggle between Yes and No.) (PROG (Answer ValuesFn GlobalVar) (AND ValueFlg (RETURN (INSPECTW.SELECTITEM InspectWin))) (SETQ ValuesFn (CADR (GETPROP (QUOTE NC.NoteCardsParameters) Property))) (SETQ GlobalVar (CAR (GETPROP (QUOTE NC.NoteCardsParameters) Property))) (if ValuesFn then (SETQ Answer (MENU (create MENU ITEMS ←(APPLY* ValuesFn) TITLE ← "Choose New Value"))) (if Answer then (SET GlobalVar Answer) (INSPECTW.REDISPLAY InspectWindow Property)) else (if (EVAL GlobalVar) then (SET GlobalVar NIL) else (SET GlobalVar T)) (INSPECTW.REDISPLAY InspectWindow Property)) (INSPECTW.SELECTITEM InspectWindow)))) (NC.TEditBasedP (LAMBDA (Type) (* rht: " 8-Nov-84 12:03") (* * Returns T if Type is a note card type that is based on TEdit or else an ID of such a note card. NIL otherise.) (* * rht 11/8/84: Hacked to reflect notecards typing mechanism. Seems gross to have to search the types list to get the record.) (if (NC.IDP Type) then (SETQ Type (NC.FetchType Type))) (for CardType in NC.CardTypes when (EQ Type (fetch (NoteCardType TypeName) of CardType)) do (RETURN (EQ (QUOTE TEXT) (fetch (NoteCardType SubstanceType) of CardType)))))) (NC.CloseDatabaseFile (LAMBDA NIL (* rht: " 8-Nov-84 17:44") (* Close the currently open database file.) (* * rht 10/23/84: Now gives user option of closing and saving all open cards on the screen.) (* * rht 11/8/84: Put RESETLST around NC.CacheTitles call.) (PROG (File CardTotal ID OpenWindows) (COND ((OR (NULL PSA.Database) (NOT (OPENP PSA.Database))) (NC.PrintMsg NIL T "There is no open NoteFile!!!" (CHARACTER 13))) (T (COND ((SETQ OpenWindows (for Window in (OPENWINDOWS) when (NC.ActiveCardP (OR (NC.IDFromWindow Window) (NC.IDFromWindow (WINDOWPROP Window (QUOTE ICONFOR))))) collect Window)) (NC.PrintMsg NIL T "There are cards still active on the screen." (CHARACTER 13)) (COND ((NC.YesP (NC.AskUser "Want to close and save them? " " -- " (QUOTE Yes))) (NC.PrintMsg NIL T "Closing and saving active cards ... ") (RESETLST (RESETSAVE NC.ForceSourcesFlg NIL) (RESETSAVE NC.ForceFilingFlg NIL) (for Window in OpenWindows do (COND ((WINDOWPROP Window (QUOTE ICONFOR)) (SETQ Window (EXPANDW Window)))) (NC.QuitCard (NC.IDFromWindow Window) T) (until (NULL (OPENWP Window)) do (BLOCK)))) (NC.PrintMsg NIL NIL "Done." (CHARACTER 13))) (T (RETURN NIL))))) (NC.PrintMsg NIL T "Closing Notefile ... " (CHARACTER 13)) (RESETLST (RESETSAVE NC.ForceSourcesFlg NIL) (RESETSAVE NC.ForceFilingFlg NIL) (NC.CacheTypesAndTitles PSA.Database T NIL "Closing NoteFile.")) (NC.SaveNextLinkID PSA.Database T) (SETQ File (FULLNAME PSA.Database)) (* * Set PSA.Database GlobalVar to NIL so that the advise to CLOSEF will not refuse to close this file.) (NC.ForceDatabaseClose PSA.Database) (replace (MENU TITLE) of NC.MainMenu with "No Open NoteFile") (replace (MENU IMAGE) of NC.MainMenu with NIL) (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE CLOSEFN) NIL) (NC.DisplayMainMenu) (SETQ PSA.Database) (NC.PrintMsg NIL T File " closed.")))))) (NC.MakeSearchCard (LAMBDA (ListCardID Title NoDisplayFlg) (* rht: " 8-Nov-84 15:07") (* Search for cards with specified characteristics and create a list card containing pointers to these cards. For now search is limited to cards whose title contains a specified string.) (* * rht 11/8/84: Fixed some confusion between ListCardID and ID variables.) (PROG (SearchString IDs WindowOrID Window) (SPAWN.MOUSE) (SETQ WindowOrID (NC.MakeTEditCard ListCardID (OR Title "SearchCard") NoDisplayFlg)) (NC.ActivateCard ListCardID) (SETQ Window (AND (WINDOWP WindowOrID) WindowOrID)) (SETQ SearchString (NC.AskUser "Please enter the search string" " -- " NIL T Window)) (COND ((OR (EQUAL SearchString "") (NOT SearchString)) (RETURN WindowOrID))) (NC.SetTitle ListCardID (SETQ Title (OR Title (CONCAT "Cards with %"" SearchString "%" in title")))) (AND Window (WINDOWPROP Window (QUOTE TITLE) Title)) (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) (NC.PrintMsg Window T "Searching for cards ...") (SETQ IDs (bind Title ID for ID# from 1 to (SUB1 (SUBATOM (NC.GetNewID PSA.Database T) 4)) when (AND (SETQ Title (NC.FetchTitle (SETQ ID (NC.IDFromNumber ID#)))) (STRPOS SearchString Title)) collect ID)) (TEDIT.INSERT (NC.FetchSubstance ListCardID) (CONCAT " List compiled on: " (DATE) (CHARACTER 13)) 1) (for ID in IDs unless (EQ ListCardID ID) do (NC.InsertLinkBeforeMarker ListCardID ID NC.ListContentsLinkLabel (QUOTE Title) NIL PSA.Database)) (NC.PrintMsg Window NIL "Done!" (CHARACTER 13))) (BLOCK 250) (NC.ClearMsg Window T) (RETURN WindowOrID)))) (NC.MakeCardTypesList (LAMBDA NIL (* rht: " 9-Nov-84 10:40") (* * Make initial set of card types.) (SETQ NC.CardTypes (LIST (create NoteCardType TypeName ←(QUOTE NoteCard) SuperType ← NIL SubstanceType ← NIL MakeCardFn ← NIL EditCardFn ← NIL QuitCardFn ← NIL GetCardFn ← NIL PutCardFn ← NIL CopyCardFn ← NIL MarkCardDirtyFn ← NIL CardDirtyPFn ← NIL CollectLinksInCardFn ← NIL DeleteLinksInCardFn ← NIL UpdateLinkIconsInCardFn ← NIL LinkDisplayMode ←(QUOTE Icon)))) (NC.AddCardType (QUOTE Text) (QUOTE NoteCard) (QUOTE TEXT) (FUNCTION NC.MakeTEditCard) NIL (FUNCTION NC.TEditCloseFn) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)) (NC.AddCardType (QUOTE Graph) (QUOTE NoteCard) (QUOTE GRAPH) (FUNCTION NC.MakeGraphCard) NIL (FUNCTION NC.GraphCardCloseFn) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)) (NC.AddCardType (QUOTE Sketch) (QUOTE NoteCard) (QUOTE SKETCH) (FUNCTION NC.MakeSketchCard) NIL (FUNCTION NC.SketchCardCloseFn) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)) (NC.AddCardType (QUOTE FileBox) (QUOTE Text) (QUOTE TEXT) (FUNCTION NC.MakeContentsCard) NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)) (NC.AddCardType (QUOTE Browser) (QUOTE Graph) (QUOTE GRAPH) (FUNCTION NC.MakeBrowserCard) (FUNCTION NC.BringUpBrowserCard) NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)) (NC.AddCardType (QUOTE Search) (QUOTE Text) (QUOTE TEXT) (FUNCTION NC.MakeSearchCard) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)) (NC.AddCardType (QUOTE LinkIndex) (QUOTE Text) (QUOTE TEXT) (FUNCTION NC.MakeLinkIndex) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)) (NC.AddCardType (QUOTE Document) (QUOTE Text) (QUOTE TEXT) (FUNCTION NC.MakeDocument) NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)) (SETQ NC.NoteCardTypeMenu))) (NC.BringUpBrowserCard (LAMBDA (ID Substance Region/Position) (* rht: "15-Oct-84 00:42") (* * Given a browser Substance, open a browser window and set it up to be a NoteCard with ID.) (PROG (Window) (SETQ Window (NC.BringUpGraphCard ID Substance Region/Position)) (if (NOT (for AttachedWin in (ATTACHEDWINDOWS Window) thereis (WINDOWPROP AttachedWin (QUOTE NCLABELPAIRS)))) then (NC.MakeLinksLegendMenu Window (LISTGET (NC.RetrievePropList ID) (QUOTE BrowserLinksLegend))))))) ) (* Fixes of functions that call NC.MakeLink) (DEFINEQ (NC.GraphAddNodeFn (LAMBDA (Graph Window) (* rht: " 9-Nov-84 12:00") (* * Add a node, normal or link, to a graph) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG (LinkLabel Link) (RETURN (COND ((NULL (WINDOWPROP Window (QUOTE NoteCardInsertingLink) NIL)) (DEFAULT.ADDNODEFN Graph Window)) ((AND (SETQ LinkLabel (NC.AskLinkLabel Window NIL NIL T T)) (SETQ Link (NC.MakeLink Window LinkLabel))) (NODECREATE (FASSOC (SETQ NodeID (GENSYM) (fetch (GRAPH GRAPHNODES) of Graph))) (NC.MakeLinkIcon Link) (CURSORPOSITION NIL Window)))))))) (NC.MakeGlobalLink (LAMBDA (Window LinkLabel DestinationID SourceID DisplayMode) (* rht: " 9-Nov-84 11:59") (* * Make a new global link from DestinationID to SourceID with label LinkLabel and display mode DisplayMode. Window is optional if SourceID is specified, otherwise it is required.) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG ((Link (NC.MakeLink Window LinkLabel DestinationID SourceID DisplayMode (QUOTE GlobalGlobal) ))) (AND Link (NC.SetGlobalLinks SourceID (CONS Link (NC.FetchGlobalLinks SourceID)))) (RETURN Link)))) (NC.AddLinkToSketchCard (LAMBDA (SketchWindow) (* rht: " 9-Nov-84 12:02") (* Called from a SKETCH window to add a new NoteCard Link Icon to the sketch) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG ((Label (NC.AskLinkLabel SketchWindow NIL NIL T T)) Link) (RETURN (AND Label (SETQ Link (NC.MakeLink SketchWindow Label NIL NIL (QUOTE Icon))) (NC.InsertLinkInSketch Link SketchWindow)))))) (NC.InsertLinkInText (LAMBDA (TextStream LinkLabel DestinationID SourceID DisplayMode) (* rht: " 9-Nov-84 12:04") (* * Add a link image object (and hence a link) to the text specified by TextStream. Link has LinkLabel, goes to DestinationID and has DisplayMode. Returns the Link inserted.) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG ((Window (WINDOW.FROM.TEDIT.THING TextStream)) (TextObject (TEXTOBJ TextStream)) Selection Link) (RETURN (COND ((fetch (SELECTION SET) of (SETQ Selection (fetch (TEXTOBJ SEL) of TextObject))) (AND (SETQ Link (NC.MakeLink Window LinkLabel DestinationID SourceID DisplayMode)) (TEDIT.INSERT.OBJECT (NC.MakeLinkIcon Link) (TEXTSTREAM TextObject) (SELECTQ (fetch (SELECTION POINT) of Selection) (LEFT (fetch (SELECTION CH#) of Selection)) (RIGHT (IMIN (ADD1 (fetch (TEXTOBJ TEXTLEN) of TextObject)) (ADD1 (fetch (SELECTION CHLIM) of Selection)))) NIL))) Link) (T (NC.ReportError "NC.InseretLinkInText" "No selection set when inserting link image object.") NIL)))))) ) (PUTPROPS RHTPATCH003 COPYRIGHT ("Xerox Corporation" 1984)) (DECLARE: DONTCOPY (FILEMAP (NIL (786 10976 (NC.InspectorSelectionFn 796 . 2374) (NC.TEditBasedP 2376 . 3100) ( NC.CloseDatabaseFile 3102 . 5706) (NC.MakeSearchCard 5708 . 7877) (NC.MakeCardTypesList 7879 . 10314) (NC.BringUpBrowserCard 10316 . 10974)) (11030 14654 (NC.GraphAddNodeFn 11040 . 11841) ( NC.MakeGlobalLink 11843 . 12586) (NC.AddLinkToSketchCard 12588 . 13213) (NC.InsertLinkInText 13215 . 14652))))) STOP