(FILECREATED " 8-Dec-86 18:19:37" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH164.;3 6861   

      changes to:  (FNS NCP.AddNoteFileIconMiddleButtonItems NCP.NoteFileIconWindow 
			NC.NoteFileIconMiddleButtonFn NC.PopUpNoteFileName)
		   (VARS RHTPATCH164COMS)

      previous date: "23-Nov-86 15:32:42" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH164.;1)


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

(PRETTYCOMPRINT RHTPATCH164COMS)

(RPAQQ RHTPATCH164COMS ((* * This patch file changes action of middle button in a notefile icon. 
			     Now brings up a menu consisting of the item "Full File Name" which does 
			     the old action of displaying notefile filename. User can attach items to 
			     this menu from the programmer's interface. It is anticipated that 
			     creators of packages that "configure" a notefile, will put a call to 
			     NCP.AddNoteFileIconMiddleButtonItem on the open events card.)
			  (* * New stuff for NCINTERFACE)
			  (GLOBALVARS NC.DefaultNoteFileIconMiddleButtonItems)
			  (VARS (NC.DefaultNoteFileIconMiddleButtonItems (QUOTE ((Full% File% Name
										   
									     NC.PopUpNoteFileName 
						       "Display full file name of this notefile.")))))
			  (FNS NC.NoteFileIconMiddleButtonFn NC.PopUpNoteFileName)
			  (* * Changes to NCINTERFACE)
			  (FNS NC.NoteFileIconButtonEventFn)
			  (* * New functions for NCPROGINT)
			  (FNS NCP.AddNoteFileIconMiddleButtonItems NCP.NoteFileIconWindow)))
(* * This patch file changes action of middle button in a notefile icon. Now brings up a menu 
consisting of the item "Full File Name" which does the old action of displaying notefile 
filename. User can attach items to this menu from the programmer's interface. It is anticipated
 that creators of packages that "configure" a notefile, will put a call to 
NCP.AddNoteFileIconMiddleButtonItem on the open events card.)

(* * New stuff for NCINTERFACE)

(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.DefaultNoteFileIconMiddleButtonItems)
)

(RPAQQ NC.DefaultNoteFileIconMiddleButtonItems ((Full% File% Name NC.PopUpNoteFileName 
						       "Display full file name of this notefile.")))
(DEFINEQ

(NC.NoteFileIconMiddleButtonFn
  (LAMBDA (NoteFileIconWindow NoteFile)                      (* rht: "23-Nov-86 15:31")

          (* * Bring up the middle button menu for notefile icons.)


    (DECLARE (GLOBALVARS NC.MenuFont NC.DefaultNoteFileIconMiddleButtonItems))
    (LET (Menu)
         (OR (SETQ Menu (WINDOWPROP NoteFileIconWindow (QUOTE NoteFileMiddleButtonMenu)))
	       (WINDOWPROP NoteFileIconWindow (QUOTE NoteFileMiddleButtonMenu)
			     (SETQ Menu (create MENU
						    ITEMS ←(APPEND 
							  NC.DefaultNoteFileIconMiddleButtonItems
								     (NC.NoteFileProp NoteFile
											(QUOTE
											  
								    NoteFileIconMiddleButtonItems)))
						    CHANGEOFFSETFLG ←(QUOTE Y)
						    MENUOFFSET ←(CONS -1 0)
						    CENTERFLG ← NIL
						    MENUTITLEFONT ← NC.MenuFont
						    MENUFONT ← NC.MenuFont
						    ITEMHEIGHT ←(ADD1 (FONTPROP NC.MenuFont
										    (QUOTE HEIGHT)))
						    WHENSELECTEDFN ←(FUNCTION (LAMBDA (Item Menu 
											   Button)
							(APPLY* (CADR Item)
								  (GETMENUPROP Menu (QUOTE 
											 NoteFile))
								  Item)))))))
         (PUTMENUPROP Menu (QUOTE NoteFile)
			NoteFile)
         (SPAWN.MOUSE)
         (MENU Menu))))

(NC.PopUpNoteFileName
  (LAMBDA (NoteFile Item)                                    (* rht: "23-Nov-86 15:26")

          (* * Popup the notefile's full name. Use menu stashed on NoteFileIconWindow if any.)


    (LET ((NoteFileIconWindow (WFROMMENU (fetch (NoteFile Menu) of NoteFile))))
         (MENU (OR (WINDOWPROP NoteFileIconWindow (QUOTE NameMenu))
		       (LET ((Menu (create MENU
					     ITEMS ←(LIST (LIST (fetch (NoteFile FullFileName)
								       of NoteFile)
								    NIL
								    (fetch (NoteFile FullFileName)
								       of NoteFile)))
					     TITLE ← NIL)))
			    (WINDOWPROP NoteFileIconWindow (QUOTE NameMenu)
					  Menu)
			Menu))))))
)
(* * Changes to NCINTERFACE)

(DEFINEQ

(NC.NoteFileIconButtonEventFn
  (LAMBDA (Window)                                           (* rht: "23-Nov-86 14:44")

          (* * 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.)


    (LET (NoteFile Menu)
         (TOTOPW Window)
         (if (GREATERP (PLUS 9 (FONTPROP (GETPROP (WINDOWPROP Window (QUOTE MENU))
							    (QUOTE MENUTITLEFONT))
						 (QUOTE SIZE)))
			   (LASTMOUSEY Window))
	     then (APPLY* (WINDOWPROP Window (QUOTE CURSORMOVEDFN))
			      Window)
	   else                                            (* title bar)
		  (SETQ NoteFile (WINDOWPROP Window (QUOTE NoteFile)))
		  (if (LASTMOUSESTATE MIDDLE)
		      then (NC.NoteFileIconMiddleButtonFn Window NoteFile)
		    else (COND
			     ((NULL (WINDOWPROP Window (QUOTE BusyOperation)))
			       (RESETLST (RESETSAVE (WINDOWPROP Window (QUOTE BusyOperation)
								      "Operation")
							(BQUOTE (WINDOWPROP , Window 
										BusyOperation NIL)))
					   (NC.NoteFileOperations NoteFile)))
			     (T (NC.PrintMsg NIL NIL (CHARACTER 13)
					       (WINDOWPROP Window (QUOTE BusyOperation))
					       " in progress.  Please wait."))))))))
)
(* * New functions for NCPROGINT)

(DEFINEQ

(NCP.AddNoteFileIconMiddleButtonItems
  (LAMBDA (NoteFile MenuItems)                               (* rht: "23-Nov-86 15:47")

          (* * Add the given MenuItems to the given NoteFile.)


    (NCP.NoteFileProp NoteFile (QUOTE NoteFileIconMiddleButtonItems)
			(APPEND (NCP.NoteFileProp NoteFile (QUOTE NoteFileIconMiddleButtonItems)
						      )
				  MenuItems))

          (* * Smash stashed menu so as to force recompute.)


    (LET ((NoteFileIconWindow (NCP.NoteFileIconWindow NoteFile)))
         (if (OPENWP NoteFileIconWindow)
	     then (WINDOWPROP NoteFileIconWindow (QUOTE NoteFileMiddleButtonMenu)
				  NIL)))))

(NCP.NoteFileIconWindow
  (LAMBDA (NoteFile)                                         (* rht: "23-Nov-86 15:48")

          (* * Return the icon window for given notefile.)


    (WFROMMENU (fetch (NoteFile Menu) of NoteFile))))
)
(PUTPROPS RHTPATCH164 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (2169 4260 (NC.NoteFileIconMiddleButtonFn 2179 . 3507) (NC.PopUpNoteFileName 3509 . 4258
)) (4296 5784 (NC.NoteFileIconButtonEventFn 4306 . 5782)) (5825 6779 (
NCP.AddNoteFileIconMiddleButtonItems 5835 . 6524) (NCP.NoteFileIconWindow 6526 . 6777)))))
STOP