InputView.st
author Claus Gittinger <cg@exept.de>
Tue, 13 Apr 1999 16:02:21 +0200
changeset 1158 fe67c8fdf68b
parent 521 2937b6c596b3
child 1185 522d9c84f0a9
permissions -rw-r--r--
checkin from browser

"
 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-Special'
!

!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.
"
!

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.

    [author:]
        Claus Gittinger
"
! !

!InputView methodsFor:'accessing'!

eventReceiver:aView
    eventReceiver := aView
!

isInputOnly
    "yes, this is a transparent input-only view"

    ^ true

    "Created: 1.6.1996 / 13:22:31 / cg"
! !

!InputView methodsFor:'drag & drop'!

canDrop:aCollectionOfDropObjects
    eventReceiver notNil ifTrue:[
        ^ eventReceiver canDrop:aCollectionOfDropObjects
    ].
    ^ false

    "Modified: 11.4.1997 / 12:42:06 / cg"
!

drop:aCollectionOfDropObjects at:aPoint
    eventReceiver notNil ifTrue:[
        eventReceiver drop:aCollectionOfDropObjects at:aPoint
    ].

    "Modified: 11.4.1997 / 12:43:41 / cg"
! !

!InputView methodsFor:'event handling'!

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

    eventReceiver notNil ifTrue:[
	eventReceiver buttonMotion:state 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
    ]
!

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

focusIn
    "redefined to forward event"

    eventReceiver notNil ifTrue:[
	eventReceiver focusIn
    ]
!

focusOut
    "redefined to forward event"

    eventReceiver notNil ifTrue:[
	eventReceiver focusOut
    ]
!

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
    ]
!

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
    ]
! !

!InputView methodsFor:'initialization'!

initialize
    super initialize.
    borderWidth := 0
! !

!InputView methodsFor:'redefined dummy'!

setViewBackground
    "inputviews have no background"

    ^ self
! !

!InputView class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.16 1997-04-11 10:48:20 cg Exp $'
! !