(FILECREATED " 4-Dec-86 10:49:06" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH002.;3 16371  

      changes to:  (FNS NC.MakeMainMenu NC.NoteFileOperations NC.NoteFileTitleLeftWhenSelectedFn)
		   (VARS PMIPATCH002COMS)

      previous date: " 3-Dec-86 17:07:21" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH002.;1)


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT PMIPATCH002COMS)

(RPAQQ PMIPATCH002COMS ((* * Fixes bug #s 220, 155, and 174?: Now have two menus for NoteFile icon 
			     titlebar left button menu: one if NoteFile is open, and one if NoteFile 
			     is closed. Menus come up much faster. Also added Inspect&Repair to menu 
			     for open NoteFile.)
			  (* * Changes to NCINTERFACE)
			  (FNS NC.MakeMainMenu NC.NoteFileOperations)
			  (* * New function for NCINTERFACE)
			  (FNS NC.NoteFileTitleLeftWhenSelectedFn)
			  (* * New vars for NCINTERFACE)
			  (GLOBALVARS NC.OpenedNoteFileMenu NC.ClosedNoteFileMenu)
			  (VARS (NC.OpenedNoteFileMenu NIL)
				(NC.ClosedNoteFileMenu NIL))
			  (* * Don't add to sources - just needed when patch is loaded)
			  (P (NC.MakeMainMenu))))
(* * Fixes bug #s 220, 155, and 174?: Now have two menus for NoteFile icon titlebar left 
button menu: one if NoteFile is open, and one if NoteFile is closed. Menus come up much faster.
 Also added Inspect&Repair to menu for open NoteFile.)

(* * Changes to NCINTERFACE)

(DEFINEQ

(NC.MakeMainMenu
  (LAMBDA (DatabaseTitle)                                    (* pmi: " 4-Dec-86 10:41")

          (* * Create the NoteCards menus)



          (* * rht 8/1/84: Added def'n for new menu: NC.SelectingFileBoxChildrenMenu)



          (* * rht 2/4/85: The browser source menu now accepts multiple selections.)



          (* * fkr 10/29/85: Now moves window onto screen.)



          (* * fgh 11/14/85 Eliminated NC Main Menu which was replaced by per NoteFile menus.)



          (* * pmi 12/4/86 Added menus for left button title bar of NoteFile Icons, one for open NoteFile and one for closed 
	  NoteFile)


    (DECLARE (GLOBALVARS NC.MainMenuPosition NC.SelectingSourcesMenu NC.SelectingContentsMenu 
			     NC.SelectingSingleCardMenu NC.SelectingCardMenu 
			     NC.SelectingMultipleCardsMenu NC.DeleteSelectingMenu 
			     NC.SelectingParentsMenu NC.SelectingBrowserSourceMenu 
			     NC.SelectingFileBoxChildrenMenu NC.SelectingCardsMenu 
			     NC.OpenedNoteFileMenu NC.ClosedNoteFileMenu NC.MenuFont WHITESHADE 
			     GRAYSHADE))
    (PROG (X (Font (FONTCREATE (QUOTE HELVETICA)
				   12
				   (QUOTE BOLD)))
	       (TitleFont (FONTCREATE (QUOTE HELVETICA)
					10
					(QUOTE BOLD)))
	       (Position (OR (POSITIONP NC.MainMenuPosition)
			       (create POSITION
					 XCOORD ← 350
					 YCOORD ← 650))))    (* Main Menu)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((NoSource NIL 
						   "Indicates that this note card has no source.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL "Indicates that selection is completed."))
						)
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Source(s)"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingSourcesMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel card closing.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL "Indicates that selection is completed."))
						)
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting File Box(es)"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingContentsMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((New% Card NIL "Make a new note card.")
						  (Cancel NIL "Cancel this selection.")))
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Note Card"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 2
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingSingleCardMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.")))
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Single Card"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 1
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingCardMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL "Indicates that selection is completed."))
						)
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Note Cards"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingMultipleCardsMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL "Indicates that selection is completed."))
						)
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting cards to close or delete"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.DeleteSelectingMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL "Indicates that selection is completed."))
						)
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting FileBox(s)"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingParentsMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL 
						    "Indicates that this operation is completed.")))
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Starting Card(s)/Box(s)"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingBrowserSourceMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this operation.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL 
						    "Indicates that this operation is completed.")))
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting cards to file"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingFileBoxChildrenMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Cancel NIL "Cancel this operation.")
						  (Undo NIL "Backup over last selection.")
						  (Done NIL 
						    "Indicates that this operation is completed.")))
				WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn)
				TITLE ← "Selecting Cards"
				CENTERFLG ← T
				MENUBORDERSIZE ← 1
				MENUOUTLINESIZE ← 1
				MENUCOLUMNS ← 3
				MENUFONT ← Font
				ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT)))
				MENUPOSITION ← Position
				MENUTITLEFONT ← TitleFont))
	    (SETQ NC.SelectingCardsMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Open NIL "Opens this NoteFile."
						       (SUBITEMS (Read-only% Open NIL 
							     "Opens this NoteFile for read-only.")))
						  (Checkpoint NIL 
						"Checkpoint this NoteFile, saving changed cards.")
						  (Close NIL "Closes this NoteFile.")
						  (Abort NIL 
					      "Close NF, deleting changes since last checkpoint.")
						  (Compact NIL 
							  "Compacts a NoteFile to a target file."
							   (SUBITEMS (Compact% To% Target% File
								       NIL 
						       "Compacts this NoteFile to a target file.")
								     (Compact% In% Place NIL 
							       "Compacts this NoteFile in place.")))
						  (Inspect&Repair NIL 
						 "Inspects and optionally repairs this NoteFile."
								  (SUBITEMS (Read% Substances NIL 
"Inspects and optionally repairs a Notefile, but reads every substance.  This slows it WAY down.")))
						  (Copy NIL "Copies this notefile to a target file.")
						  (Rename NIL "Rename this NoteFile")
						  (Delete NIL "Deletes this NoteFile.")))
				CHANGEOFFSETFLG ←(QUOTE Y)
				MENUOFFSET ←(CONS -1 0)
				CENTERFLG ← NIL
				TITLE ← "NoteFile Ops"
				MENUTITLEFONT ← NC.MenuFont
				MENUFONT ← NC.MenuFont
				ITEMHEIGHT ←(IPLUS (FONTPROP NC.MenuFont (QUOTE HEIGHT))
						     1)
				WHENSELECTEDFN ←(FUNCTION NC.NoteFileTitleLeftWhenSelectedFn)))
	    (for Item in (fetch (MENU ITEMS) of X)
	       do (SHADEITEM Item X (if (MEMB (CAR Item)
						      (QUOTE (Open Checkpoint Close Abort Compact 
								     Inspect&Repair Create)))
					    then WHITESHADE
					  else GRAYSHADE)))
	    (replace (MENU IMAGE) of X with NIL)
	    (SETQ NC.OpenedNoteFileMenu X)
	    (SETQ X (create MENU
				ITEMS ←(QUOTE ((Open NIL "Opens this NoteFile."
						       (SUBITEMS (Read-only% Open NIL 
							     "Opens this NoteFile for read-only.")))
						  (Checkpoint NIL 
						"Checkpoint this NoteFile, saving changed cards.")
						  (Close NIL "Closes this NoteFile.")
						  (Abort NIL 
					      "Close NF, deleting changes since last checkpoint.")
						  (Compact NIL 
							  "Compacts a NoteFile to a target file."
							   (SUBITEMS (Compact% To% Target% File
								       NIL 
						       "Compacts this NoteFile to a target file.")
								     (Compact% In% Place NIL 
							       "Compacts this NoteFile in place.")))
						  (Inspect&Repair NIL 
						 "Inspects and optionally repairs this NoteFile."
								  (SUBITEMS (Read% Substances NIL 
"Inspects and optionally repairs a Notefile, but reads every substance.  This slows it WAY down.")))
						  (Copy NIL "Copies this notefile to a target file.")
						  (Rename NIL "Rename this NoteFile")
						  (Delete NIL "Deletes this NoteFile.")))
				CHANGEOFFSETFLG ←(QUOTE Y)
				MENUOFFSET ←(CONS -1 0)
				CENTERFLG ← NIL
				TITLE ← "NoteFile Ops"
				MENUTITLEFONT ← NC.MenuFont
				MENUFONT ← NC.MenuFont
				ITEMHEIGHT ←(IPLUS (FONTPROP NC.MenuFont (QUOTE HEIGHT))
						     1)
				WHENSELECTEDFN ←(FUNCTION NC.NoteFileTitleLeftWhenSelectedFn)))
	    (for Item in (fetch (MENU ITEMS) of X)
	       do (SHADEITEM Item X (if (MEMB (CAR Item)
						      (QUOTE (Open Compact Inspect&Repair Copy 
								     Rename Delete Create)))
					    then WHITESHADE
					  else GRAYSHADE)))
	    (replace (MENU IMAGE) of X with NIL)
	    (SETQ NC.ClosedNoteFileMenu X))))

(NC.NoteFileOperations
  (LAMBDA (NoteFile)                                         (* pmi: " 4-Dec-86 10:44")
                                                             (* Ask user to choose which database operation.
							     Called from main menu whenselected fn.)

          (* * fgh 11/14/85 Updated to handle NoteFile object and per NoteFile menus.)



          (* * kirk 14Jan86 Added Close/Delete cards and changed the format)



          (* * fgh 6/13/86 Now sets BusyOperation of NF menu to something interesting.)



          (* * kirk 3Jul86 passed NoteFileMenuWindow to NC.CompactNoteFile)



          (* * fgh 7/5/86 Fixed above fix and put NoteFileMenuWindow is all calls.)



          (* * rht 7/5/86: Added read-only open to notefileops menu.)



          (* * kirk 7/14/86 Took comma out of FullFileName in NC.DeleteDatabaseFile call)



          (* * kirk 15Jul86 Added Grey shade to non-functional items when file is open/closed)



          (* * kef 8/6/86: Added SPAWN.MOUSE towards the end to eliminate the extraneous printing of "NoteFile Busy" which 
	  seemed to be constantly occurring for remote NoteFiles.)



          (* * pmi 12/4/86 Removed menu creation and shading of operations for open or closed NoteFile.
	  Now just uses appropriate pre-defined menu, depending on whether NoteFile is open or closed.)


    (LET (Menu)
         (if (NC.NoteFileOpenP NoteFile)
	     then (SETQ Menu NC.OpenedNoteFileMenu)
	   else (SETQ Menu NC.ClosedNoteFileMenu))
         (PUTMENUPROP Menu (QUOTE NoteFile)
			NoteFile)
         (SPAWN.MOUSE)
         (MENU Menu))))
)
(* * New function for NCINTERFACE)

(DEFINEQ

(NC.NoteFileTitleLeftWhenSelectedFn
  (LAMBDA (Item Menu Button)                                 (* pmi: " 4-Dec-86 10:48")

          (* * WhenSelectedFn for the menus NC.OpenedNoteFileMenu and NC.ClosedNoteFileMenu. These operations used to be 
	  performed by NC.NoteFileOperations. Provides faster Left-button title bar menu on NoteFile icons.)


    (DECLARE (GLOBALVARS NC.NoteFilesHashArray))
    (LET ((NoteFile (GETMENUPROP Menu (QUOTE NoteFile)))
	  NoteFileMenuWindow)
         (SETQ NoteFileMenuWindow (WFROMMENU (fetch (NoteFile Menu) of NoteFile)))
         (WINDOWPROP NoteFileMenuWindow (QUOTE BusyOperation)
		       (CAR Item))
         (DEFAULTWHENSELECTEDFN Item Menu Button)
         (SELECTQ (CAR Item)
		    (Open (NC.OpenNoteFile NoteFile NC.NoteFilesHashArray NIL NIL NIL NIL NIL NIL 
					     NIL NoteFileMenuWindow))
		    (Read-only% Open (NC.OpenNoteFile NoteFile NC.NoteFilesHashArray NIL NIL NIL 
							NIL NIL NIL NIL NoteFileMenuWindow NIL NIL 
							NIL NIL T))
		    (Checkpoint (NC.CheckpointNoteFile NoteFile NIL NIL NIL NIL NoteFileMenuWindow))
		    (Close (NC.CloseNoteFile NoteFile NoteFileMenuWindow))
		    (Abort (NC.AbortSession NoteFile NoteFileMenuWindow))
		    (Compact (NC.CompactNoteFile NoteFile NIL NIL NoteFileMenuWindow))
		    (Compact% To% Target% File (NC.CompactNoteFile NoteFile NIL NIL 
								     NoteFileMenuWindow))
		    (Compact% In% Place (NC.CompactNoteFile NoteFile NIL T NoteFileMenuWindow))
		    (Inspect&Repair (NC.InspectAndRepairNoteFile NoteFile NIL NoteFileMenuWindow))
		    (Read% Substances (NC.InspectAndRepairNoteFile NoteFile T NoteFileMenuWindow))
		    (Copy (NC.CopyNoteFile NoteFile NIL NoteFileMenuWindow))
		    (Rename (NC.RenameNoteFile NoteFile))
		    (Delete (NC.DeleteDatabaseFile NoteFile NoteFileMenuWindow))
		    NIL))))
)
(* * New vars for NCINTERFACE)

(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.OpenedNoteFileMenu NC.ClosedNoteFileMenu)
)

(RPAQQ NC.OpenedNoteFileMenu NIL)

(RPAQQ NC.ClosedNoteFileMenu NIL)
(* * Don't add to sources - just needed when patch is loaded)

(NC.MakeMainMenu)
(PUTPROPS PMIPATCH002 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1413 13992 (NC.MakeMainMenu 1423 . 12281) (NC.NoteFileOperations 12283 . 13990)) (14034
 15994 (NC.NoteFileTitleLeftWhenSelectedFn 14044 . 15992)))))
STOP