author | tz |
Wed, 01 Apr 1998 17:21:53 +0200 | |
changeset 889 | 85b7aa0e79e4 |
parent 521 | 2937b6c596b3 |
child 1185 | 522d9c84f0a9 |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
99 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
65 | 13 |
SimpleView subclass:#InputView |
225 | 14 |
instanceVariableNames:'eventReceiver' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
235 | 17 |
category:'Views-Special' |
0 | 18 |
! |
19 |
||
449 | 20 |
!InputView class methodsFor:'documentation'! |
21 | 21 |
|
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
99 | 25 |
All Rights Reserved |
0 | 26 |
|
21 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
0 | 35 |
|
21 | 36 |
documentation |
37 |
" |
|
38 |
a view for input only - forwarding all events to another object. |
|
39 |
This kind of view can be used to be laid ontop of another view to catch all |
|
40 |
input. (Interface builder) |
|
41 |
NOTICE: the event forwarding is a leftover from times when not delegation mechanism |
|
225 | 42 |
existed - it will vanish - use delegates for new code. |
43 |
||
44 |
[author:] |
|
45 |
Claus Gittinger |
|
21 | 46 |
" |
47 |
! ! |
|
0 | 48 |
|
130 | 49 |
!InputView methodsFor:'accessing'! |
0 | 50 |
|
130 | 51 |
eventReceiver:aView |
52 |
eventReceiver := aView |
|
53 |
! |
|
0 | 54 |
|
286
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
55 |
isInputOnly |
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
56 |
"yes, this is a transparent input-only view" |
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
57 |
|
0 | 58 |
^ true |
286
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
59 |
|
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
60 |
"Created: 1.6.1996 / 13:22:31 / cg" |
21 | 61 |
! ! |
62 |
||
449 | 63 |
!InputView methodsFor:'drag & drop'! |
64 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
65 |
canDrop:aCollectionOfDropObjects |
449 | 66 |
eventReceiver notNil ifTrue:[ |
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
67 |
^ eventReceiver canDrop:aCollectionOfDropObjects |
449 | 68 |
]. |
69 |
^ false |
|
70 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
71 |
"Modified: 11.4.1997 / 12:42:06 / cg" |
449 | 72 |
! |
73 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
74 |
drop:aCollectionOfDropObjects at:aPoint |
449 | 75 |
eventReceiver notNil ifTrue:[ |
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
76 |
eventReceiver drop:aCollectionOfDropObjects at:aPoint |
449 | 77 |
]. |
78 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
79 |
"Modified: 11.4.1997 / 12:43:41 / cg" |
449 | 80 |
! ! |
81 |
||
0 | 82 |
!InputView methodsFor:'event handling'! |
83 |
||
130 | 84 |
buttonMotion:state x:x y:y |
21 | 85 |
"redefined to forward event" |
86 |
||
0 | 87 |
eventReceiver notNil ifTrue:[ |
130 | 88 |
eventReceiver buttonMotion:state x:x y:y |
0 | 89 |
] |
90 |
! |
|
91 |
||
92 |
buttonPress:button x:x y:y |
|
21 | 93 |
"redefined to forward event" |
94 |
||
0 | 95 |
eventReceiver notNil ifTrue:[ |
99 | 96 |
eventReceiver buttonPress:button x:x y:y |
0 | 97 |
] |
98 |
! |
|
99 |
||
100 |
buttonRelease:button x:x y:y |
|
21 | 101 |
"redefined to forward event" |
102 |
||
0 | 103 |
eventReceiver notNil ifTrue:[ |
99 | 104 |
eventReceiver buttonRelease:button x:x y:y |
0 | 105 |
] |
106 |
! |
|
107 |
||
130 | 108 |
exposeX:x y:y width:w height:h |
109 |
"will never be received" |
|
110 |
^ self |
|
111 |
! |
|
112 |
||
0 | 113 |
focusIn |
21 | 114 |
"redefined to forward event" |
115 |
||
0 | 116 |
eventReceiver notNil ifTrue:[ |
99 | 117 |
eventReceiver focusIn |
0 | 118 |
] |
119 |
! |
|
120 |
||
121 |
focusOut |
|
21 | 122 |
"redefined to forward event" |
123 |
||
0 | 124 |
eventReceiver notNil ifTrue:[ |
99 | 125 |
eventReceiver focusOut |
0 | 126 |
] |
127 |
! |
|
128 |
||
130 | 129 |
keyPress:key x:x y:y |
130 |
"redefined to forward event" |
|
131 |
||
132 |
eventReceiver notNil ifTrue:[ |
|
133 |
eventReceiver keyPress:key x:x y:y |
|
134 |
] |
|
135 |
! |
|
136 |
||
137 |
keyRelease:key x:x y:y |
|
138 |
"redefined to forward event" |
|
139 |
||
140 |
eventReceiver notNil ifTrue:[ |
|
141 |
eventReceiver keyRelease:key x:x y:y |
|
142 |
] |
|
143 |
! |
|
144 |
||
0 | 145 |
pointerEnter:state x:x y:y |
21 | 146 |
"redefined to forward event" |
147 |
||
0 | 148 |
eventReceiver notNil ifTrue:[ |
99 | 149 |
eventReceiver pointerEnter:state x:x y:y |
0 | 150 |
] |
151 |
! |
|
152 |
||
153 |
pointerLeave:state |
|
21 | 154 |
"redefined to forward event" |
155 |
||
0 | 156 |
eventReceiver notNil ifTrue:[ |
99 | 157 |
eventReceiver pointerLeave:state |
0 | 158 |
] |
159 |
! ! |
|
130 | 160 |
|
161 |
!InputView methodsFor:'initialization'! |
|
162 |
||
163 |
initialize |
|
164 |
super initialize. |
|
165 |
borderWidth := 0 |
|
166 |
! ! |
|
167 |
||
168 |
!InputView methodsFor:'redefined dummy'! |
|
169 |
||
170 |
setViewBackground |
|
171 |
"inputviews have no background" |
|
172 |
||
173 |
^ self |
|
174 |
! ! |
|
175 |
||
449 | 176 |
!InputView class methodsFor:'documentation'! |
130 | 177 |
|
178 |
version |
|
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
179 |
^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.16 1997-04-11 10:48:20 cg Exp $' |
130 | 180 |
! ! |