|
Class: InputView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--InputView
- Package:
- stx:libview2
- Category:
- Views-Special
- Version:
- rev:
1.26
date: 2021/01/20 15:59:33
- user: cg
- file: InputView.st directory: libview2
- module: stx stc-classLibrary: libview2
a view for input only - forwarding all events to another object.
This kind of view can be used to be laid on top of another view to catch all
input. (Interface builder)
NOTICE: the event forwarding is a leftover from times when no delegation mechanism
existed - it will vanish - use delegates for new code.
[caveat:]
do not use
it seems to (no longer) work on the desktop (at least with win10).
copyrightCOPYRIGHT (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.
accessing
-
eventReceiver: aView
-
set the view to which input events are forwarded
-
isInputOnly
-
return true, since this is a transparent input-only view
drag & drop
-
canDrop: aDropContext
-
return true, if aCollectionOfDropObjects can be dropped here.
Delegated to my eventReceiving view
-
canDrop: aDropContext at: aPoint
-
return true, if aCollectionOfDropObjects can be dropped here.
Delegated to my eventReceiving view
-
canDropObjects: aCollectionOfDropObjects
-
return true, if aCollectionOfDropObjects can be dropped here.
Delegated to my eventReceiving view
-
canDropObjects: aCollectionOfDropObjects at: aPoint
-
return true, if aCollectionOfDropObjects can be dropped here.
Delegated to my eventReceiving view
-
drop: aDropContext
-
drop aCollectionOfDropObjects here.
Delegated to my eventReceiving view
-
drop: aDropContext at: aPoint
-
drop aCollectionOfDropObjects here.
Delegated to my eventReceiving view
-
dropObjects: aCollectionOfDropObjects
-
drop aCollectionOfDropObjects here.
Delegated to my eventReceiving view
-
dropObjects: aCollectionOfDropObjects at: aPoint
-
drop aCollectionOfDropObjects here.
Delegated to my eventReceiving view
event handling
-
buttonMotion: state x: x y: y
-
redefined to forward the event to my eventReceiver
-
buttonPress: button x: x y: y
-
redefined to forward the event to my eventReceiver
-
buttonRelease: button x: x y: y
-
redefined to forward the event to my eventReceiver
-
exposeX: x y: y width: w height: h
-
dummy - will never be received
-
focusIn
-
redefined to forward the event to my eventReceiver
-
focusOut
-
redefined to forward the event to my eventReceiver
-
keyPress: key x: x y: y
-
redefined to forward the event to my eventReceiver
-
keyRelease: key x: x y: y
-
redefined to forward the event to my eventReceiver
-
pointerEnter: state x: x y: y
-
redefined to forward the event to my eventReceiver
-
pointerLeave: state
-
redefined to forward the event to my eventReceiver
initialization
-
initialize
-
(comment from inherited method)
initialize all state of the view - usually redefined in subclasses,
but always doing a 'super initialize'. Each class should setup its
locals - and not forget the others.
View setup is separated into two parts, the general setup done here
and the style specific setup in initStyle. Each view should be prepared
for a stylechange by being sent another initStyle with a new style value.
(in this case, it should set all of its style-dependent things, but
leave the state and contents as-is)
redefined dummy
-
setViewBackground
-
dummy - inputviews have no background
|v|
v := InputView origin:0@0 extent:Display extent.
[Delay waitForSeconds:5. v destroy] fork.
v open.
|