KeyboardForwarder.st
changeset 142 8473a0af99ac
parent 140 0db355079dc4
child 144 cf645a1ebbb3
equal deleted inserted replaced
141:caf4432fae8f 142:8473a0af99ac
    22 
    22 
    23 !KeyboardForwarder class methodsFor:'documentation'!
    23 !KeyboardForwarder class methodsFor:'documentation'!
    24 
    24 
    25 version
    25 version
    26 "
    26 "
    27 $Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.4 1995-05-09 00:21:39 claus Exp $
    27 $Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.5 1995-05-12 18:00:26 claus Exp $
    28 "
    28 "
    29 !
    29 !
    30 
    30 
    31 documentation
    31 documentation
    32 "
    32 "
    33     Instances of this class can be used as delegates to forward keyboard
    33     Instances of this class can be used as delegates to forward keyboard
    34     events to some object or other view (via aView delegate:).
    34     events to some object or other view (via aView delegate:).
    35     Notice, that delegates dont have to be instances of
    35     Notice, that delegates dont have to be instances of
    36     myself; any object with a protocol similar to mine can be used as
    36     myself; any object with a protocol similar to mine can be used as
    37     a delegate. 
    37     a delegate. 
    38     (i.e. any object that responds to handlesKeyPress:view: / keyPress:x:y:view: etc.)
    38     (i.e. any object that responds to 
       
    39      handlesKeyPress:view: / keyPress:x:y:view: / delegatesTo: etc.)
    39 
    40 
    40     However, I provide the most common functions required for conditional
    41     However, I provide the most common functions required for conditional
    41     event delegation and instances of myself are for example used to forward 
    42     event delegation and instances of myself are for example used to forward 
    42     events from elements of some dialogBoxes to the enterfield/fieldGroup - 
    43     events from elements of some dialogBoxes to the enterfield/fieldGroup - 
    43     this allows keyboard input to be forwarded to the active text-field even 
    44     this allows keyboard input to be forwarded to the active text-field even 
   174 sourceView
   175 sourceView
   175     ^ sourceView
   176     ^ sourceView
   176 ! !
   177 ! !
   177 
   178 
   178 !KeyboardForwarder methodsFor:'queries'!
   179 !KeyboardForwarder methodsFor:'queries'!
       
   180 
       
   181 delegatesTo:someone
       
   182     "return true, if I delegate events to someone"
       
   183 
       
   184     ^ destination == someone or:[destinationView == someone]
       
   185 !
   179 
   186 
   180 handlesKeyPress:key inView:aView
   187 handlesKeyPress:key inView:aView
   181     "this is the query from the sensor to ask me if I would like to
   188     "this is the query from the sensor to ask me if I would like to
   182      get a keyPress event for key from aView. Return true, if I want so,
   189      get a keyPress event for key from aView. Return true, if I want so,
   183      false otherwise."
   190      false otherwise."