(DEFINE-FILE-INFO PACKAGE "IL" READTABLE "INTERLISP" BASE 10) (FILECREATED "31-Dec-87 12:14:02" {QV}<NOTECARDS>1.3LNEXT>RGPATCH070.;3 15136 changes to%: (VARS RGPATCH070COMS) (PROPS (RGPATCH070 MAKEFILE-ENVIRONMENT)) previous date%: "16-Dec-87 17:18:07" {QV}<NOTECARDS>1.3LNEXT>RGPATCH070.;2) (* " Copyright (c) 1987 by Xerox Corporation. All rights reserved. ") (PRETTYCOMPRINT RGPATCH070COMS) (RPAQQ RGPATCH070COMS ((DECLARE%: DONTCOPY (PROPS (RGPATCH070 MAKEFILE-ENVIRONMENT) (RGPATCH070 FILETYPE))) (* ;; "rg 12/16/87: further fix for problem w/ menu image getting shifted over") (* ;; "changes to NCINTERFACE") (FNS NC.ResetNoteFileInterface NC.SetUpNoteFileInterface))) (DECLARE%: DONTCOPY (PUTPROPS RGPATCH070 MAKEFILE-ENVIRONMENT (:PACKAGE "IL" :READTABLE "INTERLISP" :BASE 10)) (PUTPROPS RGPATCH070 FILETYPE :TCOMPL) ) (* ;; "rg 12/16/87: further fix for problem w/ menu image getting shifted over") (* ;; "changes to NCINTERFACE") (DEFINEQ (NC.ResetNoteFileInterface [LAMBDA (NoteFile) (* ; "Edited 16-Dec-87 17:09 by Randy.Gobbel") (* ;;; "Close up the control menu for a NoteFile") (* ;; "rht 5/1/86: Now does nothing if NC.NoteFileMenuLingerFlg is non-nil.") (* ;; "rht 5/6/86: Now smashes WhenSelectedFn and shades menu items if NC.NoteFileMenuLingerFlg is non-nil.") (* ;; "pmi 2/18/87: Now deletes 'RO:' in title of NoteFile menu if NoteFile was open Read-only") (* ;; "pmi 3/20/87: Removed WhenSelectedFn when overhauling to have NewCards and ShowCards middlebutton menus appear when buttoned DOWN, instead of after the button comes back up. Everything is now done in the ButtonEventFn.") (* ;; "pmi 5/1/87: Inserted call to NC.ClearMsg before the NoteFile's icon is deleted. Added Window arg to DELETEMENU call. Also commented out the code that deletes the NoteFile's menu and removes the NoteFile from its window if NC.NoteFileMenuLingerFlg is NIL. That way if the NoteFile is reopened, it will remember the position for its icon.") (DECLARE (GLOBALVARS NC.NoteFileMenuLingerFlg)) (LET ((Menu (fetch (NoteFile Menu) of NoteFile)) Window FullFileName) (if Menu then (SETQ Window (WFROMMENU Menu)) (if NC.NoteFileMenuLingerFlg then (for Item in (fetch (MENU ITEMS) of Menu) do (SHADEITEM Item Menu GRAYSHADE)) (* ; "(replace (MENU WHENSELECTEDFN) of Menu with (FUNCTION NC.ClosedNoteFileMenuWhenSelectedFn))") (* ; "No longer need a WHENSELECTEDFN") (if (NC.ReadOnlyNoteFileP NoteFile) then (SETQ FullFileName (fetch (NoteFile FullFileName) of NoteFile)) [replace (MENU TITLE) of Menu with (CONCAT (FILENAMEFIELD FullFileName 'NAME) ";" (FILENAMEFIELD FullFileName 'VERSION] (replace (MENU IMAGE) of Menu with NIL) (* ;; "KLUDGE. Fetching the image height forces the menu package to recompute the menu image.") (fetch (MENU IMAGEHEIGHT) of Menu) (* ;; "further KLUDGE. Have to smash MENUGRID to prevent menu image from being shifted over.") (replace (MENU MENUGRID) of Menu with (LIST 2 2 (fetch (MENU ITEMWIDTH) of Menu) (fetch (MENU ITEMHEIGHT) of Menu))) (AND Window (REDISPLAYW Window))) else (NC.ClearMsg Window T) (* ; "This code was removed so that if the NoteFile is reopened it will remember its position:") (* ; "(WINDOWPROP Window (QUOTE NoteFile) NIL)") (* ; "(replace (NoteFile Menu) of NoteFile with NIL)") (WINDOWPROP Window 'CLOSEFN NIL) (DELETEMENU Menu T Window]) (NC.SetUpNoteFileInterface [LAMBDA (NoteFile Position InterestedWindow) (* ; "Edited 15-Dec-87 15:47 by Randy.Gobbel") (* ;;; "Create the NoteCards control menu for a NoteFile") (* ;; "kirk 13Jan85 Decreased the size of the NoteFile Menu") (* ;; "fgh 1/22/86 Fixed the ghost box size when position menu.") (* ;; "rht 5/6/86: Now restores the menu's WhenSelectedFn and ungrays its items if already existed.") (* ;; "fgh 6/27/86 Added position argument") (* ;; "rht 7/5/86: Now shades NewCards if readonly notefile.") (* ;; "fgh 7/6/86 Will now set up menu correctly even if NF is closed.") (* ;; "rht 7/13/86: Was ignoring the Position arg. No longer.") (* ;; "rht 11/20/86: Changed name from ShowBox to ShowCards.") (* ;; " pmi 12/12/86: Added InterestedWindow argument so that we can print a prompt to the user about placing a newly created NoteFile menu.") (* ;; "pmi 3/20/87: Removed WhenSelectedFn when overhauling to have NewCards and ShowCards middlebutton menus appear when buttoned DOWN, instead of after the button comes back up. Everything is now done in the ButtonEventFn.") (* ;; "pmi 5/6/87: Moved prompt for position of icon to better place. Also added MENUOFFSET to NoteFile menu for Lyric.") (* ;; "pmi 5/19/87: Now stores the menu as a property of the fullfilename of the notefile. We might lose our pointer to the notefile object if another one gets created with the same UID, but we would like to keep a pointer to the menu.") (* ;; "pmi 5/28/87: Now returns the NoteFile Interface window.") (* ;; "rg 12/15/87: fixes up menu grid so redisplay works when notefile is reopened.") (LET ((Font (FONTCREATE 'HELVETICA 10 'BOLD)) (TitleFont (FONTCREATE 'HELVETICA 12 'BOLD)) NoteFileMenuWindow NoteFileMenu FullFileName) (* ; "Main Menu") (SETQ FullFileName (fetch (NoteFile FullFileName) of NoteFile)) [if (SETQ NoteFileMenu (OR (NC.GetNoteFileMenu NoteFile) (NC.GetNoteFileMenu FullFileName))) then (* ;; "No longer need WHENSELECTEDFN") (* ;; "(replace (MENU WHENSELECTEDFN) of NoteFileMenu with (if (NC.NoteFileOpenP NoteFile) then (FUNCTION NC.NoteFileMenuWhenSelectedFn) else (FUNCTION NC.ClosedNoteFileMenuWhenSelectedFn)))") [replace (MENU TITLE) of NoteFileMenu with (CONCAT (if (NC.ReadOnlyNoteFileP NoteFile) then "RO: " else "") (FILENAMEFIELD FullFileName 'NAME) ";" (FILENAMEFIELD FullFileName 'VERSION] (replace (MENU IMAGE) of NoteFileMenu with NIL) (* ; "KLUDGE. Fetching the image height forces the menu package to recompute the menu image.") (fetch (MENU IMAGEHEIGHT) of NoteFileMenu) (* ; "further KLUDGE. Have to smash MENUGRID to prevent menu image from being shifted over.") (replace (MENU MENUGRID) of NoteFileMenu with (LIST 2 2 (fetch (MENU ITEMWIDTH) of NoteFileMenu) (fetch (MENU ITEMHEIGHT) of NoteFileMenu))) (AND (WFROMMENU NoteFileMenu) (REDISPLAYW (WFROMMENU NoteFileMenu))) else (* ;; "Removed this menu field from following menu: (WHENSELECTEDFN ← (if (NC.NoteFileOpenP NoteFile) then (FUNCTION NC.NoteFileMenuWhenSelectedFn) else (FUNCTION NC.ClosedNoteFileMenuWhenSelectedFn)))") (SETQ NoteFileMenu (create MENU ITEMS ← '((NewCards NIL "Create a new Text card (left button) or other card type (middle button)." ) (ShowCards NIL "Bring up one of the special cards.")) WHENSELECTEDFN ← (FUNCTION NILL) CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 2 MENUCOLUMNS ← 2 MENUFONT ← Font TITLE ← (CONCAT (if (NC.ReadOnlyNoteFileP NoteFile) then "RO: " else "") (FILENAMEFIELD FullFileName 'NAME) ";" (FILENAMEFIELD FullFileName 'VERSION)) ITEMHEIGHT ← (IPLUS 6 (FONTPROP Font 'HEIGHT)) ITEMWIDTH ← (IPLUS (STRINGWIDTH 'NewCards Font) 10) MENUTITLEFONT ← TitleFont MENUOFFSET ← (CONS 0 0] (for Item in (fetch (MENU ITEMS) of NoteFileMenu) do (SHADEITEM Item NoteFileMenu (if (NC.NoteFileOpenP NoteFile) then WHITESHADE else GRAYSHADE))) (* ; "Shade NewCards if readonly notefile.") (if (NC.ReadOnlyNoteFileP NoteFile) then (for Item in (fetch (MENU ITEMS) of NoteFileMenu) when (EQ (CAR Item) 'NewCards) do (SHADEITEM Item NoteFileMenu GRAYSHADE))) [if (WINDOWP (SETQ NoteFileMenuWindow (WFROMMENU NoteFileMenu))) then (FLASHWINDOW NoteFileMenuWindow) else (SETQ NoteFileMenuWindow (ADDMENU NoteFileMenu NIL (if Position elseif (GETMENUPROP NoteFileMenu 'OldPosition) else (* ; "Prompt the user to place the new notefile menu") (NC.PrintMsg InterestedWindow T "Please place the menu for notefile " FullFileName) [SETQ Position (GETBOXPOSITION (fetch (REGION WIDTH) of (MENUREGION NoteFileMenu )) (fetch (REGION HEIGHT) of (MENUREGION NoteFileMenu ] (NC.ClearMsg InterestedWindow T) Position] (WINDOWPROP NoteFileMenuWindow 'NoteFile NoteFile) (replace (NoteFile Menu) of NoteFile with NoteFileMenu) (PUTPROP FullFileName 'Menu NoteFileMenu) (WINDOWPROP NoteFileMenuWindow 'RESHAPEFN 'DON'T) (WINDOWPROP NoteFileMenuWindow 'BUTTONEVENTFN (FUNCTION NC.NoteFileIconButtonEventFn)) (WINDOWPROP NoteFileMenuWindow 'SHRINKFN 'DON'T) (WINDOWPROP NoteFileMenuWindow 'SCROLLFN NIL) (WINDOWPROP NoteFileMenuWindow 'NOSCROLLBARS T) (* ;; "Make sure default menu WhenSelectedFn is not called") (WINDOWPROP NoteFileMenuWindow 'CURSORINFN NIL) (WINDOWPROP NoteFileMenuWindow 'CURSOROUTFN NIL) (WINDOWPROP NoteFileMenuWindow 'CURSORMOVEDFN NIL) (* ;; "") [WINDOWADDPROP NoteFileMenuWindow 'CLOSEFN (FUNCTION (LAMBDA (Window) (PUTMENUPROP (CAR (WINDOWPROP Window 'MENU)) 'OldPosition (WINDOWPOSITION Window] (NC.MoveWindowOntoScreen NoteFileMenuWindow) NoteFileMenuWindow]) ) (PUTPROPS RGPATCH070 COPYRIGHT ("Xerox Corporation" 1987)) (DECLARE%: DONTCOPY (FILEMAP (NIL (1196 15054 (NC.ResetNoteFileInterface 1206 . 5289) (NC.SetUpNoteFileInterface 5291 . 15052))))) STOP