author | Claus Gittinger <cg@exept.de> |
Sat, 01 Mar 1997 23:15:10 +0100 | |
changeset 471 | 350583677b5b |
parent 449 | 9d18c9a66b59 |
child 521 | 2937b6c596b3 |
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 |
||
65 |
canDrop:anObjectOrCollection |
|
66 |
eventReceiver notNil ifTrue:[ |
|
67 |
^ eventReceiver canDrop:anObjectOrCollection |
|
68 |
]. |
|
69 |
^ false |
|
70 |
||
71 |
||
72 |
! |
|
73 |
||
74 |
drop:anObjectOrCollection at:aPoint |
|
75 |
eventReceiver notNil ifTrue:[ |
|
76 |
eventReceiver drop:anObjectOrCollection at:aPoint |
|
77 |
]. |
|
78 |
||
79 |
||
80 |
||
81 |
! ! |
|
82 |
||
0 | 83 |
!InputView methodsFor:'event handling'! |
84 |
||
130 | 85 |
buttonMotion:state x:x y:y |
21 | 86 |
"redefined to forward event" |
87 |
||
0 | 88 |
eventReceiver notNil ifTrue:[ |
130 | 89 |
eventReceiver buttonMotion:state x:x y:y |
0 | 90 |
] |
91 |
! |
|
92 |
||
93 |
buttonPress:button x:x y:y |
|
21 | 94 |
"redefined to forward event" |
95 |
||
0 | 96 |
eventReceiver notNil ifTrue:[ |
99 | 97 |
eventReceiver buttonPress:button x:x y:y |
0 | 98 |
] |
99 |
! |
|
100 |
||
101 |
buttonRelease:button x:x y:y |
|
21 | 102 |
"redefined to forward event" |
103 |
||
0 | 104 |
eventReceiver notNil ifTrue:[ |
99 | 105 |
eventReceiver buttonRelease:button x:x y:y |
0 | 106 |
] |
107 |
! |
|
108 |
||
130 | 109 |
exposeX:x y:y width:w height:h |
110 |
"will never be received" |
|
111 |
^ self |
|
112 |
! |
|
113 |
||
0 | 114 |
focusIn |
21 | 115 |
"redefined to forward event" |
116 |
||
0 | 117 |
eventReceiver notNil ifTrue:[ |
99 | 118 |
eventReceiver focusIn |
0 | 119 |
] |
120 |
! |
|
121 |
||
122 |
focusOut |
|
21 | 123 |
"redefined to forward event" |
124 |
||
0 | 125 |
eventReceiver notNil ifTrue:[ |
99 | 126 |
eventReceiver focusOut |
0 | 127 |
] |
128 |
! |
|
129 |
||
130 | 130 |
keyPress:key x:x y:y |
131 |
"redefined to forward event" |
|
132 |
||
133 |
eventReceiver notNil ifTrue:[ |
|
134 |
eventReceiver keyPress:key x:x y:y |
|
135 |
] |
|
136 |
! |
|
137 |
||
138 |
keyRelease:key x:x y:y |
|
139 |
"redefined to forward event" |
|
140 |
||
141 |
eventReceiver notNil ifTrue:[ |
|
142 |
eventReceiver keyRelease:key x:x y:y |
|
143 |
] |
|
144 |
! |
|
145 |
||
0 | 146 |
pointerEnter:state x:x y:y |
21 | 147 |
"redefined to forward event" |
148 |
||
0 | 149 |
eventReceiver notNil ifTrue:[ |
99 | 150 |
eventReceiver pointerEnter:state x:x y:y |
0 | 151 |
] |
152 |
! |
|
153 |
||
154 |
pointerLeave:state |
|
21 | 155 |
"redefined to forward event" |
156 |
||
0 | 157 |
eventReceiver notNil ifTrue:[ |
99 | 158 |
eventReceiver pointerLeave:state |
0 | 159 |
] |
160 |
! ! |
|
130 | 161 |
|
162 |
!InputView methodsFor:'initialization'! |
|
163 |
||
164 |
initialize |
|
165 |
super initialize. |
|
166 |
borderWidth := 0 |
|
167 |
! ! |
|
168 |
||
169 |
!InputView methodsFor:'redefined dummy'! |
|
170 |
||
171 |
setViewBackground |
|
172 |
"inputviews have no background" |
|
173 |
||
174 |
^ self |
|
175 |
! ! |
|
176 |
||
449 | 177 |
!InputView class methodsFor:'documentation'! |
130 | 178 |
|
179 |
version |
|
449 | 180 |
^ '$Header: /cvs/stx/stx/libview2/InputView.st,v 1.15 1997-02-25 13:25:19 ca Exp $' |
130 | 181 |
! ! |