author | Claus Gittinger <cg@exept.de> |
Fri, 14 Dec 2001 11:51:34 +0100 | |
changeset 1550 | b58979898957 |
parent 1241 | 414114cfc5cc |
child 2250 | 77b78d1ca422 |
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 |
1241 | 52 |
"set the view to which input events are forwarded" |
53 |
||
130 | 54 |
eventReceiver := aView |
55 |
! |
|
0 | 56 |
|
286
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
57 |
isInputOnly |
1241 | 58 |
"return true, since this is a transparent input-only view" |
286
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
59 |
|
0 | 60 |
^ true |
286
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
61 |
|
b7f2e2aefae1
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
235
diff
changeset
|
62 |
"Created: 1.6.1996 / 13:22:31 / cg" |
21 | 63 |
! ! |
64 |
||
449 | 65 |
!InputView methodsFor:'drag & drop'! |
66 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
67 |
canDrop:aCollectionOfDropObjects |
1241 | 68 |
"return true, if aCollectionOfDropObjects can be dropped here. |
69 |
Delegated to my eventReceiving view" |
|
70 |
||
449 | 71 |
eventReceiver notNil ifTrue:[ |
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
72 |
^ eventReceiver canDrop:aCollectionOfDropObjects |
449 | 73 |
]. |
74 |
^ false |
|
75 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
76 |
"Modified: 11.4.1997 / 12:42:06 / cg" |
449 | 77 |
! |
78 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
79 |
drop:aCollectionOfDropObjects at:aPoint |
1241 | 80 |
"drop aCollectionOfDropObjects here. |
81 |
Delegated to my eventReceiving view" |
|
82 |
||
449 | 83 |
eventReceiver notNil ifTrue:[ |
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
84 |
eventReceiver drop:aCollectionOfDropObjects at:aPoint |
449 | 85 |
]. |
86 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
449
diff
changeset
|
87 |
"Modified: 11.4.1997 / 12:43:41 / cg" |
449 | 88 |
! ! |
89 |
||
0 | 90 |
!InputView methodsFor:'event handling'! |
91 |
||
130 | 92 |
buttonMotion:state x:x y:y |
1241 | 93 |
"redefined to forward the event to my eventReceiver" |
21 | 94 |
|
0 | 95 |
eventReceiver notNil ifTrue:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
96 |
eventReceiver buttonMotion:state x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
97 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
98 |
super buttonMotion:state x:x y:y |
0 | 99 |
] |
100 |
! |
|
101 |
||
102 |
buttonPress:button x:x y:y |
|
1241 | 103 |
"redefined to forward the event to my eventReceiver" |
21 | 104 |
|
0 | 105 |
eventReceiver notNil ifTrue:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
106 |
eventReceiver buttonPress:button x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
107 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
108 |
super buttonPress:button x:x y:y |
0 | 109 |
] |
110 |
! |
|
111 |
||
112 |
buttonRelease:button x:x y:y |
|
1241 | 113 |
"redefined to forward the event to my eventReceiver" |
21 | 114 |
|
0 | 115 |
eventReceiver notNil ifTrue:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
116 |
eventReceiver buttonRelease:button x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
117 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
118 |
super buttonRelease:button x:x y:y |
0 | 119 |
] |
120 |
! |
|
121 |
||
130 | 122 |
exposeX:x y:y width:w height:h |
1241 | 123 |
"dummy - will never be received" |
124 |
||
130 | 125 |
^ self |
126 |
! |
|
127 |
||
0 | 128 |
focusIn |
1241 | 129 |
"redefined to forward the event to my eventReceiver" |
21 | 130 |
|
0 | 131 |
eventReceiver notNil ifTrue:[ |
1241 | 132 |
eventReceiver focusIn |
0 | 133 |
] |
134 |
! |
|
135 |
||
136 |
focusOut |
|
1241 | 137 |
"redefined to forward the event to my eventReceiver" |
21 | 138 |
|
0 | 139 |
eventReceiver notNil ifTrue:[ |
1241 | 140 |
eventReceiver focusOut |
0 | 141 |
] |
142 |
! |
|
143 |
||
130 | 144 |
keyPress:key x:x y:y |
1241 | 145 |
"redefined to forward the event to my eventReceiver" |
130 | 146 |
|
147 |
eventReceiver notNil ifTrue:[ |
|
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
148 |
eventReceiver keyPress:key x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
149 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
150 |
super keyPress:key x:x y:y |
130 | 151 |
] |
152 |
! |
|
153 |
||
154 |
keyRelease:key x:x y:y |
|
1241 | 155 |
"redefined to forward the event to my eventReceiver" |
130 | 156 |
|
157 |
eventReceiver notNil ifTrue:[ |
|
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
158 |
eventReceiver keyRelease:key x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
159 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
160 |
super keyRelease:key x:x y:y |
130 | 161 |
] |
162 |
! |
|
163 |
||
0 | 164 |
pointerEnter:state x:x y:y |
1241 | 165 |
"redefined to forward the event to my eventReceiver" |
21 | 166 |
|
0 | 167 |
eventReceiver notNil ifTrue:[ |
1241 | 168 |
eventReceiver pointerEnter:state x:x y:y |
0 | 169 |
] |
170 |
! |
|
171 |
||
172 |
pointerLeave:state |
|
1241 | 173 |
"redefined to forward the event to my eventReceiver" |
21 | 174 |
|
0 | 175 |
eventReceiver notNil ifTrue:[ |
1241 | 176 |
eventReceiver pointerLeave:state |
0 | 177 |
] |
178 |
! ! |
|
130 | 179 |
|
180 |
!InputView methodsFor:'initialization'! |
|
181 |
||
182 |
initialize |
|
183 |
super initialize. |
|
184 |
borderWidth := 0 |
|
185 |
! ! |
|
186 |
||
187 |
!InputView methodsFor:'redefined dummy'! |
|
188 |
||
189 |
setViewBackground |
|
1241 | 190 |
"dummy - inputviews have no background" |
130 | 191 |
|
192 |
^ self |
|
193 |
! ! |
|
194 |
||
449 | 195 |
!InputView class methodsFor:'documentation'! |
130 | 196 |
|
197 |
version |
|
1241 | 198 |
^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.18 1999-09-20 06:58:44 cg Exp $' |
130 | 199 |
! ! |