InputView.st
author claus
Wed, 13 Oct 1993 01:46:47 +0100
changeset 5 4d55b551dc57
parent 0 3f9277473954
child 6 4ac87e6bf82f
permissions -rw-r--r--
(none)

"
 COPYRIGHT (c) 1990/91 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

View subclass:#InputView
       instanceVariableNames:'eventReceiver'
       classVariableNames:   ''
       poolDictionaries:     ''
       category:'Views-Basic'
!

InputView comment:'

COPYRIGHT (c) 1990/91 by Claus Gittinger
              All Rights Reserved

a view for input only - forwarding all events to another object.
This kind of view can be used to be laid ontop of another view to catch all
input. (Interface builder)

$Header: /cvs/stx/stx/libview2/InputView.st,v 1.2 1993-10-13 00:46:01 claus Exp $

written spring 90 by claus
'!

!InputView methodsFor:'initialization'!

initialize
    super initialize.
    borderWidth := 0
! !

!InputView methodsFor:'accessing'!

inputOnly
    ^ true
!

eventReceiver:aView
    eventReceiver := aView
! !

!InputView methodsFor:'event handling'!

exposeX:x y:y width:w height:h
    "will never be received"
    ^ self
!

keyPress:key x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver keyPress:key x:x y:y
    ]
!

keyRelease:key x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver keyRelease:key x:x y:y
    ]
!

buttonShiftPress:button x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver buttonShiftPress:button x:x y:y
    ]
!

buttonPress:button x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver buttonPress:button x:x y:y
    ]
!

buttonRelease:button x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver buttonRelease:button x:x y:y
    ]
!

buttonMotion:state x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver buttonMotion:state x:x y:y
    ]
!

focusIn
    eventReceiver notNil ifTrue:[
        eventReceiver focusIn
    ]
!

focusOut
    eventReceiver notNil ifTrue:[
        eventReceiver focusOut
    ]
!

pointerEnter:state x:x y:y
    eventReceiver notNil ifTrue:[
        eventReceiver pointerEnter:state x:x y:y
    ]
!

pointerLeave:state
    eventReceiver notNil ifTrue:[
        eventReceiver pointerLeave:state
    ]
! !