(FILECREATED " 8-May-87 17:26:08" {QV}<NOTECARDS>1.3K>NEXT>BMOBJPATCH.;1 3490   

      changes to:  (VARS BMOBJPATCHCOMS)
		   (FNS BMOBJ.BUTTONEVENTINFN))


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

(PRETTYCOMPRINT BMOBJPATCHCOMS)

(RPAQQ BMOBJPATCHCOMS ((FNS BMOBJ.BUTTONEVENTINFN)))
(DEFINEQ

(BMOBJ.BUTTONEVENTINFN
  (LAMBDA (IMAGEOBJ WINDOW SELECTION X Y SELWINDOW TEXTSTREAM BUTTON OPERATION)
                                                             (* rht: " 8-May-87 17:21")
                                                             (* ;;; 
							     
"the user has pressed a button inside the bitmap object IMAGEOBJ.  Bring up a menu of bitmap edit operations.")
    (PROG* ((OBJ (IMAGEOBJPROP IMAGEOBJ (QUOTE OBJECTDATUM)))
	    (OLDSCALE (fetch (BITMAPOBJ BMOBJSCALEFACTOR) of OBJ))
	    NEW.BITMAP COMMAND.MENU COMMAND PREVIOUS.BITMAP NAME TEMP X Y)
           (COND
	     ((OR (EQ BUTTON (QUOTE RIGHT))
		    (AND OPERATION (NEQ OPERATION 'NORMAL)))
                                                             (* ; 
							     
" If he's extending a selection, or is selecting for move/copy/delete, DON'T bring up the bitmap editing menu!")
	       (RETURN)))
           (SETQ PREVIOUS.BITMAP (BITMAPCOPY (fetch (BITMAPOBJ BITMAP) of OBJ)))
           (SETQ NEW.BITMAP (SELECTQ (MENU (COND
						   ((type? MENU BITMAP.OBJ.MENU)
						     BITMAP.OBJ.MENU)
						   (T (SETQ BITMAP.OBJ.MENU (BMOBJ.CREATE.MENU))))
						 )
					 (CHANGE.SCALE       (* ; "Change the scale on the bitmap.")
					   (replace (BITMAPOBJ BMOBJSCALEFACTOR) of OBJ
					      with (OR (NUMBERP (MKATOM (PROMPTFORWORD
										  "Scale Factor:  " 
										  OLDSCALE NIL
										  (GETPROMPTWINDOW
										    WINDOW))))
							   OLDSCALE))
                                                             (* ; 
							     
"Return the prevous bitmap, so we don't change the bits.")
					   PREVIOUS.BITMAP)
					 (HAND.EDIT (EDITBM PREVIOUS.BITMAP))
					 (TRIM (TRIM.BITMAP PREVIOUS.BITMAP))
					 (INVERT.HORIZONTALLY (INVERT.BITMAP.HORIZONTALLY 
										  PREVIOUS.BITMAP))
					 (INVERT.VERTICALLY (INVERT.BITMAP.VERTICALLY 
										  PREVIOUS.BITMAP))
					 (INVERT.DIAGONALLY (INVERT.BITMAP.DIAGONALLY 
										  PREVIOUS.BITMAP))
					 (ROTATE.BITMAP.LEFT (ROTATE.BITMAP.LEFT PREVIOUS.BITMAP))
					 (ROTATE.BITMAP.RIGHT (ROTATE.BITMAP.RIGHT 
										  PREVIOUS.BITMAP))
					 (SHIFT.LEFT (INTERACT&SHIFT.BITMAP.LEFT PREVIOUS.BITMAP))
					 (SHIFT.RIGHT (INTERACT&SHIFT.BITMAP.RIGHT PREVIOUS.BITMAP))
					 (SHIFT.DOWN (INTERACT&SHIFT.BITMAP.DOWN PREVIOUS.BITMAP))
					 (SHIFT.UP (INTERACT&SHIFT.BITMAP.UP PREVIOUS.BITMAP))
					 (INTERCHANGE.BLACK/WHITE (INVERT.BITMAP.B/W 
										  PREVIOUS.BITMAP))
					 (ADD.BORDER (INTERACT&ADD.BORDER.TO.BITMAP PREVIOUS.BITMAP)
						     )
					 (RETURN NIL)))
           (replace (BITMAPOBJ BITMAP) of OBJ with NEW.BITMAP)
           (IMAGEOBJPROP IMAGEOBJ (QUOTE CACHED.BITMAP)
			   NIL)                              (* ; 
							     
"And clear any cached shrunk bitmaps so the display looks reasonable.")
           (RETURN (QUOTE CHANGED)))))
)
(PUTPROPS BMOBJPATCH COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (322 3409 (BMOBJ.BUTTONEVENTINFN 332 . 3407)))))
STOP