(FILECREATED "20-Mar-87 11:44:21" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH022.;8 19890 changes to: (FNS NC.AskNoteCardType NC.NoteFileIconButtonEventFn NC.ResetNoteFileInterface NC.SetUpNoteFileInterface NC.ChooseTopLevelCard) (VARS PMIPATCH022COMS) previous date: "20-Mar-87 11:05:58" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH022.;6) (* Copyright (c) 1987 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT PMIPATCH022COMS) (RPAQQ PMIPATCH022COMS ((* * pmi 3/20/87: Overhauled NoteFileIcon to have NewCards and ShowCards middlebutton menus appear when buttoned DOWN, instead of after the button comes back up. Also cleaned up card type and special card menus.) (* * Remove NC.NoteFileMenuWhenSelectedFn and NC.ClosedNoteFileMenuWhenSelectedFn and put in NCOBSOLETE) (* * Changed functions in NCINTERFACE:) (FNS NC.NoteFileIconButtonEventFn NC.ResetNoteFileInterface NC.SetUpNoteFileInterface NC.AskNoteCardType NC.ChooseTopLevelCard) (* * For patch file ONLY) (VARS (NC.NoteCardTypeMenu)))) (* * pmi 3/20/87: Overhauled NoteFileIcon to have NewCards and ShowCards middlebutton menus appear when buttoned DOWN, instead of after the button comes back up. Also cleaned up card type and special card menus.) (* * Remove NC.NoteFileMenuWhenSelectedFn and NC.ClosedNoteFileMenuWhenSelectedFn and put in NCOBSOLETE) (* * Changed functions in NCINTERFACE:) (DEFINEQ (NC.NoteFileIconButtonEventFn (LAMBDA (Window) (* pmi: "20-Mar-87 11:36") (* * Bring up NoteFile Menues) (* * kirk 15Jul86 Adjusted title size check for change in font) (* * rht 11/23/86: Now calls NC.NoteFileIconMiddleButtonFn to put up a menu of middle button options.) (* * pmi 3/20/87: Overhauled to have NewCards and ShowCards middlebutton menus appear when buttoned DOWN, instead of after the button comes back up.) (LET (NoteFile Menu) (if (MOUSESTATE UP) else (TOTOPW Window) (LET ((Menu (CAR (WINDOWPROP Window (QUOTE MENU))))) (* title bar) (SETQ NoteFile (WINDOWPROP Window (QUOTE NoteFile))) (for Item in (fetch (MENU ITEMS) of Menu) when (INSIDEP (MENUITEMREGION Item Menu) (LASTMOUSEX Window) (LASTMOUSEY Window)) do (RESETLST (RESETSAVE (SHADEITEM Item Menu GRAYSHADE) (LIST (QUOTE SHADEITEM) Item Menu (if (NULL (NC.NoteFileOpenP NoteFile)) then GRAYSHADE elseif (AND (EQ (CAR Item) (QUOTE NewCards)) (NC.ReadOnlyNoteFileP NoteFile)) then GRAYSHADE else WHITESHADE))) (if (NULL (NC.NoteFileOpenP NoteFile)) then (* * If the NoteFile is not open, just print a message and return) (FLASHW Window) (NC.PrintMsg Window T (fetch (NoteFile FullFileName) of NoteFile) " is not an open notefile.") (DISMISS 1000) (NC.ClearMsg Window T) elseif (PROCESSP (NC.NoteFileProp NoteFile (QUOTE ProcessInProgress))) then (* * This will probably be overhauled with Randy G.'s concurrancy fixes) (NC.PrintOperationInProgressMsg Window (CAR Item) (NC.NoteFileProp NoteFile (QUOTE OperationInProgress))) NIL else (SELECTQ (CAR Item) (NewCards (if (NC.ReadOnlyNoteFileP NoteFile) then (FLASHW Window) (NC.PrintMsg Window T "Can't create a new card in a Read-Only notefile.") (DISMISS 1000) (NC.ClearMsg Window T) elseif (LASTMOUSESTATE LEFT) then (* For the left button, don't do anything until the button comes back up. Otherwise, things happen too soon.) (UNTILMOUSESTATE UP) (if (INSIDEP (MENUITEMREGION Item Menu) (LASTMOUSEX Window) (LASTMOUSEY Window)) then ( NC.MakeNoteCard NC.DefaultCardType NoteFile)) else (NC.MakeNoteCard NIL NoteFile))) (ShowCards (if (LASTMOUSESTATE LEFT) then (* For the left button, don't do anything until the button comes back up. Otherwise, things happen too soon.) (UNTILMOUSESTATE UP) (if (INSIDEP (MENUITEMREGION Item Menu) (LASTMOUSEX Window) (LASTMOUSEY Window)) then (NC.EditNoteCard (fetch (NoteFile TableOfContentsCard) of NoteFile))) else (NC.ChooseTopLevelCard NoteFile))) NIL))) (RETURN) finally (if (LASTMOUSESTATE MIDDLE) then (NC.NoteFileIconMiddleButtonFn Window NoteFile) elseif (NULL (WINDOWPROP Window (QUOTE BusyOperation))) then (RESETLST (RESETSAVE (WINDOWPROP Window (QUOTE BusyOperation) "Operation") (BQUOTE (WINDOWPROP , Window BusyOperation NIL) )) (NC.NoteFileOperations NoteFile)) else (NC.PrintMsg NIL NIL (CHARACTER 13) (WINDOWPROP Window (QUOTE BusyOperation)) " in progress. Please wait.")))))))) (NC.ResetNoteFileInterface (LAMBDA (NoteFile) (* pmi: "20-Mar-87 10:13") (* * 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.) (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 (QUOTE NAME)) ";" (FILENAMEFIELD FullFileName (QUOTE 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) (AND Window (REDISPLAYW Window))) else (WINDOWPROP Window (QUOTE NoteFile) NIL) (replace (NoteFile Menu) of NoteFile with NIL) (WINDOWPROP Window (QUOTE CLOSEFN) NIL) (DELETEMENU Menu T)))))) (NC.SetUpNoteFileInterface (LAMBDA (NoteFile Position InterestedWindow) (* pmi: "20-Mar-87 10:17") (* * 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.) (LET ((Font (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))) (TitleFont (FONTCREATE (QUOTE HELVETICA) 12 (QUOTE BOLD))) NoteFileMenuWindow NoteFileMenu FullFileName) (* Main Menu) (SETQ FullFileName (fetch (NoteFile FullFileName) of NoteFile)) (if (SETQ NoteFileMenu (fetch (NoteFile Menu) of NoteFile)) 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 (QUOTE NAME)) ";" (FILENAMEFIELD FullFileName (QUOTE 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) (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 ←(QUOTE ((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 (QUOTE NAME)) ";" (FILENAMEFIELD FullFileName (QUOTE VERSION))) ITEMHEIGHT ←(IPLUS 6 (FONTPROP Font (QUOTE HEIGHT))) ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE NewCards) Font) 10) MENUTITLEFONT ← TitleFont)) (* Prompt the user to place the new notefile menu) (NC.PrintMsg InterestedWindow T "Please place the menu for notefile " FullFileName)) (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) (QUOTE NewCards)) do (SHADEITEM Item NoteFileMenu GRAYSHADE))) (if (WINDOWP (SETQ NoteFileMenuWindow (WFROMMENU NoteFileMenu))) then (FLASHWINDOW NoteFileMenuWindow) else (SETQ NoteFileMenuWindow (ADDMENU NoteFileMenu NIL (OR Position (GETMENUPROP NoteFileMenu (QUOTE OldPosition)) (GETBOXPOSITION (fetch (REGION WIDTH) of (MENUREGION NoteFileMenu)) (fetch (REGION HEIGHT) of (MENUREGION NoteFileMenu))))) )) (WINDOWPROP NoteFileMenuWindow (QUOTE NoteFile) NoteFile) (replace (NoteFile Menu) of NoteFile with NoteFileMenu) (WINDOWPROP NoteFileMenuWindow (QUOTE RESHAPEFN) (QUOTE DON'T)) (WINDOWPROP NoteFileMenuWindow (QUOTE BUTTONEVENTFN) (FUNCTION NC.NoteFileIconButtonEventFn)) (WINDOWPROP NoteFileMenuWindow (QUOTE SHRINKFN) (QUOTE DON'T)) (WINDOWPROP NoteFileMenuWindow (QUOTE SCROLLFN) NIL) (WINDOWPROP NoteFileMenuWindow (QUOTE NOSCROLLBARS) T) (* * Make sure default menu WhenSelectedFn is not called) (WINDOWPROP NoteFileMenuWindow (QUOTE CURSORINFN) NIL) (WINDOWPROP NoteFileMenuWindow (QUOTE CURSOROUTFN) NIL) (WINDOWPROP NoteFileMenuWindow (QUOTE CURSORMOVEDFN) NIL) (* *) (WINDOWADDPROP NoteFileMenuWindow (QUOTE CLOSEFN) (FUNCTION (LAMBDA (Window) (PUTMENUPROP (CAR (WINDOWPROP Window (QUOTE MENU))) (QUOTE OldPosition) (WINDOWPOSITION Window))))) (NC.MoveWindowOntoScreen NoteFileMenuWindow)))) (NC.AskNoteCardType (LAMBDA (ManinMenuOrRegion) (* pmi: "20-Mar-87 11:41") (* Ask user to choose a note card type) (* * rht 1/12/85: Now takes an optional Region argument dictating where to place the NoteCardTypeMenu. If NIL, then uses MainMenu.) (* * fgh 11/16/85 Updated to take a MainMenu arg in place of using the NC.MainMenu globalvar.) (* * pmi 3/20/87: Changed fields of NC.NoteCardTypeMenu: CENTERFLG to T, MENUFONT to NC.MenuFont, changed title from "Type?" to "Card Types") (DECLARE (GLOBALVARS NC.NoteCardTypeMenu)) (PROG (W Z) (OR (AND (BOUNDP (QUOTE NC.NoteCardTypeMenu)) (type? MENU NC.NoteCardTypeMenu)) (SETQ NC.NoteCardTypeMenu (create MENU ITEMS ←(NC.ListOfCardTypes T) CENTERFLG ← T TITLE ← "Card Types" MENUFONT ← NC.MenuFont ITEMHEIGHT ←(IPLUS (FONTPROP NC.MenuFont (QUOTE HEIGHT)) 1)))) (replace MENUPOSITION of NC.NoteCardTypeMenu with (COND ((REGIONP ManinMenuOrRegion) (CONS (fetch (REGION LEFT) of ManinMenuOrRegion) (IPLUS (fetch (REGION BOTTOM) of ManinMenuOrRegion) (fetch (REGION HEIGHT) of ManinMenuOrRegion) (IMINUS (fetch (MENU IMAGEHEIGHT) of NC.NoteCardTypeMenu))))) (T (CONS (IPLUS (fetch (REGION LEFT) of (SETQ Z (WINDOWPROP (WFROMMENU ManinMenuOrRegion) (QUOTE REGION)))) (fetch (REGION LEFT) of (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of ManinMenuOrRegion) 1)) ManinMenuOrRegion)))) (IPLUS (fetch (REGION BOTTOM) of Z) (fetch (REGION TOP) of W) (IMINUS (fetch (MENU IMAGEHEIGHT) of NC.NoteCardTypeMenu))))) )) (RETURN (MENU NC.NoteCardTypeMenu))))) (NC.ChooseTopLevelCard (LAMBDA (NoteFile) (* pmi: "20-Mar-87 10:57") (* Let the user choose one of the top level cards. Top level cards are specified by globalvar NC.TopLevelCards which is a list of IDs) (* * fgh 11/14/85 Updated to handle NoteFile object and per NoteFile menus.) (* * kirk 6May86 Deleted SETQ of undeclared Menu var in the last expression) (* * rht 11/20/86: Now looks on "SpecialCards" prop of notefile for other cards to make available from ShowCards menu.) (* * pmi 3/20/87: Changed fields of NC.NoteCardTypeMenu: changed MENUFONT to NC.MenuFont, added 1 to ITEMHEIGHT, added title of "Special Cards") (LET ((NoteFileMenu (fetch (NoteFile Menu) of NoteFile)) Menu W Z) (SETQ Menu (create MENU ITEMS ←(for Card in (APPEND (NC.FetchTopLevelCards NoteFile) (NC.NoteFileProp NoteFile (QUOTE SpecialCards))) when (NC.ValidCardP Card) collect (LIST (NC.RetrieveTitle Card) Card)) CENTERFLG ← T TITLE ← "Special Cards" MENUFONT ← NC.MenuFont ITEMHEIGHT ←(IPLUS (FONTPROP NC.MenuFont (QUOTE HEIGHT)) 1) WHENSELECTEDFN ←(FUNCTION (LAMBDA (Item Button Menu) (NC.EditNoteCard (CADR Item)))))) (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of NoteFileMenu) 2)) NoteFileMenu)) (SETQ Z (WINDOWPROP (WFROMMENU NoteFileMenu) (QUOTE REGION))) (replace (MENU MENUPOSITION) of Menu with (create POSITION XCOORD ←(IPLUS (fetch (REGION LEFT) of W) (fetch (REGION LEFT) of Z)) YCOORD ←(IPLUS (fetch (REGION TOP) of W) (fetch (REGION BOTTOM) of Z) (IMINUS (fetch (MENU IMAGEHEIGHT) of Menu))))) (MENU Menu)))) ) (* * For patch file ONLY) (RPAQQ NC.NoteCardTypeMenu NIL) (PUTPROPS PMIPATCH022 COPYRIGHT ("Xerox Corporation" 1987)) (DECLARE: DONTCOPY (FILEMAP (NIL (1468 19739 (NC.NoteFileIconButtonEventFn 1478 . 6280) (NC.ResetNoteFileInterface 6282 . 8583) (NC.SetUpNoteFileInterface 8585 . 15271) (NC.AskNoteCardType 15273 . 17525) ( NC.ChooseTopLevelCard 17527 . 19737))))) STOP