author | Claus Gittinger <cg@exept.de> |
Sat, 19 Jun 1999 00:52:33 +0200 | |
changeset 1190 | 91cf6653901e |
parent 1185 | 522d9c84f0a9 |
child 1241 | 414114cfc5cc |
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:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
88 |
eventReceiver buttonMotion:state x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
89 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
90 |
super buttonMotion:state x:x y:y |
0 | 91 |
] |
92 |
! |
|
93 |
||
94 |
buttonPress:button x:x y:y |
|
21 | 95 |
"redefined to forward event" |
96 |
||
0 | 97 |
eventReceiver notNil ifTrue:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
98 |
eventReceiver buttonPress:button x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
99 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
100 |
super buttonPress:button x:x y:y |
0 | 101 |
] |
102 |
! |
|
103 |
||
104 |
buttonRelease:button x:x y:y |
|
21 | 105 |
"redefined to forward event" |
106 |
||
0 | 107 |
eventReceiver notNil ifTrue:[ |
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
108 |
eventReceiver buttonRelease:button x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
109 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
110 |
super buttonRelease:button x:x y:y |
0 | 111 |
] |
112 |
! |
|
113 |
||
130 | 114 |
exposeX:x y:y width:w height:h |
115 |
"will never be received" |
|
116 |
^ self |
|
117 |
! |
|
118 |
||
0 | 119 |
focusIn |
21 | 120 |
"redefined to forward event" |
121 |
||
0 | 122 |
eventReceiver notNil ifTrue:[ |
99 | 123 |
eventReceiver focusIn |
0 | 124 |
] |
125 |
! |
|
126 |
||
127 |
focusOut |
|
21 | 128 |
"redefined to forward event" |
129 |
||
0 | 130 |
eventReceiver notNil ifTrue:[ |
99 | 131 |
eventReceiver focusOut |
0 | 132 |
] |
133 |
! |
|
134 |
||
130 | 135 |
keyPress:key x:x y:y |
136 |
"redefined to forward event" |
|
137 |
||
138 |
eventReceiver notNil ifTrue:[ |
|
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
139 |
eventReceiver keyPress:key x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
140 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
141 |
super keyPress:key x:x y:y |
130 | 142 |
] |
143 |
! |
|
144 |
||
145 |
keyRelease:key x:x y:y |
|
146 |
"redefined to forward event" |
|
147 |
||
148 |
eventReceiver notNil ifTrue:[ |
|
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
149 |
eventReceiver keyRelease:key x:x y:y |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
150 |
] ifFalse:[ |
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
151 |
super keyRelease:key x:x y:y |
130 | 152 |
] |
153 |
! |
|
154 |
||
0 | 155 |
pointerEnter:state x:x y:y |
21 | 156 |
"redefined to forward event" |
157 |
||
0 | 158 |
eventReceiver notNil ifTrue:[ |
99 | 159 |
eventReceiver pointerEnter:state x:x y:y |
0 | 160 |
] |
161 |
! |
|
162 |
||
163 |
pointerLeave:state |
|
21 | 164 |
"redefined to forward event" |
165 |
||
0 | 166 |
eventReceiver notNil ifTrue:[ |
99 | 167 |
eventReceiver pointerLeave:state |
0 | 168 |
] |
169 |
! ! |
|
130 | 170 |
|
171 |
!InputView methodsFor:'initialization'! |
|
172 |
||
173 |
initialize |
|
174 |
super initialize. |
|
175 |
borderWidth := 0 |
|
176 |
! ! |
|
177 |
||
178 |
!InputView methodsFor:'redefined dummy'! |
|
179 |
||
180 |
setViewBackground |
|
181 |
"inputviews have no background" |
|
182 |
||
183 |
^ self |
|
184 |
! ! |
|
185 |
||
449 | 186 |
!InputView class methodsFor:'documentation'! |
130 | 187 |
|
188 |
version |
|
1185
522d9c84f0a9
fix: if no delegate, perform normal (superclass)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
189 |
^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.17 1999-06-05 22:13:26 cg Exp $' |
130 | 190 |
! ! |