Squeak Class Documentation category index | class index  
 
EventHandler
  category: Morphic-Events
  superclass: Object
  subclasses:

Events in Morphic originate in a Hand, pass to a target morph, and are then dispatched by an EventHandler. EventHandlers support redirection of mouse and keyboard activity by specifying and independent recipient object and message selector for each of the possible events. In addition each eventHandler can supply an optional value parameter for distinguishing between, eg, events from a number of otherwise identical source morphs.

The basic protocol of an event handler is to receive a message of the form
mouseDown: event in: targetMorph
and redirect this as one of
mouseDownRecipient perform: mouseDownSelector0
mouseDownRecipient perform: mouseDownSelector1 with: event
mouseDownRecipient perform: mouseDownSelector2 with: event with: targetMorph
mouseDownRecipient perform: mouseDownSelector3 with: event with: targetMorph with: valueParameter
depending on the arity of the mouseDownSelector.

instance methods
  access
  allRecipients
firstMouseSelector
gestureRecipient
gestureSelector
messageList
methodRefList
mouseDownSelector
mouseStillDownRecipient
mouseStillDownSelector
mouseUpSelector
printOn:

  copying
  veryDeepFixupWith:
veryDeepInner:

  events
  click:fromMorph:
doubleClick:fromMorph:
doubleClickTimeout:fromMorph:
gesture:fromMorph:
keyStroke:fromMorph:
mouseDown:fromMorph:
mouseEnter:fromMorph:
mouseEnterDragging:fromMorph:
mouseLeave:fromMorph:
mouseLeaveDragging:fromMorph:
mouseMove:fromMorph:
mouseStillDown:fromMorph:
mouseUp:fromMorph:
send:to:withEvent:fromMorph:
startDrag:fromMorph:

  fixups
  fixAlansOldEventHandlers
fixReversedValueMessages
replaceSendsIn:with:

  initialization
  adaptToWorld:
forgetDispatchesTo:
on:send:to:
on:send:to:withValue:

  object fileIn
  convertToCurrentVersion:refStream:

  testing
  handlesClickOrDrag:
handlesGesture:
handlesGestureStart:
handlesKeyboard:
handlesMouseDown:
handlesMouseMove:
handlesMouseOver:
handlesMouseOverDragging:
handlesMouseStillDown:
hasGestureRecipient

class methods
  fixups
  fixAlansOldEventHandlers

instance methods
  access top  
 

allRecipients

Answer a list, without duplication, of all the objects serving as recipients to any of the events I handle. Intended for debugging/documentation use only


 

firstMouseSelector

Answer the selector corresponding to the first mouse-handling selector fielded. Created in support of providing balloon-help for halo handles, triggered by the selector handled


 

gestureRecipient


 

gestureSelector


 

messageList

Return a list of 'Class selector' for each message I can send. tk
9/13/97


 

methodRefList

Return a MethodReference for each message I can send. tk 9/13/97, raa 5/29/01


 

mouseDownSelector


 

mouseStillDownRecipient


 

mouseStillDownSelector


 

mouseUpSelector


 

printOn:

Append to the argument, aStream, a sequence of characters that
identifies the receiver.


  copying top  
 

veryDeepFixupWith:

ALL inst vars were weakly copied. If they were in the tree being copied, fix them up, otherwise point to the originals!!


 

veryDeepInner:

ALL fields are weakly copied! Can't duplicate an object by duplicating a button that activates it. See DeepCopier.


  events top  
 

click:fromMorph:

This message is sent only when double clicks are handled.


 

doubleClick:fromMorph:


 

doubleClickTimeout:fromMorph:


 

gesture:fromMorph:

Pass the gesture event to the target morph


 

keyStroke:fromMorph:


 

mouseDown:fromMorph:

Take double-clicks into account.


 

mouseEnter:fromMorph:


 

mouseEnterDragging:fromMorph:


 

mouseLeave:fromMorph:


 

mouseLeaveDragging:fromMorph:


 

mouseMove:fromMorph:


 

mouseStillDown:fromMorph:


 

mouseUp:fromMorph:


 

send:to:withEvent:fromMorph:


 

startDrag:fromMorph:


  fixups top  
 

fixAlansOldEventHandlers


 

fixReversedValueMessages

ar 3/18/2001: Due to the change in the ordering of the value parameter old event handlers may have messages that need to be fixed up. Do this here.


 

replaceSendsIn:with:

Replace all the sends that occur in array1 with those in array2. Used for fixing old event handlers in files.


  initialization top  
 

adaptToWorld:

If any of my recipients refer to a world or a hand, make them now refer
to the corresponding items in the new world. (instVarNamed: is slow, later
use perform of two selectors.)


 

forgetDispatchesTo:

aSelector is no longer implemented by my corresponding Player, so don't call it any more


 

on:send:to:


 

on:send:to:withValue:


  object fileIn top  
 

convertToCurrentVersion:refStream:

20 dec 2000 - only a few (old) conversion exists


  testing top  
 

handlesClickOrDrag:


 

handlesGesture:

Does the associated morph want to handle gestures?


 

handlesGestureStart:

Does the associated morph want to handle gestures?


 

handlesKeyboard:


 

handlesMouseDown:


 

handlesMouseMove:


 

handlesMouseOver:


 

handlesMouseOverDragging:


 

handlesMouseStillDown:


 

hasGestureRecipient


class methods
  fixups top  
 

fixAlansOldEventHandlers


EventHandler fixAlansOldEventHandlers