(DEFINE-FILE-INFO PACKAGE "IL" READTABLE "INTERLISP" BASE 10) (FILECREATED "29-Feb-88 17:35:27" {QV}<NOTECARDS>1.3LNEXT>DWMPATCH001.;5 21211 changes to%: (VARS DWMPATCH001COMS) (FNS NC.AddGraphCard NC.BringUpGraphCard NC.SaveOrRevertGraphCard) previous date%: "28-Jan-88 08:11:38" {QV}<NOTECARDS>1.3LNEXT>DWMPATCH001.;1) (* " Copyright (c) 1987, 1988 by Xerox Corporation. All rights reserved. ") (PRETTYCOMPRINT DWMPATCH001COMS) (RPAQQ DWMPATCH001COMS ( (* ;; "dwm 01/06/88 changes for read only graph cards") (P (NC.LoadFileFromDirectories 'NCGRAPHCARD)) (* ;; "rg 2/25/88 Lyricized and integrated with other patch files") (* ;; "changes to NCGRAPHCARD") (FNS NC.AddGraphCard NC.BringUpGraphCard NC.MakeGraphCard) (* ;; "new for NCGRAPHCARD") (FNS NC.MakeGraphCardReadOnly NC.MakeGraphCardReadWrite NC.SaveOrRevertGraphCard) (* ;; "don't integrate the following") [P (NC.RecomputeCardType 'Graph `((MakeReadOnlyFn ,(FUNCTION NC.MakeGraphCardReadOnly)) (MakeReadWriteFn ,(FUNCTION NC.MakeGraphCardReadWrite] (* ;; "new for NCINTERFACE") (FNS NC.CardReadOnlyOpenP NC.MakeMenusReadOnly NC.MakeMenusReadWrite) (PROP (FILETYPE MAKEFILE-ENVIRONMENT) DWMPATCH001))) (* ;; "dwm 01/06/88 changes for read only graph cards") (NC.LoadFileFromDirectories 'NCGRAPHCARD) (* ;; "rg 2/25/88 Lyricized and integrated with other patch files") (* ;; "changes to NCGRAPHCARD") (DEFINEQ (NC.AddGraphCard [LAMBDA NIL (* ; "Edited 25-Feb-88 11:37 by Randy.Gobbel") (* ;;; "fgh 11/14/85: Updated to conform to merge of substance and card types.") (* ;;; "fgh 2/17/86 Added attached bitmap field.") (* ;;; "rht 4/7/86: Added middle button menu items.") (* ;;; "pmi 5/26/87: Changed default card size as requested by Cathy Marshall.") (* ;;; "dwm 1/6/88: Added ReadOnly/ReadWrite FUNCTIONS") (NC.AddCardType 'Graph 'NoteCard `[(MakeFn ,(FUNCTION NC.MakeGraphCard)) (EditFn ,(FUNCTION NC.BringUpGraphCard)) (QuitFn ,(FUNCTION NC.GraphCardCloseFn)) (MakeReadOnlyFn ,(FUNCTION NC.MakeGraphCardReadOnly)) (MakeReadWriteFn ,(FUNCTION NC.MakeGraphCardReadWrite)) (GetFn ,(FUNCTION NC.GetGraphSubstance)) (PutFn ,(FUNCTION NC.PutGraphSubstance)) (CopyFn ,(FUNCTION NC.GraphCopySubstance)) (MarkDirtyFn ,(FUNCTION NC.MarkGraphDirty)) (DirtyPFn ,(FUNCTION NC.GraphDirtyP)) (CollectLinksFn ,(FUNCTION NC.CollectReferencesInGraph)) (DeleteLinksFn ,(FUNCTION NC.DelReferencesToCardFromGraph)) (UpdateLinkIconsFn ,(FUNCTION NC.UpdateLinkImagesInGraph)) (InsertLinkFn ,(FUNCTION NC.InsertLinkInGraph)) (TranslateWindowPositionFn ,(FUNCTION NC.TranslateWindowPositionToGraphPosition ] `((LinkDisplayMode Title) (DisplayedInMenuFlg ,T) (DefaultWidth 500) (DefaultHeight 330) (LinkAnchorModesSupported T) (LinkIconAttachedBitMap ,NC.GraphCardIcon) (MiddleButtonMenuItems ,'((Relayout% Graph (FUNCTION NC.RelayoutGraphCard) "Re-layout the graph, but keep same nodes."]) (NC.BringUpGraphCard [LAMBDA (Card Substance RegionOrPosition) (* ; "Edited 25-Feb-88 13:52 by Randy.Gobbel") (* ;;; "Given a graph (or browser) Substance, open a grapher (browser) window and set it up to be a NoteCard with ID.") (* ;; "fgh 11/14/85 Updated to handle Card object.") (* ;; "rht 5/5/86: Now calls NC.InstallTitleBarButtonEventFn, NC.InstallTitleBarLeftMenu, and NC.InstallTitleBarMiddleMenu instead of NC.SetupTitleBarMenu.") (* ;; "fgh 6/30/86 Added NC.GRAPHERCOPYBUTTONEVENTFN to SHOWGRAPH call") (* ;; "rht 11/16/86: Now moves window to RegionOrPosition if already up.") (* ;; "dwm 1/15/88 added ReadOnliness") (* ;; "pmi 2/18/88: Removed one of the two FLASHWs. Fixed up check for same position to be a little more efficient.") (LET (Region Title GraphWindow IconWindow CardType) (COND ((SETQ GraphWindow (NC.FetchWindow Card)) (AND (WINDOWP (WINDOWPROP GraphWindow 'ICONFOR)) (SETQ GraphWindow (EXPANDW GraphWindow))) (TOTOPW GraphWindow) [if RegionOrPosition then (if (REGIONP RegionOrPosition) then (if [NOT (EQUAL RegionOrPosition (WINDOWPROP GraphWindow 'REGION] then (SHAPEW GraphWindow (NC.DetermineDisplayRegion Card RegionOrPosition))) elseif (POSITIONP RegionOrPosition) then (SETQ WindowRegion (WINDOWPROP GraphWindow 'REGION)) (if [NOT (AND (EQUAL (fetch (POSITION XCOORD) of RegionOrPosition) (fetch (REGION LEFT) of WindowRegion)) (EQUAL (fetch (POSITION YCOORD) of RegionOrPosition) (fetch (REGION BOTTOM) of WindowRegion] then (SHAPEW GraphWindow (NC.DetermineDisplayRegion Card RegionOrPosition] (FLASHW GraphWindow)) (T (NC.SetUserDataProp Card 'ReadOnly (NC.CardReadOnlyOpenP Card)) (SETQ GraphWindow (SHOWGRAPH Substance (CREATEW (NC.DetermineDisplayRegion Card RegionOrPosition) (NC.RetrieveTitle Card)) (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) NIL T (FUNCTION NC.GRAPHERCOPYBUTTONEVENTFN))) (SETQ CardType (NC.RetrieveType Card)) (WINDOWADDPROP GraphWindow 'SHRINKFN (FUNCTION NC.GraphCardShrinkFn)) (NC.InstallTitleBarButtonEventFn GraphWindow (FUNCTION NC.TitleBarButtonEventFn)) (NC.InstallTitleBarLeftMenu GraphWindow CardType) (NC.InstallTitleBarMiddleMenu GraphWindow CardType))) GraphWindow]) (NC.MakeGraphCard [LAMBDA (Card Title NoDisplayFlg) (* ; "Edited 15-Jan-88 16:16 by MacDonald") (* * Creates a StructEdit card. Alot like a graph card except that it allows editing of underlying NC structure, and doesn't allow an "insertlink" operation in title bar menu.) (* * fgh |11/14/85| Updated to handle Card object.) (* * rht 5/5/86%: Replaced call to NC.SetupTitleBarMenu with Install calls.) (* * fgh |6/30/86| Added NC.GRAPHERCOPYBUTTONEVENTFN to SHOWGRAPH call) (* * rht 9/19/86%: Mod to above fix. Now calls NC.MakeNewCardWindow a new fn that creates window and hangs Card off windowprop.) (* * pmi 6/23/87%: Added the GRAPH.CHANGELABELFN NC.GraphChangeLabelFn to the Graph being created, which will then mark the substance dirty when a label is changed.) (LET (Window Graph CardType) (NC.SetUserDataProp Card 'ReadOnly (NC.CardReadOnlyOpenP Card)) (SETQ Graph (create GRAPH GRAPH.ADDNODEFN ← (FUNCTION NC.GraphAddNodeFn) GRAPH.DELETENODEFN ← (FUNCTION NC.GraphDeleteNodeFn) GRAPH.ADDLINKFN ← (FUNCTION NC.GraphAddLinkFn) GRAPH.DELETELINKFN ← (FUNCTION NC.GraphDeleteLinkFn) GRAPH.MOVENODEFN ← (FUNCTION NC.GraphMoveNodeFn) GRAPH.FONTCHANGEFN ← (FUNCTION NC.GraphFontChangeFn) GRAPH.CHANGELABELFN ← (FUNCTION NC.GraphChangeLabelFn))) (NC.SetSubstance Card Graph) (COND ((NOT NoDisplayFlg) (SETQ Window (NC.MakeNewCardWindow Card (OR Title "Untitled"))) (SETQ CardType (NC.RetrieveType Card)) (SHOWGRAPH Graph Window (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) T NC.GraphCardAllowEditFlg (FUNCTION NC.GRAPHERCOPYBUTTONEVENTFN)) (WINDOWADDPROP Window 'SHRINKFN (FUNCTION NC.GraphCardShrinkFn)) (NC.InstallTitleBarButtonEventFn Window (FUNCTION NC.TitleBarButtonEventFn)) (NC.InstallTitleBarLeftMenu Window CardType) (NC.InstallTitleBarMiddleMenu Window CardType))) (OR Window Card]) ) (* ;; "new for NCGRAPHCARD") (DEFINEQ (NC.MakeGraphCardReadOnly [LAMBDA (Card) (* ; "Edited 28-Jan-88 07:50 by MacDonald") (* * Make a GraphCard Read-Only.) (DECLARE (GLOBALVARS NC.ShowPropListMenu)) (LET ((Window (NC.FetchWindow Card)) PropListEditor) (NC.ProtectedCardOperation Card "Make Read-Only" Window (if (NC.CardSomehowDirtyP Card) then (NC.SaveOrRevertGraphCard Card Window)) (NC.SetUserDataProp Card 'ReadOnly T) (if (WINDOWP (SETQ PropListEditor (NC.PropListEditorOpenP Window))) then (NC.MakeTEditReadOnly PropListEditor) (WINDOWPROP PropListEditor 'TEDIT.MENU NC.ShowPropListMenu)) (WINDOWPROP Window 'RIGHTBUTTONFN NIL) (NC.MakeMenusReadOnly Window '(Show% Links Show% Info Designate% FileBoxes |Close and Save| Relayout% Graph |Edit Property List|) '(Indicate% NoteFile |Close w/o Saving| |Close and Save| |Save in NoteFile|]) (NC.MakeGraphCardReadWrite [LAMBDA (Card) (* ; "Edited 28-Jan-88 07:53 by MacDonald") (* * Make a GraphCard Read-Write) (DECLARE (GLOBALVARS NC.EditPropListMenu)) (LET ((Window (NC.FetchWindow Card)) PropListEditor) (NC.ProtectedCardOperation Card "Make Read-Write" Window (if (WINDOWP (SETQ PropListEditor ( NC.PropListEditorOpenP Window))) then (NC.MakeTEditReadWrite PropListEditor) (WINDOWPROP PropListEditor 'TEDIT.MENU NC.EditPropListMenu )) (WINDOWPROP Window 'RIGHTBUTTONFN (FUNCTION GRAPHEDITEVENTFN)) (NC.MakeMenusReadWrite Window) (NC.SetUserDataProp Card 'ReadOnly NIL]) (NC.SaveOrRevertGraphCard [LAMBDA (Card Window) (* ; "Edited 27-Jan-88 08:04 by MacDonald") (ALLOW.BUTTON.EVENTS) (if (MENU (create MENU TITLE ← "Card has been edited" ITEMS ← '(("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.GetNoteCard Card) (SHOWGRAPH (NC.FetchSubstance Card) Window (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) NIL T (FUNCTION NC.GRAPHERCOPYBUTTONEVENTFN)) (NC.MarkCardDirty Card T]) ) (* ;; "don't integrate the following") [NC.RecomputeCardType 'Graph `((MakeReadOnlyFn ,(FUNCTION NC.MakeGraphCardReadOnly)) (MakeReadWriteFn ,(FUNCTION NC.MakeGraphCardReadWrite] (* ;; "new for NCINTERFACE") (DEFINEQ (NC.CardReadOnlyOpenP [LAMBDA (Card) (* ; "Edited 15-Jan-88 16:24 by MacDonald") (OR (NC.ReadOnlyNoteFileP (fetch (Card NoteFile) of Card]) (NC.MakeMenusReadOnly [LAMBDA (Window AddSafeItems AddSafeSubItems) (* ; "Edited 27-Jan-88 16:20 by MacDonald") (LET* ((TitleBarReadOnlyLeftMenu (WINDOWPROP Window 'TITLEBARREADONLYLEFTMENU)) (TitleBarReadOnlyMiddleMenu (WINDOWPROP Window 'TITLEBARREADONLYMIDDLEMENU)) (SafeItems AddSafeItems) (SafeSubItems AddSafeSubItems) NewItems SubItems NewSubItems) (* ;; "If Window doesn't have RO AND RW Menus then create them. The RW Menus are just the menus present on Open; the RO Menus are modifications of these.") [if (NOT (OR TitleBarReadOnlyLeftMenu TitleBarReadOnlyMiddleMenu)) then [WINDOWPROP Window 'TITLEBARREADWRITELEFTMENU (NC.CopyMenu (WINDOWPROP Window ' TitleBarLeftButtonMenu] [WINDOWPROP Window 'TITLEBARREADWRITEMIDDLEMENU (NC.CopyMenu (WINDOWPROP Window ' TitleBarMiddleButtonMenu ] (SETQ TitleBarReadOnlyLeftMenu (WINDOWPROP Window 'TitleBarLeftButtonMenu)) (SETQ TitleBarReadOnlyMiddleMenu (WINDOWPROP Window 'TitleBarMiddleButtonMenu)) (for Menu in (LIST TitleBarReadOnlyLeftMenu TitleBarReadOnlyMiddleMenu) do (if Menu then (SETQ NewItems (for Item in (fetch (MENU ITEMS) of Menu) bind ItemName collect (SETQ ItemName (if (LISTP Item) then (CAR Item) else Item)) (if (NOT (MEMB ItemName SafeItems)) then [SETQ Item (LIST ItemName '(FUNCTION NC.PrintReadOnlyMsg) (if (LISTP Item) then (CADDR Item] else (SETQ SubItems (APPLY* (OR (fetch SUBITEMFN of Menu) (FUNCTION DEFAULTSUBITEMFN)) Menu Item)) (if SubItems then (SETQ NewSubItems (for SubItem in SubItems collect (SETQ ItemName (if (LISTP SubItem) then (CAR SubItem) else SubItem)) [if (NOT (MEMB ItemName SafeSubItems)) then (SETQ SubItem (LIST ItemName '(FUNCTION NC.PrintReadOnlyMsg) (if (LISTP SubItem) then (CADDR SubItem] SubItem)) (RPLACD (CAR (NTH Item 4)) NewSubItems))) Item)) (replace (MENU ITEMS) of Menu with NewItems) [for Item in (fetch (MENU ITEMS) of Menu) do (if (NOT (MEMB (if (LISTP Item) then (CAR Item) else Item) SafeItems)) then (SHADEITEM Item Menu GRAYSHADE) else (SETQ SubItems (APPLY* (OR (fetch SUBITEMFN of Menu) (FUNCTION DEFAULTSUBITEMFN)) Menu Item)) (if SubItems then (for SubItem in SubItems do (if (NOT (MEMB (if (LISTP SubItem) then (CAR SubItem) else SubItem) SafeSubItems)) then (SHADEITEM SubItem Menu GRAYSHADE] (replace (MENU IMAGE) of Menu with NIL] (WINDOWPROP Window 'TitleBarLeftButtonMenu TitleBarReadOnlyLeftMenu) (WINDOWPROP Window 'TitleBarMiddleButtonMenu TitleBarReadOnlyMiddleMenu) (WINDOWPROP Window 'TITLEBARREADONLYLEFTMENU TitleBarReadOnlyLeftMenu) (WINDOWPROP Window 'TITLEBARREADONLYMIDDLEMENU TitleBarReadOnlyMiddleMenu]) (NC.MakeMenusReadWrite [LAMBDA (Window) (* ; "Edited 28-Jan-88 07:40 by MacDonald") (LET* [(TitleBarReadOnlyMiddleMenu (WINDOWPROP Window 'TITLEBARREADONLYMIDDLEMENU)) (TitleBarReadOnlyLeftMenu (WINDOWPROP Window 'TITLEBARREADONLYLEFTMENU)) (TitleBarReadWriteLeftMenu (WINDOWPROP Window 'TITLEBARREADWRITELEFTMENU)) (TitleBarReadWriteMiddleMenu (WINDOWPROP Window 'TITLEBARREADWRITEMIDDLEMENU] (* ;; "Window doesn't have RO Menus then it's RO status has never been changed so we make the RW Menus from the original menus. ") [if (NOT (OR TitleBarReadOnlyMiddleMenu TitleBarReadOnlyLeftMenu)) then [WINDOWPROP Window 'TITLEBARREADWRITELEFTMENU '(WINDOWPROP Window ' TitleBarLeftButtonMenu] [WINDOWPROP Window 'TITLEBARREADWRITEMIDDLEMENU '(WINDOWPROP Window ' TitleBarMiddleButtonMenu] [SETQ TitleBarReadWriteLeftMenu (NC.CopyMenu (WINDOWPROP Window ' TITLEBARREADWRITELEFTMENU] (SETQ TitleBarReadWriteMiddleMenu (NC.CopyMenu (WINDOWPROP Window ' TITLEBARREADWRITEMIDDLEMENU] (WINDOWPROP Window 'TitleBarLeftButtonMenu TitleBarReadWriteLeftMenu) (WINDOWPROP Window 'TitleBarMiddleButtonMenu TitleBarReadWriteMiddleMenu]) ) (PUTPROPS DWMPATCH001 FILETYPE :TCOMPL) (PUTPROPS DWMPATCH001 MAKEFILE-ENVIRONMENT (:PACKAGE "IL" :READTABLE "INTERLISP" :BASE 10)) (PUTPROPS DWMPATCH001 COPYRIGHT ("Xerox Corporation" 1987 1988)) (DECLARE%: DONTCOPY (FILEMAP (NIL (2075 10227 (NC.AddGraphCard 2085 . 4410) (NC.BringUpGraphCard 4412 . 7743) ( NC.MakeGraphCard 7745 . 10225)) (10265 13908 (NC.MakeGraphCardReadOnly 10275 . 11598) ( NC.MakeGraphCardReadWrite 11600 . 13061) (NC.SaveOrRevertGraphCard 13063 . 13906)) (14164 20981 ( NC.CardReadOnlyOpenP 14174 . 14380) (NC.MakeMenusReadOnly 14382 . 19341) (NC.MakeMenusReadWrite 19343 . 20979))))) STOP