InputView.st
author claus
Wed, 30 Aug 1995 01:43:11 +0200
changeset 98 ab8ed9e213d0
parent 96 948318b2fbd4
child 99 a656b0c9dd21
permissions -rw-r--r--
.

"
 COPYRIGHT (c) 1990 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.
"

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

InputView comment:'
COPYRIGHT (c) 1990 by Claus Gittinger
              All Rights Reserved

$Header: /cvs/stx/stx/libview2/InputView.st,v 1.7 1995-08-29 17:43:48 claus Exp $
'!

!InputView class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1990 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.
"
!

version
"
$Header: /cvs/stx/stx/libview2/InputView.st,v 1.7 1995-08-29 17:43:48 claus Exp $
"
!

documentation
"
    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)
    NOTICE: the event forwarding is a leftover from times when not delegation mechanism
            existed - it will vanish - use delegates for new code.
"
! !

!InputView methodsFor:'initialization'!

initialize
    super initialize.
    borderWidth := 0
! !

!InputView methodsFor:'accessing'!

inputOnly
    ^ true
!

eventReceiver:aView
    eventReceiver := aView
! !

!InputView methodsFor:'redefined dummy'!

setViewBackground
    "inputviews have no background"

    ^ self
! !

!InputView methodsFor:'event handling'!

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

keyPress:key x:x y:y
    "redefined to forward event"

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

keyRelease:key x:x y:y
    "redefined to forward event"

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

buttonShiftPress:button x:x y:y
    "redefined to forward event"

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

buttonPress:button x:x y:y
    "redefined to forward event"

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

buttonRelease:button x:x y:y
    "redefined to forward event"

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

buttonMotion:state x:x y:y
    "redefined to forward event"

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

focusIn
    "redefined to forward event"

    eventReceiver notNil ifTrue:[
        eventReceiver focusIn
    ]
!

focusOut
    "redefined to forward event"

    eventReceiver notNil ifTrue:[
        eventReceiver focusOut
    ]
!

pointerEnter:state x:x y:y
    "redefined to forward event"

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

pointerLeave:state
    "redefined to forward event"

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