(FILECREATED "14-Jul-86 13:21:21" {QV}<NOTECARDS>1.3K>KIRKPATCH017.;1 5007   

      changes to:  (VARS KIRKPATCH017COMS)
		   (FNS NC.NoteFileOperations))


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

(PRETTYCOMPRINT KIRKPATCH017COMS)

(RPAQQ KIRKPATCH017COMS ((* * fixes break on call to NC.DeleteDatabaseFile)
			   (FNS NC.NoteFileOperations)))
(* * fixes break on call to NC.DeleteDatabaseFile)

(DEFINEQ

(NC.NoteFileOperations
  (LAMBDA (NoteFile)                                         (* kirk: "14-Jul-86 12:37")
                                                             (* Ask usere 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)


    (LET ((NoteFileMenu (fetch (NoteFile Menu) of NoteFile))
	  (Font NC.MenuFont)
	  (FullFileName (fetch (NoteFile FullFileName) of NoteFile))
	  NoteFileMenuWindow Menu)
         (SPAWN.MOUSE)
         (SETQ NoteFileMenuWindow (WFROMMENU NoteFileMenu))
         (OR (SETQ Menu (WINDOWPROP NoteFileMenuWindow (QUOTE DatabaseOperationsMenu)))
	       (WINDOWPROP NoteFileMenuWindow (QUOTE DatabaseOperationsMenu)
			     (SETQ Menu
			       (create MENU
					 ITEMS ←
					 (BQUOTE ((Open (NC.OpenDatabaseFile , NoteFile NIL NIL 
										 NIL NIL NIL NIL NIL 
										 NIL NIL , 
									       NoteFileMenuWindow)
							  "Opens this NoteFile."
							  (SUBITEMS (Read-only% Open
								      (NC.OpenDatabaseFile
									, NoteFile (QUOTE INPUT)
									NIL NIL NIL NIL NIL NIL NIL 
									NIL , NoteFileMenuWindow)
								      
							     "Opens this NoteFile for read-only.")))
						    (Checkpoint (NC.CheckpointDatabase , NoteFile 
											 NIL NIL NIL 
											 NIL , 
									       NoteFileMenuWindow)
								
						"Checkpoint this NoteFile, saving changed cards.")
						    (Close (NC.CloseDatabaseFile , NoteFile , 
									       NoteFileMenuWindow)
							   "Closes this NoteFile.")
						    (Abort (NC.AbortSession , NoteFile)
							   
					     "Close NF, deleteing changes since last checkpoint.")
						    (Compact (NC.CompactNoteFile , NoteFile NIL NIL 
										   , 
									       NoteFileMenuWindow)
							     "Compacts a NoteFile to a target file."
							     (SUBITEMS (Compact% To% Target% File
									 (NC.CompactNoteFile , 
											 NoteFile NIL 
											      NIL , 
									       NoteFileMenuWindow)
									 
						       "Compacts this NoteFile to a target file.")
								       (Compact% In% Place
									 (NC.CompactNoteFile , 
											 NoteFile NIL 
											       T , 
									       NoteFileMenuWindow)
									 
							       "Compacts this NoteFile in place.")))
						    (Inspect&Repair (NC.InspectAndRepairNoteFile
								      , NoteFile)
								    
						 "Inspects and optionally repairs this NoteFile."
								    (SUBITEMS (Read% Substances
										(
								      NC.InspectAndRepairNoteFile
										  , NoteFile T)
										
"Inspects and optionally repairs a Notefile, but reads every substance.  This slows it WAY down.")))
						    (Copy (NC.CopyNoteFile , NoteFile NIL , 
									     NoteFileMenuWindow)
							  "Copies this notefile to a target file.")
						    (Rename (NC.RenameNoteFile , NoteFile)
							    "Rename this NoteFile")
						    (Delete (NC.DeleteDatabaseFile FullFileName , 
									       NoteFileMenuWindow)
							    "Deletes this NoteFile.")))
					 CHANGEOFFSETFLG ← (QUOTE Y)
					 MENUOFFSET ← (CONS -1 0)
					 CENTERFLG ← NIL
					 TITLE ← "NoteFile Ops"
					 MENUTITLEFONT ← Font
					 MENUFONT ← Font
					 ITEMHEIGHT ← (IPLUS (FONTPROP Font (QUOTE HEIGHT))
								 1)
					 WHENSELECTEDFN ←
					 (FUNCTION (LAMBDA (Item Menu Button)
					     (WINDOWPROP (WFROMMENU (fetch (NoteFile Menu)
									   of (GETMENUPROP
										  Menu
										  (QUOTE NoteFile)))
									)
							   (QUOTE BusyOperation)
							   (CAR Item))
					     (DEFAULTWHENSELECTEDFN Item Menu Button)))))))
         (PUTMENUPROP Menu (QUOTE NoteFile)
			NoteFile)
         (MENU Menu))))
)
(PUTPROPS KIRKPATCH017 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (439 4924 (NC.NoteFileOperations 449 . 4922)))))
STOP