(FILECREATED " 3-Apr-87 16:18:10" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH030.;3 5974   

      changes to:  (VARS PMIPATCH030COMS)
		   (FNS NC.NoteFileIconButtonEventFn)

      previous date: " 3-Apr-87 11:04:39" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH030.;2)


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

(PRETTYCOMPRINT PMIPATCH030COMS)

(RPAQQ PMIPATCH030COMS ((* * pmi 4/3/87: Now unshades NewCards item during card creation to 
			     indicate that multiple cards may be created at the same time.)
			  (* * Change to NCINTERFACE)
			  (FNS NC.NoteFileIconButtonEventFn)))
(* * pmi 4/3/87: Now unshades NewCards item during card creation to indicate that multiple 
cards may be created at the same time.)

(* * Change to NCINTERFACE)

(DEFINEQ

(NC.NoteFileIconButtonEventFn
  (LAMBDA (Window)                                           (* pmi: " 3-Apr-87 16:07")

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



          (* * pmi 4/3/87: Now unshades NewCards item during card creation to indicate that multiple cards may be created at 
	  the same time.)


    (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 (SHADEITEM
										       Item Menu 
										       WHITESHADE)
										     (
										  NC.MakeNoteCard
										       
									       NC.DefaultCardType 
										       NoteFile))
								 else (SHADEITEM Item Menu 
										     WHITESHADE)
									(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."))))))))
)
(PUTPROPS PMIPATCH030 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (773 5892 (NC.NoteFileIconButtonEventFn 783 . 5890)))))
STOP