author | ca |
Fri, 27 Oct 2000 15:14:29 +0200 | |
changeset 3342 | 231e57cb7936 |
parent 3300 | d7b046ccbb33 |
child 3343 | 8a9d1c4aa460 |
permissions | -rw-r--r-- |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
All Rights Reserved |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
|
3211 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
15 |
GraphicsMedium subclass:#DisplaySurface |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
16 |
instanceVariableNames:'viewBackground cursor eventMask middleButtonMenu keyCommands |
3152 | 17 |
gotExpose backed flags delegate updateRegion' |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
classVariableNames:'' |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
19 |
poolDictionaries:'' |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
category:'Graphics-Support' |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
23 |
DeviceHandle subclass:#DeviceViewHandle |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
24 |
instanceVariableNames:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
25 |
classVariableNames:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
26 |
poolDictionaries:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
27 |
privateIn:DisplaySurface |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
28 |
! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
29 |
|
1093 | 30 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
copyright |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
COPYRIGHT (c) 1992 by Claus Gittinger |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
All Rights Reserved |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
This software is furnished under a license and may be used |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
only in accordance with the terms of that license and with the |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
inclusion of the above copyright notice. This software may not |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
be provided or otherwise made available to, or used by, any |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
other person. No title to or ownership of the software is |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
hereby transferred. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
43 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
45 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
46 |
documentation |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
47 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
this abstract class describes stuff common to any Window on a display |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
49 |
device. i.e. RootWindow, TopWindows, PopUps and Subwindows. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
50 |
That is, they have a viewBackground, cursor etc. and especially events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
51 |
A special feature is the delegate field, which allows key- and button |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
52 |
events to be stolen from a view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
If the delegate is non-nil, these events will be sent to it instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
54 |
So you can change a views behavior even if it was not initially designed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
55 |
for it. Also, controller functionality could be simulated using delegates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
56 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
[instance variables:] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
59 |
viewBackground <Color|Form|Image> the views background |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
61 |
cursor <Cursor> the cursor |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
62 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
63 |
eventMask mask specifying the enabled |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
64 |
events. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
65 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
66 |
middleButtonMenu a popup menu for the middle |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
67 |
button. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
68 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
69 |
keyCommands not yet supported |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
70 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
71 |
gotExpose for exposure handling after |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
72 |
exposePending after a scroll |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
73 |
|
3152 | 74 |
backed one of #always, #whenMapped or #never |
75 |
corresponds to X's backing store |
|
76 |
mechanism. |
|
77 |
May be ignored by other devices. |
|
78 |
||
79 |
flags flag bits |
|
80 |
||
81 |
saveUnder bit 1; 1 if saveunder store for |
|
82 |
that view is enabled |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
83 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
84 |
delegate for event delegation |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
85 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
86 |
[see also:] |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
87 |
DeviceWorkstation |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
88 |
WindowGroup |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
89 |
StandardSYstemView SimpleView View |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
90 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
91 |
[author:] |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
92 |
Claus Gittinger |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
93 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
94 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
95 |
|
3152 | 96 |
!DisplaySurface class methodsFor:'initialization'! |
97 |
||
98 |
initialize |
|
99 |
SaveUnderFlagMask := 1. |
|
100 |
! ! |
|
101 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
102 |
!DisplaySurface methodsFor:'accessing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
103 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
104 |
depth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
105 |
"return the depth in pixels of the view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
106 |
Notice, that this is currently the devices depth, |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
107 |
but support for mixed depth views is being prepared. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
(especially useful on SGI, with 24bit view)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
109 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
110 |
^ device depth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
111 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
112 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
113 |
insideColor:aColor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
114 |
"set the views background color - ST-80 compatibility" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
self viewBackground:aColor. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
self background:aColor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
119 |
|
2142
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
120 |
keyboardMap |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
121 |
"by default, use my devices standard mapping. |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
122 |
However, subclasses may redefine this, to return their own |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
123 |
keyboard map (for example a terminalView may want treat CTRL-C as regular key)" |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
124 |
|
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
125 |
^ device keyboardMap |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
126 |
! |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
127 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
128 |
setViewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
129 |
"install the viewBackground for the receiver on the device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
130 |
|
1236 | 131 |
|id devBgPixmap bgPixmap w h colorMap |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
132 |
pixmapDepth deviceDepth defBG| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
133 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
134 |
drawableId notNil ifTrue:[ |
2720 | 135 |
viewBackground isColor ifTrue:[ |
136 |
viewBackground := viewBackground onDevice:device. |
|
137 |
id := viewBackground colorId. |
|
138 |
" |
|
139 |
a real color (i.e. one supported by the device) ? |
|
140 |
" |
|
141 |
id notNil ifTrue:[ |
|
142 |
device setWindowBackground:id in:drawableId. |
|
143 |
^ self |
|
144 |
]. |
|
145 |
" |
|
146 |
no, a dithered one - must have a dither-pattern |
|
147 |
(which is ready for the device, since viewBackground |
|
148 |
is already assigned to the device) |
|
149 |
" |
|
150 |
bgPixmap := viewBackground ditherForm. |
|
151 |
] ifFalse:[ |
|
152 |
" |
|
153 |
assume, it can convert itself to a form |
|
154 |
" |
|
155 |
bgPixmap := viewBackground asFormOn:device |
|
156 |
]. |
|
157 |
||
158 |
" |
|
159 |
must now have: |
|
160 |
a dithered color or bitmap or pixmap |
|
161 |
" |
|
162 |
bgPixmap isNil ifTrue:[ |
|
163 |
'DisplaySurface [warning]: background not convertable - ignored' errorPrintCR. |
|
164 |
^ self |
|
165 |
]. |
|
166 |
||
167 |
"/ if the device does not support background pixmaps, |
|
168 |
"/ set the backgroundColor to the default background. |
|
169 |
"/ this will avoid flicker in win32 systems, |
|
170 |
"/ since that background is drawn directly in the |
|
171 |
"/ devices expose event handling. |
|
172 |
"/ (in contrast, the pixmap filling is done by the |
|
173 |
"/ window itself in its expose event handler) |
|
174 |
||
175 |
(device supportsViewBackgroundPixmap:bgPixmap) ifFalse:[ |
|
176 |
defBG := View defaultViewBackgroundColor. |
|
177 |
defBG isColor ifTrue:[ |
|
178 |
defBG := defBG onDevice:device. |
|
179 |
id := defBG colorId. |
|
180 |
id notNil ifTrue:[ |
|
181 |
device setWindowBackground:id in:drawableId. |
|
182 |
]. |
|
183 |
]. |
|
184 |
^ self |
|
185 |
]. |
|
186 |
||
187 |
w := bgPixmap width. |
|
188 |
h := bgPixmap height. |
|
189 |
||
190 |
deviceDepth := device depth. |
|
191 |
pixmapDepth := bgPixmap depth. |
|
192 |
||
193 |
(pixmapDepth ~~ deviceDepth) ifTrue:[ |
|
194 |
(pixmapDepth ~~ 1) ifTrue:[ |
|
195 |
self error:'bad dither depth (must be one or devices depth)'. |
|
196 |
^ self |
|
197 |
]. |
|
198 |
||
199 |
" |
|
200 |
convert it into a deep form |
|
201 |
" |
|
202 |
colorMap := bgPixmap colorMap. |
|
203 |
devBgPixmap := Form width:w height:h depth:deviceDepth on:device. |
|
204 |
devBgPixmap isNil ifTrue:[ |
|
205 |
'DisplaySurface [warning]: could not create a device form for viewBackground' infoPrintCR. |
|
206 |
^ self |
|
207 |
]. |
|
208 |
devBgPixmap paint:(colorMap at:1). |
|
209 |
devBgPixmap fillRectangleX:0 y:0 width:w height:h. |
|
210 |
devBgPixmap foreground:(colorMap at:2) background:(colorMap at:1). |
|
211 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
212 |
bgPixmap := devBgPixmap. |
|
213 |
] ifFalse:[ |
|
214 |
(pixmapDepth == 1) ifTrue:[ |
|
215 |
" |
|
216 |
although depth matches, |
|
217 |
values in the dither are to be interpreted via the ditherForms |
|
218 |
colormap, which is not always the same as blackpixel/whitepixel ... |
|
219 |
" |
|
220 |
colorMap := bgPixmap colorMap. |
|
221 |
(colorMap at:1) colorId == device whitepixel ifTrue:[ |
|
222 |
(colorMap at:2) colorId == device blackpixel ifTrue:[ |
|
223 |
" |
|
224 |
ok, can use it |
|
225 |
" |
|
226 |
device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId. |
|
227 |
^ self |
|
228 |
] |
|
229 |
]. |
|
230 |
||
231 |
" |
|
232 |
no, must invert it |
|
233 |
" |
|
234 |
devBgPixmap := Form width:w height:h depth:deviceDepth on:device. |
|
235 |
devBgPixmap paint:(colorMap at:2) on:(colorMap at:1). |
|
236 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
237 |
bgPixmap := devBgPixmap. |
|
238 |
] |
|
239 |
]. |
|
240 |
device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
] |
1134 | 242 |
|
2637
0741956eb752
pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents:
2632
diff
changeset
|
243 |
"Modified: / 4.5.1999 / 18:42:22 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
"return the viewBackground" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
^ viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
viewBackground:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
255 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
color, which is used with opaque drawing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
257 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
258 |
viewBackground ~~ something ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
viewBackground := something. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
drawableId notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
261 |
self setViewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
262 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
265 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
266 |
viewBackgroundAndClear:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
268 |
and clear the View. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
269 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
270 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
color, which is used with opaque drawing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
273 |
self viewBackground:something. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
274 |
self clear. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
275 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
276 |
"Created: 27.4.1996 / 14:09:08 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
278 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
279 |
viewGravity |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
"return the views gravity" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
281 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
282 |
^ #NorthWest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
283 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
285 |
viewOrigin |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
286 |
"0@0 here, since by default we cannot be scrolled" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
287 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
288 |
^ 0 @ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
289 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
290 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
widget |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
292 |
"ST-80 compatibility" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
293 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
294 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
295 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
296 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
297 |
!DisplaySurface methodsFor:'accessing-cursor'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
298 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
299 |
cursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
300 |
"return the views cursor" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
301 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
302 |
^ cursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
303 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
304 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
305 |
cursor:aCursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
306 |
"set the views cursor. This cursor will be automatically displayed whenever |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
307 |
the mouse-pointer enters the receiver. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
308 |
Cursors are typically set at view creation time and left as installed." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
309 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
310 |
self cursor:aCursor now:true |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
311 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
312 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
|v| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
314 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
315 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
316 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
317 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
318 |
[v shown] whileFalse:[Processor yield]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
319 |
[v shown] whileTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
320 |
(Delay forSeconds:1) wait. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
321 |
v cursor:(Cursor normal). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
322 |
(Delay forSeconds:1) wait. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
323 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
324 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
325 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
326 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
327 |
"Modified: 14.12.1995 / 21:28:14 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
328 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
329 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
330 |
cursor:aCursor now:showImmediately |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
331 |
"set the views cursor. This cursor will be automatically displayed whenever |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
332 |
the mouse-pointer enters the receiver. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
333 |
Cursors are typically set at view creation time and left as installed." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
334 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
335 |
aCursor notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
336 |
(aCursor ~~ cursor) ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
337 |
cursor := aCursor. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
338 |
drawableId notNil ifTrue:[ |
1960 | 339 |
self setCursor. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
340 |
(showImmediately and:[realized]) ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
341 |
"flush, to make cursor immediately visible" |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
342 |
device flush |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
343 |
] |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
344 |
] |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
345 |
] |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
346 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
347 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
348 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
349 |
|v| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
350 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
351 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
352 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
353 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
354 |
[v shown] whileFalse:[Processor yield]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
355 |
[v shown] whileTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
356 |
(Delay forSeconds:1) wait. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
357 |
v cursor:(Cursor normal). |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
358 |
(Delay forSeconds:1) wait. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
359 |
v cursor:(Cursor wait). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
360 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
361 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
362 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
363 |
"Created: 14.12.1995 / 21:28:00 / cg" |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
364 |
"Modified: 28.3.1997 / 13:47:58 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
365 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
366 |
|
1960 | 367 |
setCursor |
368 |
|id| |
|
369 |
||
370 |
drawableId notNil ifTrue:[ |
|
3070 | 371 |
cursor isNil ifTrue:[ ^ self]. |
1960 | 372 |
cursor := cursor onDevice:device. |
373 |
cursor isNil ifTrue:[ ^ self]. |
|
374 |
||
375 |
id := cursor id. |
|
376 |
id isNil ifTrue:[ |
|
377 |
'DisplaySurface [warning]: nil cursorId ignored; shape=' errorPrint. |
|
378 |
cursor shape errorPrintCR. |
|
379 |
^ self. |
|
380 |
]. |
|
381 |
device setCursor:id in:drawableId. |
|
382 |
] |
|
383 |
! |
|
384 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
withCursor:aCursor do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
"evaluate aBlock showing aCursor until ready; then restore the old cursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
and return the value as returned by aBlock. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
388 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
Notice, that this method only changes the cursor for a SINGLE (sub-)view. |
1337 | 390 |
Most applications want to have the cursor changed in all of its views. |
391 |
Use 'aView windowGroup withCursor:do:' or 'aView topView withCursor:do:' |
|
392 |
to acomplish this." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
|savedCursor| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
|
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
396 |
cursor == aCursor ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
397 |
^ aBlock value |
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
398 |
]. |
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
399 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
savedCursor := cursor. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
401 |
self cursor:aCursor. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
^ aBlock valueNowOrOnUnwindDo:[self cursor:savedCursor] |
1337 | 403 |
|
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
404 |
"Modified: 27.2.1997 / 17:20:43 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
405 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
406 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
407 |
withExecuteCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
408 |
"evaluate aBlock while showing an execute cursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
409 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
^ self withCursor:(Cursor execute) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
412 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
413 |
"Created: 10.1.1996 / 13:53:03 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
414 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
415 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
416 |
withReadCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
"evaluate aBlock while showing a readCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
420 |
^ self withCursor:(Cursor read) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
421 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
422 |
"Modified: 14.12.1995 / 20:57:40 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
423 |
"Created: 10.1.1996 / 13:52:52 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
425 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
426 |
withWaitCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
427 |
"evaluate aBlock while showing a waitCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
428 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
429 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
430 |
^ self withCursor:(Cursor wait) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
431 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
432 |
"Created: 10.1.1996 / 13:51:08 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
433 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
434 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
435 |
!DisplaySurface methodsFor:'accessing-hierarchy'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
436 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
437 |
delegate |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
"return the delegate - thats the one getting keyboard and button events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
439 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
440 |
^ delegate |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
441 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
442 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
443 |
delegate:someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
444 |
"set the delegate - keyboard- and button events will be forwarded to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
that object if it is interested in them. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
See the sendEvent... method in WindowEvent." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
448 |
delegate := someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
449 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
450 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
451 |
superView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
"return the superView - nil here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
453 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
454 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
topComponent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
"return the topView - that the one with no superview" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
"Created: 9.5.1996 / 01:39:43 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
463 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
464 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
465 |
topView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
"return the topView - that the one with no superview" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
471 |
!DisplaySurface methodsFor:'accessing-limits'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
472 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
473 |
maxExtent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
474 |
"return the views maximum extent - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
475 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
476 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
477 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
478 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
479 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
maxExtent:extent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
481 |
"set the views maximum extent - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
482 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
483 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
484 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
485 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
486 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
487 |
minExtent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
"return the views minimum extent - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
489 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
490 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
491 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
492 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
493 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
494 |
minExtent:extent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
495 |
"set the views minimum extent - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
496 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
497 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
498 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
500 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
!DisplaySurface methodsFor:'accessing-misc'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
503 |
backingStore:how |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
"turn on/off backingStore (saving my pixels) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
how may true/false, but also #always, #whenMapped or #never." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
how ~~ backed ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
backed := how. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
509 |
drawableId notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
510 |
device setBackingStore:how in:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
511 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
512 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
514 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
"return a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
517 |
this is X-specific and will be removed / replaced by symbolic values)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
^ eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
520 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
521 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
eventMask:aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
523 |
"set a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
524 |
this is X-specific and will be removed / replaced by symbolic values)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
526 |
eventMask := aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
528 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
529 |
getKeyboardFocus |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
"tell the Display to assign keyboard focus to the receiver" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
drawableId notNil ifTrue:[ |
3342 | 533 |
self shown ifTrue:[ |
2512 | 534 |
"/ self requestFocus. |
3342 | 535 |
device setInputFocusTo:drawableId. |
536 |
] ifFalse:[ |
|
537 |
'DisplaySurface [warning]: getKeyboardFocus: not shown' errorPrintCR. |
|
538 |
] |
|
539 |
] ifFalse:[ |
|
540 |
'DisplaySurface [warning]: getKeyboardFocus: no drawable' errorPrintCR. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
541 |
]. |
2512 | 542 |
|
543 |
"Modified: / 15.3.1999 / 08:25:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
|
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
546 |
isInputOnly |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
"return true, if the receiver is an input only view - that is: |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
548 |
the view will realize as a transparent view, into which you cannot |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
549 |
draw, but get events as usual. Thich can be used to catch events away from |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
others, which where never meant to work in such a setup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
(for example, if you want to manipulate views in some DrawTool-like manner). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
This uses a special X feature, which might not be supported in the near future |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
or on other plattforms." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
555 |
^ false |
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
556 |
|
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
557 |
"Created: 1.6.1996 / 13:21:51 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
559 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
560 |
preferredDepth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
"return a non nil integer, if a specific depth is wanted in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
Return nil if we do not care (i.e. the displays default is wanted). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
preferredVisual |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
"return a non nil id, if a specific visual is wanted in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
Return nil if we do not care (i.e. the displays default is wanted). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
571 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
572 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
573 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
574 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
575 |
|
3152 | 576 |
saveUnder |
577 |
"return the saveUnder flag" |
|
578 |
||
579 |
^ flags bitTest:SaveUnderFlagMask |
|
580 |
! |
|
581 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
582 |
saveUnder:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
583 |
"turn on/off saveUnder (saving pixels under myself) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
584 |
- used for temporary views (i.e. PopUps and ModalBoxes)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
585 |
|
3152 | 586 |
flags := flags changeBit:SaveUnderFlagMask to:aBoolean. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
587 |
drawableId notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
588 |
device setSaveUnder:aBoolean in:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
589 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
590 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
591 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
592 |
!DisplaySurface methodsFor:'accessing-names'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
593 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
594 |
icon |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
595 |
"return the views icon - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
596 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
597 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
598 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
599 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
600 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
601 |
icon:aBitmap |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
602 |
"set the views icon - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
603 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
604 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
605 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
606 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
607 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
608 |
iconLabel |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
609 |
"return the views icon label - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
610 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
611 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
612 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
613 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
614 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
615 |
iconLabel:aLabel |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
"set the views icon label - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
617 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
618 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
619 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
620 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
621 |
|
1481 | 622 |
iconMask |
623 |
"return the views iconMask - this is nil here. |
|
624 |
Only standardSystemViews may support labels and icons." |
|
625 |
||
626 |
^ nil |
|
627 |
! |
|
628 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
629 |
iconView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
630 |
"return the views iconView - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
631 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
632 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
633 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
634 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
635 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
636 |
iconView:aView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
637 |
"set the views icon view - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
638 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
639 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
640 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
641 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
label |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
"return the views label - this is nil here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
647 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
648 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
649 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
650 |
label:aLabel |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
651 |
"set the views label - ignored here. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
652 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
653 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
654 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
656 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
657 |
!DisplaySurface methodsFor:'binary storage'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
658 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
readBinaryContentsFrom: stream manager: manager |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
"tell the newly restored View to recreate itself. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
661 |
Bug: does not work correctly yet. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
662 |
(restored view looses its position & wg process)" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
663 |
|
1216 | 664 |
|wasRealized| |
665 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
666 |
super readBinaryContentsFrom: stream manager: manager. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
667 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
668 |
gcId := nil. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
669 |
drawableId := nil. |
1216 | 670 |
wasRealized := realized. |
671 |
realized := false. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
672 |
self recreate. |
1216 | 673 |
wasRealized ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
674 |
self remap |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
675 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
676 |
|
1216 | 677 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
" |
1216 | 679 |
|s l| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
680 |
s := 'storedLabel.boss' asFilename writeStream binary. |
1216 | 681 |
l := (Label label:'hello there') realize. |
682 |
Delay waitForSeconds:1. |
|
683 |
l storeBinaryOn:s. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
684 |
s close. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
685 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
686 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
687 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
688 |
|s l| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
689 |
s := 'storedLabel.boss' asFilename writeStream binary. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
690 |
(l := Label label:'hello there') open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
691 |
(Delay forSeconds:10) wait. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
692 |
l storeBinaryOn:s. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
693 |
s close. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
694 |
l destroy. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
695 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
696 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
697 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
698 |
|s| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
699 |
s := 'storedLabel.boss' asFilename readStream binary. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
700 |
(Object readBinaryFrom:s) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
701 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
702 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
703 |
"Modified: 3.5.1996 / 23:59:38 / stefan" |
1216 | 704 |
"Modified: 14.2.1997 / 15:42:55 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
705 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
706 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
707 |
!DisplaySurface methodsFor:'button menus'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
708 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
709 |
middleButtonMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
710 |
"return the menu associated with the middle mouse button" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
711 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
712 |
^ middleButtonMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
713 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
714 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
715 |
middleButtonMenu:aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
716 |
"associate aMenu with the middle mouse button" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
717 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
718 |
middleButtonMenu notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
719 |
middleButtonMenu destroy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
720 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
721 |
middleButtonMenu := aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
722 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
setMiddleButtonMenu:aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
"associate aMenu with the middle mouse button. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
Do not destroy old menu if any" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
728 |
middleButtonMenu := aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
729 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
730 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
731 |
!DisplaySurface methodsFor:'drawing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
732 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
733 |
clearDeviceRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
734 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
736 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
737 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
|oldPaint org| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
|
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
740 |
viewBackground isColor ifFalse:[ |
2720 | 741 |
gcId notNil ifTrue:[ |
742 |
org := self viewOrigin. |
|
743 |
device setMaskOriginX:org x rounded negated |
|
744 |
y:org y rounded negated |
|
745 |
in:gcId |
|
746 |
]. |
|
747 |
(device supportsMaskedDrawingWith:viewBackground) ifFalse:[ |
|
748 |
self fillDeviceRectangleWithViewBackgroundX:x y:y width:w height:h. |
|
749 |
^ self. |
|
750 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
751 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
752 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
753 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
754 |
fill in device coordinates - not logical coordinates |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
755 |
" |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
756 |
oldPaint := paint. |
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
757 |
self paint:viewBackground. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
758 |
self fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground". |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
759 |
self paint:oldPaint |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
760 |
|
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
761 |
"Modified: / 4.5.1999 / 13:00:34 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
762 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
763 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
764 |
clearRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
765 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
766 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
767 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
768 |
|
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
769 |
|pX pY pW pH| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
770 |
|
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
771 |
transformation notNil ifTrue:[ |
2720 | 772 |
pX := transformation applyToX:x. |
773 |
pY := transformation applyToY:y. |
|
774 |
pW := transformation applyScaleX:w. |
|
775 |
pH := transformation applyScaleY:h. |
|
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
776 |
] ifFalse:[ |
2720 | 777 |
pX := x. |
778 |
pY := y. |
|
779 |
pW := w. |
|
780 |
pH := h. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
781 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
782 |
|
2393
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
783 |
pX := pX rounded. |
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
784 |
pY := pY rounded. |
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
785 |
pW := pW rounded. |
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
786 |
pH := pH rounded. |
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
787 |
|
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
788 |
^ self clearDeviceRectangleX:pX y:pY width:pW height:pH. |
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
789 |
|
2393
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
790 |
"Modified: / 30.10.1998 / 15:00:37 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
791 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
792 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
793 |
fillDeviceRectangleWithPattern:aPixmap x:xIn y:yIn width:wIn height:hIn patternOffset:pattOffs |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
794 |
"fill a rectangular area with some pattern. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
795 |
A helper for devices which do not support pixmap drawing |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
796 |
(i.e. win95). |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
797 |
This is never invoked with X11 or Win-NT systems. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
798 |
Caller must ensure that aPixmap is really a form" |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
799 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
800 |
|r b |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
801 |
pW "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
802 |
pH "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
803 |
xR0 |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
804 |
xR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
805 |
yR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
806 |
xE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
807 |
yE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
808 |
oldFg oldBg oldClip x y w h fg bg clrMap |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
809 |
offsX "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
810 |
offsY "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
811 |
oX "{ Class: SmallInteger }" |
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
812 |
oY "{ Class: SmallInteger }"| |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
813 |
|
2640
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
814 |
x := xIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
815 |
y := yIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
816 |
w := wIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
817 |
h := hIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
818 |
|
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
819 |
x := x max:0. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
820 |
y := y max:0. |
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
821 |
r := (xIn + w - 1) min:(width - 1). |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
822 |
b := (yIn + h - 1) min:(height - 1). |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
823 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
824 |
pW := aPixmap width. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
825 |
pH := aPixmap height. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
826 |
|
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
827 |
oldClip := self clippingRectangleOrNil. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
828 |
|
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
829 |
oldClip notNil ifTrue:[ |
2720 | 830 |
x := x max:oldClip left. |
831 |
y := y max:oldClip top. |
|
832 |
r := r min:oldClip right. |
|
833 |
b := b min:oldClip bottom. |
|
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
834 |
]. |
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
835 |
w := r-x+1. |
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
836 |
h := b-y+1. |
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
837 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
838 |
yR := (y // pH) * pH. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
839 |
yE := y+h. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
840 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
841 |
yR >= yE ifTrue:[^ self]. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
842 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
843 |
xR0 := (x // pW) * pW. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
844 |
xE := x+w. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
845 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
846 |
xR0 >= yE ifTrue:[^ self]. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
847 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
848 |
aPixmap depth == 1 ifTrue:[ |
2720 | 849 |
oldFg := foreground. |
850 |
oldBg := background. |
|
851 |
(clrMap := aPixmap colorMap) notNil ifTrue:[ |
|
852 |
bg := clrMap at:1. |
|
853 |
fg := clrMap at:2. |
|
854 |
] ifFalse:[ |
|
855 |
bg := Color white. |
|
856 |
fg := Color black. |
|
857 |
]. |
|
858 |
self foreground:fg background:bg. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
859 |
]. |
2342
48d850a7844c
care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents:
2341
diff
changeset
|
860 |
self deviceClippingRectangle:(x@y extent:w@h). |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
861 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
862 |
offsX := xR0 + pattOffs x \\ pW. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
863 |
offsY := yR + pattOffs y \\ pH. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
864 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
865 |
oY := offsY. |
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
866 |
[yR < yE] whileTrue:[ |
2720 | 867 |
xR := xR0. |
868 |
oX := offsX. |
|
869 |
[xR < xE] whileTrue:[ |
|
870 |
self |
|
871 |
copyFrom:aPixmap |
|
872 |
x:oX y:oY |
|
873 |
toX:xR y:yR |
|
874 |
width:(pW - oX) height:(pH - oY) |
|
875 |
async:true. |
|
876 |
xR := xR + pW - oX. |
|
877 |
oX := 0. |
|
878 |
]. |
|
879 |
yR := yR + pH - oY. |
|
880 |
oY := 0. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
881 |
]. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
882 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
883 |
oldFg notNil ifTrue:[ |
2720 | 884 |
self foreground:oldFg background:oldBg. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
885 |
]. |
2342
48d850a7844c
care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents:
2341
diff
changeset
|
886 |
self deviceClippingRectangle:oldClip. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
887 |
|
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
888 |
"Created: / 6.9.1998 / 14:00:50 / cg" |
2640
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
889 |
"Modified: / 4.5.1999 / 20:38:07 / ps" |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
890 |
"Modified: / 4.5.1999 / 20:40:12 / cg" |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
891 |
! |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
892 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
893 |
fillDeviceRectangleWithViewBackgroundX:xIn y:yIn width:wIn height:hIn |
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
894 |
"fill a rectangular area with the viewBackground. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
895 |
A helper for devices which do not support background pixmaps |
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
896 |
(i.e. win95 screens). |
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
897 |
This is never invoked with X or Win-NT systems. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
898 |
Caller must ensure that the viewBackground is really a form" |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
899 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
900 |
self |
2720 | 901 |
fillDeviceRectangleWithPattern:viewBackground |
902 |
x:xIn y:yIn width:wIn height:hIn |
|
903 |
patternOffset:self viewOrigin |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
904 |
|
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
905 |
! |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
906 |
|
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
907 |
fillRectangleWithPattern:aPixmap x:x y:y width:w height:h patternOffset:pattOffs |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
908 |
"fill a rectangular area with aPixmap. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
909 |
A helper for devices which do not support pixmap filling |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
910 |
(i.e. win95 screens). |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
911 |
This is never invoked with X11 or Win-NT systems. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
912 |
Caller must ensure that the aPixmap is really a form" |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
913 |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
914 |
|pX pY nW nH| |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
915 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
916 |
gcId isNil ifTrue:[ |
2720 | 917 |
self initGC |
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
918 |
]. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
919 |
transformation notNil ifTrue:[ |
2720 | 920 |
pX := transformation applyToX:x. |
921 |
pY := transformation applyToY:y. |
|
922 |
nW := transformation applyScaleX:w. |
|
923 |
nH := transformation applyScaleY:h. |
|
924 |
nW < 0 ifTrue:[ |
|
925 |
nW := nW abs. |
|
926 |
pX := pX - nW. |
|
927 |
]. |
|
928 |
nH < 0 ifTrue:[ |
|
929 |
nH := nH abs. |
|
930 |
pY := pY - nH. |
|
931 |
]. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
932 |
] ifFalse:[ |
2720 | 933 |
pX := x. |
934 |
pY := y. |
|
935 |
nW := w. |
|
936 |
nH := h. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
937 |
]. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
938 |
pX := pX rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
939 |
pY := pY rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
940 |
nW := nW rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
941 |
nH := nH rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
942 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
943 |
self |
2720 | 944 |
fillDeviceRectangleWithPattern:aPixmap |
945 |
x:pX y:pY width:nW height:nH |
|
946 |
patternOffset:pattOffs |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
947 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
948 |
"Modified: 4.6.1996 / 17:58:49 / cg" |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
949 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
950 |
! |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
951 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
952 |
fillRectangleWithViewBackgroundX:x y:y width:w height:h |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
953 |
"fill a rectangular area with the viewBackground. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
954 |
A helper for devices which do not support background pixmaps |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
955 |
(i.e. win95 screens). |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
956 |
This is never invoked with X or Win-NT systems. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
957 |
Caller must ensure that the viewBackground is really a form" |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
958 |
|
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
959 |
self |
2720 | 960 |
fillRectangleWithPattern:viewBackground |
961 |
x:x y:y width:w height:h |
|
962 |
patternOffset:self viewOrigin |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
963 |
|
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
964 |
! |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
965 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
966 |
redraw |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
967 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
968 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
969 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
970 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
971 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
972 |
!DisplaySurface methodsFor:'enable/disable events'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
973 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
974 |
compressMotionEvents:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
975 |
"enable/disable motion event compression |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
976 |
(i.e. replacing all motion events by the last one). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
977 |
Compression makes almost always sense, except when |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
978 |
doing things like freehand drawing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
979 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
980 |
|s| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
981 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
982 |
(s := self sensor) notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
983 |
s compressMotionEvents:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
984 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
985 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
986 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
987 |
disableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
988 |
"disable all button events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
989 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
990 |
self disableEvent:#buttonPress; disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
991 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
992 |
"Modified: 29.4.1996 / 11:09:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
993 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
994 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
995 |
disableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
996 |
"disable button motion-while-button-is-pressed events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
997 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
998 |
self disableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
999 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1000 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1001 |
disableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1002 |
"disable button press events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1003 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1004 |
self disableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1005 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1006 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1007 |
disableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1008 |
"disable button release events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1009 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1010 |
self disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1011 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1012 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1013 |
disableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1014 |
"disable both mouse-pointer enter and leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1015 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1016 |
self disableEvent:#enter; disableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1017 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1018 |
"Modified: 29.4.1996 / 11:09:37 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1019 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1020 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1021 |
disableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1022 |
"disable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1023 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1024 |
for a list of allowed event symbols see Workstation class" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1025 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1026 |
eventMask := eventMask bitAnd:(device eventMaskFor:anEventSymbol) bitInvert. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1027 |
drawableId notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1028 |
device setEventMask:eventMask in:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1029 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1030 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1031 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1032 |
disableMotionEvents |
1332 | 1033 |
"disable mouse-pointer motion events" |
1034 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1035 |
self disableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1036 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1037 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1038 |
enableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1039 |
"enable both mouse button press and release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1040 |
These are enabled by default anyway." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1041 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1042 |
self enableEvent:#buttonPress; enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1043 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1044 |
"Modified: 29.4.1996 / 11:09:46 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1045 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1046 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1047 |
enableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1048 |
"enable mouse-pointer motion-while-button-is-pressed events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1049 |
These are enabled by default anyway." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1050 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1051 |
self enableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1052 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1053 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1054 |
enableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1055 |
"enable mouse button press events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1056 |
These are enabled by default anyway." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1057 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1058 |
self enableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1059 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1060 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1061 |
enableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1062 |
"enable mouse button release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1063 |
These are enabled by default anyway." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1064 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1065 |
self enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1066 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1067 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1068 |
enableEnterEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1069 |
"enable mouse-pointer enter events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1070 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1071 |
self enableEvent:#enter |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1072 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1073 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1074 |
enableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1075 |
"enable both mouse-pointer enter and leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1076 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1077 |
self enableEvent:#enter; enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1078 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1079 |
"Modified: 29.4.1996 / 11:09:55 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1080 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1081 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1082 |
enableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1083 |
"enable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1084 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1085 |
for a list of allowed event symbols see Workstation class" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1086 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1087 |
eventMask := eventMask bitOr:(device eventMaskFor:anEventSymbol). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1088 |
drawableId notNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1089 |
device setEventMask:eventMask in:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1090 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1091 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1092 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1093 |
enableFocusEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1094 |
"enable keyboard focus change events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1095 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1096 |
self enableEvent:#focusChange |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1097 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1098 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1099 |
enableKeyEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1100 |
"this is a compatibility leftover - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1101 |
starting with 2.10.3, keyPress is always enabled to allow |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1102 |
^C processing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1103 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1104 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1105 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1106 |
enableKeyPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1107 |
"this is a compatibility leftover - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1108 |
starting with 2.10.3, keyPress is always enabled to allow |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1109 |
^C processing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1110 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1111 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1112 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1113 |
enableKeyReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1114 |
"enable key release events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1115 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1116 |
self enableEvent:#keyRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1117 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1118 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1119 |
enableLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1120 |
"enable mouse-pointer leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1121 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1122 |
self enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1123 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1124 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1125 |
enableMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1126 |
"enable mouse-pointer motion events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1127 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1128 |
self enableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1129 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1130 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1131 |
!DisplaySurface methodsFor:'event dispatching'! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1132 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1133 |
dispatchEvent:event |
2962 | 1134 |
"dispatch an event" |
1135 |
||
1136 |
^ self |
|
3152 | 1137 |
dispatchEvent:event |
1138 |
withFocusOn:nil |
|
1139 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1140 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1141 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1142 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1143 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1144 |
dispatchEvent:type arguments:arguments |
2962 | 1145 |
"dispatch an event" |
1146 |
||
3094 | 1147 |
"/ XXXX: TO BE ELIMINATED |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1148 |
^ self |
3152 | 1149 |
dispatchEvent:nil |
1150 |
type:type |
|
1151 |
arguments:arguments |
|
1152 |
withFocusOn:nil |
|
1153 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1154 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1155 |
"Modified: / 20.5.1998 / 22:50:31 / cg" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1156 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1157 |
|
3094 | 1158 |
dispatchEvent:ev type:type arguments:argArray withFocusOn:focusView delegate:doDelegate |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1159 |
"dispatch the event represented by type and arguments either to my delegate, |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1160 |
or to my controller (which may be myself, if I implement the controller functionality myself). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1161 |
If focusView is nonNil, and it is a keyboard event, it is forwarded to this |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1162 |
view (but not if there was a delegate in the first place). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1163 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1164 |
If doDelegate is true, keyboard and button events are forwarded to a |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1165 |
delegate object (if non-nil). DoDelegate may be passed as true, to |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1166 |
handle events which are already delegated. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1167 |
If there is a delegate, only messages which are understood by it are |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1168 |
forwarded. Also, the delegate is asked if it is willing to handle the event |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1169 |
before. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1170 |
Delegated messages get the original view as an extra argument. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1171 |
Delegation has higher priority than both controller or focusView |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1172 |
forwarding." |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1173 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1174 |
|delegate selector delegateMessage delegateQuery |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1175 |
eventReceiver controller deviceMessage |
2129
530cc6e1b3b9
oops - uninitialized var used
Claus Gittinger <cg@exept.de>
parents:
2126
diff
changeset
|
1176 |
isKeyEvent isButtonEvent isPointerEvent |
3094 | 1177 |
rect x y w h delegatedEvent| |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1178 |
|
2498 | 1179 |
type == #damage ifTrue:[ |
3152 | 1180 |
self shown ifTrue:[ |
1181 |
rect := argArray. |
|
1182 |
x := rect left. |
|
1183 |
y := rect top. |
|
1184 |
w := rect width. |
|
1185 |
h := rect height. |
|
1186 |
transformation notNil ifTrue:[ |
|
1187 |
self deviceExposeX:x y:y width:w height:h |
|
1188 |
] ifFalse:[ |
|
1189 |
self exposeX:x y:y width:w height:h |
|
1190 |
] |
|
1191 |
]. |
|
1192 |
^ self |
|
2498 | 1193 |
]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1194 |
|
2498 | 1195 |
isKeyEvent := isButtonEvent := isPointerEvent := false. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1196 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1197 |
(type == #'keyPress:x:y:') ifTrue:[ |
3152 | 1198 |
isKeyEvent := true. |
1199 |
deviceMessage := #'deviceKeyPress:x:y:'. |
|
1200 |
delegateMessage := #'keyPress:x:y:view:'. |
|
1201 |
delegateQuery := #'handlesKeyPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1202 |
] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[ |
3152 | 1203 |
isKeyEvent := true. |
1204 |
deviceMessage := #'deviceKeyRelease:x:y:'. |
|
1205 |
delegateMessage := #'keyRelease:x:y:view:'. |
|
1206 |
delegateQuery := #'handlesKeyRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1207 |
] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[ |
3152 | 1208 |
isButtonEvent := true. |
1209 |
deviceMessage := #'deviceButtonMotion:x:y:'. |
|
1210 |
delegateMessage := #'buttonMotion:x:y:view:'. |
|
1211 |
delegateQuery := #'handlesButtonMotion:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1212 |
] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[ |
3152 | 1213 |
isButtonEvent := true. |
1214 |
deviceMessage := #'deviceButtonPress:x:y:'. |
|
1215 |
delegateMessage := #'buttonPress:x:y:view:'. |
|
1216 |
delegateQuery := #'handlesButtonPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1217 |
] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[ |
3152 | 1218 |
isButtonEvent := true. |
1219 |
deviceMessage := #'deviceButtonRelease:x:y:'. |
|
1220 |
delegateMessage := #'buttonRelease:x:y:view:'. |
|
1221 |
delegateQuery := #'handlesButtonRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1222 |
] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[ |
3152 | 1223 |
isButtonEvent := true. |
1224 |
deviceMessage := #'deviceButtonShiftPress:x:y:'. |
|
1225 |
delegateMessage := #'buttonShiftPress:x:y:view:'. |
|
1226 |
delegateQuery := #'handlesButtonShiftPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1227 |
] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[ |
3152 | 1228 |
isButtonEvent := true. |
1229 |
deviceMessage := #'deviceButtonMultiPress:x:y:'. |
|
1230 |
delegateMessage := #'buttonMultiPress:x:y:view:'. |
|
1231 |
delegateQuery := #'handlesButtonMultiPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1232 |
] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[ |
3152 | 1233 |
isPointerEvent := true. |
1234 |
deviceMessage := #'devicePointerEnter:x:y:'. |
|
1235 |
delegateMessage := #'pointerEnter:x:y:view:'. |
|
1236 |
delegateQuery := #'handlesPointerEnter:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1237 |
] ifFalse:[ (type == #'pointerLeave:') ifTrue:[ |
3152 | 1238 |
isPointerEvent := true. |
1239 |
deviceMessage := type. |
|
1240 |
delegateMessage := #'pointerLeave:view:'. |
|
1241 |
delegateQuery := #'handlesPointerLeave:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1242 |
] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[ |
3152 | 1243 |
deviceMessage := #'deviceExposeX:y:width:height:'. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1244 |
] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[ |
3152 | 1245 |
deviceMessage := #'deviceGraphicsExposeX:y:width:height:final:'. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1246 |
]]]]]]]]]]]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1247 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1248 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1249 |
if there is a focusView, and its a keyboard event, pass it |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1250 |
to that view (or its controller, or its delegate). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1251 |
In this case, a coordinate which is outside of |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1252 |
the focusView (0 @ 0) is passed as x/y coordinates. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1253 |
" |
2708 | 1254 |
(focusView notNil and:[self ~~ focusView]) ifTrue:[ |
3152 | 1255 |
(isKeyEvent or:[type == #mouseWheelMotion:x:y:amount:deltaTime:]) ifTrue:[ |
1256 |
delegatedEvent := ev shallowCopy. |
|
1257 |
delegatedEvent delegatedFrom:ev. |
|
3094 | 1258 |
|
3152 | 1259 |
isKeyEvent ifTrue:[ |
1260 |
delegatedEvent arguments:(Array with:(argArray at:1) with:-1 with:-1) |
|
1261 |
]. |
|
1262 |
focusView |
|
1263 |
dispatchEvent:delegatedEvent |
|
1264 |
withFocusOn:nil |
|
1265 |
delegate:doDelegate. |
|
1266 |
^ self |
|
1267 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1268 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1269 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1270 |
doDelegate ifTrue:[ |
3152 | 1271 |
" |
1272 |
handle delegated messages |
|
1273 |
" |
|
1274 |
(isKeyEvent |
|
1275 |
or:[isButtonEvent |
|
1276 |
or:[isPointerEvent]]) ifTrue:[ |
|
1277 |
delegate := self delegate. |
|
1278 |
||
1279 |
" |
|
1280 |
what a kludge - sending to delegate requires |
|
1281 |
another selector and an additional argument ... |
|
1282 |
" |
|
1283 |
(delegate notNil |
|
1284 |
and:[delegate respondsTo:delegateMessage]) ifTrue:[ |
|
1285 |
" |
|
1286 |
is the delegate interested in that event ? |
|
1287 |
(if it does not respond to the handlesXXX message, |
|
1288 |
we assume: NO) |
|
1289 |
" |
|
1290 |
((delegate respondsTo:delegateQuery) |
|
1291 |
and:[delegate perform:delegateQuery with:(argArray at:1) with:self]) ifTrue:[ |
|
1292 |
" |
|
1293 |
mhmh ... have to convert to logical coordinates |
|
1294 |
" |
|
1295 |
transformation notNil ifTrue:[ |
|
1296 |
argArray size > 2 ifTrue:[ |
|
1297 |
argArray at:2 put:(transformation applyInverseToX:(argArray at:2)). |
|
1298 |
argArray at:3 put:(transformation applyInverseToY:(argArray at:3)). |
|
1299 |
]. |
|
1300 |
]. |
|
1301 |
argArray isNil ifTrue:[ |
|
1302 |
delegate perform:delegateMessage with:self |
|
1303 |
] ifFalse:[ |
|
1304 |
delegate perform:delegateMessage withArguments:(argArray copyWith:self) |
|
1305 |
]. |
|
1306 |
^ self |
|
1307 |
] |
|
1308 |
]. |
|
1309 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1310 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1311 |
|
2708 | 1312 |
" |
1313 |
if I am not shown, ignore input events |
|
1314 |
" |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1315 |
(isKeyEvent |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1316 |
or:[isButtonEvent |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1317 |
or:[isPointerEvent]]) ifTrue:[ |
3152 | 1318 |
realized ifFalse:[ |
1319 |
^ self |
|
1320 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1321 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1322 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1323 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1324 |
if there is a controller, that one gets all user events |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1325 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1326 |
eventReceiver := self. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1327 |
(controller := self controller) notNil ifTrue:[ |
3152 | 1328 |
(isKeyEvent |
1329 |
or:[isButtonEvent |
|
1330 |
or:[isPointerEvent |
|
1331 |
or:[(type == #focusIn) |
|
1332 |
or:[(type == #focusOut)]]]]) ifTrue:[ |
|
1333 |
eventReceiver := controller. |
|
1334 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1335 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1336 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1337 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1338 |
finally, another one: |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1339 |
if I have a transformation, edit the selector from #foo to #deviceFoo... |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1340 |
This allows for the event to be handled either in device or |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1341 |
logical coordinates. (since the deviceFoo-messages default implementation |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1342 |
in DisplaySurface translates and resends). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1343 |
Actually, I could always send deviceXXX without speed penalty |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1344 |
(event sending is no high frequency operation), but that just adds |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1345 |
another context to any debuggers walkback, making things less clear. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1346 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1347 |
selector := type. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1348 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1349 |
transformation notNil ifTrue:[ |
3152 | 1350 |
(isKeyEvent |
1351 |
or:[isButtonEvent |
|
1352 |
or:[isPointerEvent |
|
1353 |
or:[(type == #'exposeX:y:width:height:') |
|
1354 |
or:[(type == #'graphicsExposeX:y:width:height:final:')]]]]) ifTrue:[ |
|
1355 |
selector := deviceMessage |
|
1356 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1357 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1358 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1359 |
eventReceiver perform:selector withArguments:argArray |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1360 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1361 |
"Created: / 20.5.1998 / 22:46:25 / cg" |
2708 | 1362 |
"Modified: / 21.5.1999 / 19:55:31 / cg" |
2962 | 1363 |
! |
1364 |
||
1365 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
1366 |
"dispatch the event" |
|
1367 |
||
1368 |
^ self |
|
3152 | 1369 |
dispatchEvent:event |
1370 |
withFocusOn:focusViewOrNil |
|
1371 |
delegate:true |
|
3094 | 1372 |
|
1373 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
|
1374 |
! |
|
1375 |
||
1376 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
1377 |
"dispatch the event" |
|
1378 |
||
1379 |
^ self |
|
3152 | 1380 |
dispatchEvent:event |
1381 |
type:event type |
|
1382 |
arguments:(event arguments) |
|
1383 |
withFocusOn:focusViewOrNil |
|
1384 |
delegate:doDelegate |
|
2962 | 1385 |
|
1386 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1387 |
! ! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1388 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1389 |
!DisplaySurface methodsFor:'event handling'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1390 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1391 |
activateMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1392 |
"if there is a menu, show it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1393 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1394 |
middleButtonMenu notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1395 |
middleButtonMenu showAtPointer |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1396 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1397 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1398 |
"Created: 1.3.1996 / 13:24:55 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1399 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1400 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
buttonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
"mouse was moved while button is pressed - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1403 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1404 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1405 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1406 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1407 |
buttonMultiPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1408 |
"button was pressed fast after previous press - default to press-again" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1409 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1410 |
^ self buttonPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1411 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1412 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1413 |
buttonPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1414 |
"button was pressed - if its middle button and there is a menu, |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1415 |
show it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1416 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1417 |
((button == 2) or:[button == #menu]) ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1418 |
self activateMenu. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1419 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1420 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1421 |
"Modified: 1.3.1996 / 13:25:07 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1422 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1423 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1424 |
buttonRelease:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1425 |
"button was released - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1426 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1427 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1429 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1430 |
catchExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1431 |
"this MUST be sent BEFORE doing a bit-blt copy (i.e. copyFrom...), |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1432 |
to tell the sensor that incoming expose events are to be remembered. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1433 |
Sometime after the bit-blt, waitForExpose should be sent, to finally |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
suspend until the expose/noExpose event arrives. |
1332 | 1435 |
This is an X speciality - for devices which do not need this kind of |
1436 |
asynchronous bit-blt confirmation, this is a noop. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1439 |
|wg| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1440 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1441 |
device scrollsAsynchronous ifFalse:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1442 |
gotExpose := true. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1443 |
^ self |
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1444 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1445 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1446 |
self setGraphicsExposures:true. |
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1447 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1448 |
gotExpose := false. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1449 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1450 |
wg notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1451 |
" |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1452 |
must process eny pending expose events, since |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1453 |
usually the origin is changed soon so that previous |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1454 |
expose events coordinates are invalid |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1455 |
" |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1456 |
wg processRealExposeEventsFor:self. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1457 |
wg sensor catchExposeFor:self |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1458 |
] |
1245
4a4e15a3e4fd
pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents:
1236
diff
changeset
|
1459 |
|
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1460 |
"Modified: 6.8.1997 / 19:50:15 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1461 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1462 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1463 |
deviceButtonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1464 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1465 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1466 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1467 |
and send a #buttonMotion with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1468 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1469 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1470 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1471 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1472 |
should redefine #buttonMotion:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1473 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1474 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1475 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1476 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1477 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1478 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1479 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1480 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1481 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1482 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1483 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1484 |
self buttonMotion:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1485 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1486 |
"Modified: 20.5.1996 / 17:45:25 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1487 |
"Modified: 14.10.1996 / 22:25:12 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1488 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1489 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1490 |
deviceButtonMultiPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1491 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1492 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1493 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1494 |
and send a buttonMultiPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1495 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1496 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1497 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1498 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1499 |
should redefine #buttonMultiPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1500 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1501 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1502 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1503 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1504 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1505 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1506 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1507 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1508 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1509 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1510 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1511 |
self buttonMultiPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1512 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1513 |
"Modified: 20.5.1996 / 17:45:22 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1514 |
"Modified: 14.10.1996 / 22:25:22 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1515 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1516 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1517 |
deviceButtonPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1518 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1519 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1520 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1521 |
and send a buttonPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1522 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1523 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1524 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1525 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1526 |
should redefine #buttonPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1527 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1528 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1529 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1530 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1531 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1532 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1533 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1534 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1535 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1536 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1537 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1538 |
self buttonPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1539 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1540 |
"Modified: 20.5.1996 / 17:45:18 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1541 |
"Modified: 14.10.1996 / 22:25:30 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1542 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1543 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1544 |
deviceButtonRelease:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1545 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1546 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1547 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1548 |
and send a buttonRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1549 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1550 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1551 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1552 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1553 |
should redefine #buttonRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1554 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1555 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1556 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1557 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1558 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1559 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1560 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1561 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1562 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1563 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1564 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1565 |
self buttonRelease:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1566 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1567 |
"Modified: 20.5.1996 / 17:45:14 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1568 |
"Modified: 14.10.1996 / 22:25:37 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1569 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1570 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1571 |
deviceButtonShiftPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1572 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1573 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1574 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1575 |
and send a buttonShiftPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1576 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1577 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1578 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1579 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1580 |
should redefine #buttonShiftPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1581 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1582 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1583 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1584 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1585 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1586 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1587 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1588 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1589 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1590 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1591 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1592 |
self buttonShiftPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1593 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1594 |
"Modified: 20.5.1996 / 17:45:09 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1595 |
"Modified: 14.10.1996 / 22:25:49 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1596 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1597 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1598 |
deviceExposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1599 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1600 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1601 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1602 |
and send an expose with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1603 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1604 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1605 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1606 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1607 |
should redefine #exposeX:x:y:width:height:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1608 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1609 |
|lx ly lw lh| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1610 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1611 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1612 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1613 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1614 |
lh := h. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1615 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1616 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1617 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1618 |
lw := transformation applyInverseScaleX:lw. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1619 |
lh := transformation applyInverseScaleY:lh. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1620 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1621 |
self exposeX:lx y:ly width:lw height:lh |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1622 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1623 |
"Modified: 13.5.1996 / 11:31:44 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1624 |
"Modified: 14.10.1996 / 22:26:00 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1625 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1626 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1627 |
deviceGraphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1628 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1629 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1630 |
If there is a transformation, apply the inverse |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1631 |
and send a graphicsExpose with the logical coordinates. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1632 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1633 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1634 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1635 |
those which are interested in logical coordinates |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1636 |
should redefine #graphicsExposeX:x:y:width:height:" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1637 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1638 |
|lx ly lw lh| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1639 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1640 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1641 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1642 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1643 |
lh := h. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1644 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1645 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1646 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1647 |
lw := transformation applyInverseScaleX:lw. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1648 |
lh := transformation applyInverseScaleY:lh. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1649 |
]. |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1650 |
self graphicsExposeX:lx y:ly width:lw height:lh final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1651 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1652 |
"Modified: 13.5.1996 / 11:31:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1653 |
"Modified: 14.10.1996 / 22:26:08 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1654 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1655 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1656 |
deviceKeyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1657 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1658 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1659 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1660 |
and send a keyPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1661 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1662 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1663 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1664 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1665 |
should redefine #keyPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1666 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1667 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1668 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1669 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1670 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1671 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1672 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1673 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1674 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1675 |
] |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1676 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1677 |
self keyPress:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1678 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1679 |
"Modified: 20.5.1996 / 17:44:59 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1680 |
"Modified: 14.10.1996 / 22:26:17 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1681 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1682 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1683 |
deviceKeyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1684 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1685 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1686 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1687 |
and send a keyRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1688 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1689 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1690 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1691 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1692 |
should redefine #keyRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1693 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1694 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1695 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1696 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1697 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1698 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1699 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1700 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1701 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1702 |
] |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1703 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1704 |
self keyRelease:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1705 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1706 |
"Modified: 20.5.1996 / 17:44:42 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1707 |
"Modified: 14.10.1996 / 22:26:28 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1708 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1709 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1710 |
devicePointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1711 |
"this is the low-level (untransformed) event as received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1712 |
from the device (i.e. coordinates are in device coordinates). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1713 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1714 |
and send a pointerEnter with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1715 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1716 |
Views which are interested in deviceCoordinates should |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1717 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1718 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1719 |
should redefine #pointerEnter:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1720 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1721 |
|lx ly| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1722 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1723 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1724 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1725 |
transformation notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1726 |
lx notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1727 |
lx := transformation applyInverseToX:lx. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1728 |
ly := transformation applyInverseToY:ly. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1729 |
] |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1730 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1731 |
self pointerEnter:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1732 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1733 |
"Modified: 20.5.1996 / 17:44:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1734 |
"Modified: 14.10.1996 / 22:26:35 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1735 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1736 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1737 |
exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1738 |
"an expose event - nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1739 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1740 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1741 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1742 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1743 |
focusIn |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1744 |
"got keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1745 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1746 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1747 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1748 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1749 |
focusOut |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1750 |
"lost keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1751 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1752 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1753 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1754 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1755 |
graphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1756 |
"an expose event after a scroll - do normal redraw processing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1757 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1758 |
self exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1759 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1760 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1761 |
keyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1762 |
"a key was pressed in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1763 |
Here only keyCommands are handled - more action has to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1764 |
be implemented by redefining this method" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1765 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1766 |
|action| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1767 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1768 |
keyCommands notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1769 |
action := keyCommands at:key ifAbsent:[nil]. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1770 |
action notNil ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1771 |
action value |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1772 |
] |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1773 |
]. |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1774 |
key isSymbol ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1775 |
(key startsWith:#Basic) ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1776 |
"/ an unhandled BasicFoo key; |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1777 |
"/ retry as Foo |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1778 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1779 |
self keyPress:(key copyFrom:#Basic size) asSymbol x:x y:y |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1780 |
]. |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1781 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1782 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1783 |
"Modified: 6.11.1996 / 17:51:15 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1784 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1785 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1786 |
keyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1787 |
"default action is to do nothing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1788 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1789 |
key isSymbol ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1790 |
(key startsWith:#Basic) ifTrue:[ |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1791 |
"/ an unhandled BasicFoo key; |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1792 |
"/ retry as Foo |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1793 |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1794 |
self keyRelease:(key copyFrom:#Basic size) asSymbol x:x y:y |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1795 |
]. |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1796 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1797 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1798 |
^ self |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1799 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1800 |
"Modified: 6.11.1996 / 17:51:20 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1801 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1802 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1803 |
noExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1804 |
"a no expose event after a scroll (event-mode only)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1805 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1806 |
gotExpose := true |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1807 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1808 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1809 |
pointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1810 |
"mouse cursor entered view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1811 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1812 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1813 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1814 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1815 |
pointerLeave:state |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1816 |
"mouse cursor left view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1817 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1818 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1819 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1820 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1821 |
resizeRequest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1822 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1823 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1824 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1825 |
waitForExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1826 |
"wait until an expose event arrives (to wait for scroll-finish)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1827 |
|
2421 | 1828 |
|wg endPollTime pollDelay| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1829 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1830 |
device scrollsAsynchronous ifFalse:[ |
3152 | 1831 |
gotExpose := true. |
1832 |
^ self |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1833 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1834 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1835 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1836 |
wg notNil ifTrue:[ |
3152 | 1837 |
"/ |
1838 |
"/ a normal (suspendable) view. |
|
1839 |
"/ wait by doing a real wait |
|
1840 |
"/ |
|
1841 |
wg sensor waitForExposeFor:self |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1842 |
] ifFalse:[ |
3152 | 1843 |
"/ |
1844 |
"/ a pure event driven view. |
|
1845 |
"/ wait by doing a direct dispatch loop until the event arrives. |
|
1846 |
"/ i.e. poll for the event |
|
1847 |
"/ |
|
1848 |
device platformName = 'WIN32' ifTrue:[ |
|
1849 |
pollDelay := 1. |
|
1850 |
] ifFalse:[ |
|
1851 |
pollDelay := 3. |
|
1852 |
]. |
|
1853 |
endPollTime := AbsoluteTime now addSeconds:pollDelay. |
|
1854 |
||
1855 |
[gotExpose] whileFalse:[ |
|
1856 |
realized ifTrue:[ |
|
1857 |
(device exposeEventPendingFor:drawableId withSync:true) ifTrue:[ |
|
1858 |
device dispatchExposeEventFor:drawableId. |
|
1859 |
]. |
|
1860 |
]. |
|
1861 |
realized ifFalse:[ |
|
1862 |
gotExpose := true. |
|
1863 |
^ self |
|
1864 |
]. |
|
1865 |
||
1866 |
"/ break out of the poll after a while |
|
1867 |
||
1868 |
AbsoluteTime now > endPollTime ifTrue:[ |
|
1869 |
'DisplaySurface [warning]: lost expose event' errorPrintCR. |
|
1870 |
gotExpose := true. |
|
1871 |
^ self |
|
1872 |
]. |
|
1873 |
Processor yield. |
|
1874 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1875 |
] |
1129
2a3eaf218500
destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1876 |
|
2421 | 1877 |
"Modified: / 9.1.1999 / 01:58:09 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1878 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1879 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1880 |
!DisplaySurface methodsFor:'initialize / release'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1881 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1882 |
destroy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1883 |
"view is about to be destroyed - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1884 |
first destroy menu if there is one and also destroy the GC. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1885 |
then the view is physically destroyed." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1886 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1887 |
middleButtonMenu notNil ifTrue:[ |
2720 | 1888 |
middleButtonMenu destroy. |
1889 |
middleButtonMenu := nil |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1890 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1891 |
keyCommands := nil. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1892 |
gcId notNil ifTrue:[ |
2720 | 1893 |
device destroyGC:gcId. |
1894 |
gcId := nil |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1895 |
]. |
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1896 |
self destroyView. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1897 |
Lobby unregister:self. |
1129
2a3eaf218500
destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1898 |
|
1317 | 1899 |
"Modified: 8.2.1997 / 15:50:04 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1900 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1901 |
|
3290 | 1902 |
destroyGC |
1903 |
"physically destroy the gc." |
|
1904 |
||
1905 |
gcId notNil ifTrue:[ |
|
1906 |
device destroyGC:gcId. |
|
1907 |
gcId := nil |
|
1908 |
]. |
|
1909 |
! |
|
1910 |
||
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1911 |
destroyView |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1912 |
"physically destroy the view." |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1913 |
|
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1914 |
drawableId notNil ifTrue:[ |
2720 | 1915 |
device destroyView:self withId:drawableId. |
1916 |
drawableId := nil. |
|
1917 |
realized := false. |
|
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1918 |
]. |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1919 |
! |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1920 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1921 |
destroyed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1922 |
"view has been destroyed by someone else" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1923 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1924 |
drawableId notNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1925 |
device removeKnownView:self withId:drawableId. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1926 |
drawableId := nil. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1927 |
realized := false. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1928 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1929 |
self destroy |
1481 | 1930 |
|
1931 |
"Modified: 22.3.1997 / 14:56:34 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1932 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1933 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1934 |
initCursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1935 |
"default cursor for all views" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1936 |
|
2453 | 1937 |
cursor := Cursor normal |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1938 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1939 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1940 |
initStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1941 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1942 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1943 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1944 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1945 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1946 |
initialize |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
"initialize defaults" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1948 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1949 |
super initialize. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1950 |
|
2995 | 1951 |
device notNil ifTrue:[ |
3152 | 1952 |
eventMask := device defaultEventMask. |
2995 | 1953 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1954 |
viewBackground := background. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1955 |
backed := false. |
3152 | 1956 |
flags := 0. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1957 |
self initCursor |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1958 |
|
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1959 |
"Modified: 18.1.1997 / 18:09:41 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1960 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1961 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1962 |
reAdjustGeometry |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1963 |
"sent late during snapin processing, nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1964 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1965 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1966 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1967 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1968 |
recreate |
3300 | 1969 |
"recreate (i.e. tell X about me) after a snapin or a migration" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1970 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1971 |
viewBackground isColor ifTrue:[ |
3300 | 1972 |
viewBackground := viewBackground onDevice:device |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1973 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1974 |
super recreate. |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1975 |
cursor := cursor onDevice:device. |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1976 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1977 |
"Modified: 28.3.1997 / 13:48:06 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1978 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1979 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1980 |
reinitStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1981 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1982 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1983 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1984 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1985 |
|
3291 | 1986 |
releaseDeviceResources |
1987 |
self destroyGC. |
|
1988 |
self destroyView. |
|
1989 |
self unregisterFromLobby. |
|
1990 |
self setDevice:nil id:nil gcId:nil. |
|
1991 |
! |
|
1992 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1993 |
shallowCopyForFinalization |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1994 |
"redefined for faster creation of finalization copies |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
(only device, gcId and drawableId are needed)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1996 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1997 |
|aCopy| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1998 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1999 |
aCopy := DeviceViewHandle basicNew. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2000 |
aCopy setDevice:device id:drawableId gcId:gcId. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2001 |
^ aCopy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2002 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
"Created: 3.5.1996 / 15:35:13 / stefan" |
3290 | 2004 |
! |
2005 |
||
2006 |
unregisterFromLobby |
|
2007 |
Lobby unregister:self. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2008 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2009 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2010 |
!DisplaySurface methodsFor:'keyboard commands'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2011 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2012 |
addActionForKey:aKey action:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2013 |
"define a keyboard command function" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2014 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2015 |
keyCommands isNil ifTrue:[ |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2016 |
keyCommands := IdentityDictionary new |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2017 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2018 |
keyCommands at:aKey put:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2019 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2020 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2021 |
removeActionForKey:aKey |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2022 |
keyCommands notNil ifTrue:[ |
3211 | 2023 |
keyCommands removeKey:aKey ifAbsent:nil |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2024 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2025 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2026 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2027 |
!DisplaySurface methodsFor:'queries'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2028 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2029 |
buttonMotionEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2030 |
"return true, if a button motion event is pending. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2031 |
Normally, you dont want to use this, since no polling is needed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2032 |
(not even for mouse-tracking). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2033 |
Dont use it, since it does not honor the windowGroup, but |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2034 |
goes directly to the device instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2035 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2036 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2037 |
device flush. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2038 |
^ device eventPending:#buttonMotion for:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2039 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2040 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2041 |
buttonReleaseEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2042 |
"return true, if a button release event is pending. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2043 |
Dont use it, since it does not honor the windowGroup, but |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2044 |
goes directly to the device instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2045 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2046 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2047 |
device flush. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2048 |
^ device eventPending:#buttonRelease for:drawableId |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2049 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2050 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2051 |
exposeEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2052 |
"return true, if an expose event is pending." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2053 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2054 |
|sensor| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
|
2352 | 2056 |
((sensor := self sensor) notNil and:[sensor hasExposeEventFor:self]) ifTrue:[^ true]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2057 |
^ device eventPending:#expose for:drawableId |
2352 | 2058 |
|
2059 |
"Modified: / 15.9.1998 / 23:18:16 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2061 |
|
2010
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2062 |
isPopUpView |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2063 |
"return true, if this view should be put on top (raised) automatically. |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2064 |
usually this is true for alertBoxes etc." |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2065 |
|
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2066 |
^ false |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2067 |
|
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2068 |
"Created: / 22.1.1998 / 15:01:32 / stefan" |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2069 |
! |
5ac34bc91075
Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
2070 |
|
920 | 2071 |
isRootView |
2072 |
"return true, if the receiver is a root view |
|
2073 |
false is returned here, this is only redefined in DisplayRootView." |
|
2074 |
||
2075 |
^ false |
|
2076 |
||
2077 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2078 |
"Created: 5.7.1996 / 14:58:55 / cg" |
|
2079 |
! |
|
2080 |
||
1481 | 2081 |
isTopView |
2082 |
"return true, if the receiver is some kind of topview; |
|
2083 |
false is returned here; redefined in some subclasses." |
|
2084 |
||
2085 |
^ false |
|
2086 |
||
2087 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2088 |
"Created: 22.3.1997 / 14:45:29 / cg" |
|
2089 |
! |
|
2090 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2091 |
isView |
734 | 2092 |
"return true, if the receiver is some kind of view; |
2093 |
true is returned here." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2094 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2095 |
^ true |
734 | 2096 |
|
2097 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2098 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2099 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2100 |
isXtWidget |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2101 |
^ false |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2102 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2103 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2104 |
redrawsFull |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2105 |
^ false |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2106 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2107 |
"Created: 4.3.1996 / 14:17:22 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2108 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2109 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2110 |
!DisplaySurface methodsFor:'queries-contents'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2111 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2112 |
heightOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2113 |
"return the height of the contents in pixels. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2114 |
Since we dont know here, just return the views size. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2115 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2116 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2117 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2118 |
^ self height |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2119 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2120 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2121 |
widthOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
"return the width of the contents in pixels. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2123 |
Since we dont know here, just return the views size. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2125 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2126 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2127 |
^ self width |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2128 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2129 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2130 |
xOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2131 |
"return the x-origin of the contents in pixels. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2132 |
Since we dont know here, just return 0 for left. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2135 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2136 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2137 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2138 |
yOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
"return the y-origin of the contents in pixels. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2140 |
Since we dont know here, just return 0 for top. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2141 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2142 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2143 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2144 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2145 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2146 |
!DisplaySurface methodsFor:'selection handling '! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2147 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2148 |
getSelection |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2149 |
"return the object selection - either the local one, or the displays |
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2150 |
clipBoard buffer." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2151 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2152 |
|sel| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2153 |
|
1133 | 2154 |
sel := device getCopyBuffer. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2155 |
sel isNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2156 |
sel := device getSelectionFor:drawableId. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2157 |
sel isNil ifTrue:[^ nil]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2158 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2159 |
^ sel |
1133 | 2160 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2161 |
"Modified: 13.2.1997 / 13:18:50 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2163 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2164 |
getTextSelection |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2165 |
"return the text selection - either the local one, or the displays |
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2166 |
clipBoard buffer." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2167 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2168 |
|sel| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
|
1133 | 2170 |
sel := device getCopyBuffer. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
sel isNil ifTrue:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2172 |
sel := device getTextSelectionFor:drawableId. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2173 |
sel isNil ifTrue:[^ nil]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
^ sel |
1133 | 2176 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2177 |
"Modified: 13.2.1997 / 13:19:26 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2178 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2179 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2180 |
pasteFromClipBoard:aString |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2181 |
"this is sent from the display as a reply to a request for a |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
selection. The view should be prepared to paste the received |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2183 |
string (it asked for it so that should not be a problem)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2184 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2185 |
self paste:aString |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2186 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2187 |
"Created: 13.2.1997 / 13:06:11 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2188 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2189 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
setSelection:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2191 |
"set the object selection - both the local one, and tell the display |
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2192 |
that we have changed it (i.e. place it into the clipBoard)." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2193 |
|
1133 | 2194 |
device setLastCopyBuffer:nil. |
2195 |
device setCopyBuffer:something. |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2196 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2197 |
(device setSelection:something owner:drawableId) ifFalse:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2198 |
'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2199 |
] |
1133 | 2200 |
|
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2201 |
"Modified: 13.2.1997 / 13:19:51 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2202 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2204 |
setTextSelection:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2205 |
"set the text selection - both the local one, and tell the display |
1342
d2bcd2e582aa
most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
2206 |
that we have changed it (i.e. place it into the clipBoard)." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
|s| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2209 |
|
1133 | 2210 |
device setLastCopyBuffer:nil. |
2211 |
device setCopyBuffer:something. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
s := something. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
s isString ifFalse:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2214 |
s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
]. |
2196
f78bbe9789b0
always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
2216 |
|
f78bbe9789b0
always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
2217 |
"/ for now - should add support to pass emphasis information too |
f78bbe9789b0
always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
2218 |
s := s string. |
f78bbe9789b0
always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
2219 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2220 |
(device setTextSelection:s owner:drawableId) ifFalse:[ |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2221 |
'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
] |
1133 | 2223 |
|
2196
f78bbe9789b0
always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
2224 |
"Modified: / 16.7.1998 / 21:38:55 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2225 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
|
3276 | 2227 |
!DisplaySurface methodsFor:'user interaction & notifications'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2228 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2229 |
beep |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2230 |
"output an audible beep or bell on my screen device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2232 |
device beep; flush |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2234 |
"Created: 28.5.1996 / 16:16:13 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2235 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2236 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2237 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
showActivity:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
"this is sent indirectly by the activityNotification mechanism. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
Defined here as a fallback, if ever sent to non topviews." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2242 |
Transcript showCR:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
"Modified: 18.5.1996 / 15:44:33 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2247 |
!DisplaySurface::DeviceViewHandle class methodsFor:'documentation'! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2248 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2249 |
documentation |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2250 |
" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2251 |
This is used as a finalization handle for views - in previous systems, |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2252 |
a shallowCopy of a view was responsible to destroy the underlying |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2253 |
devices view. To make the memory requirements smaller and to speed up |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2254 |
view creation a bit, this lightweight class is used now, which only |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2255 |
keeps the device handle for finalization. |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2256 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2257 |
[see also:] |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2258 |
DisplaySurface |
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2259 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2260 |
[author:] |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
2261 |
Claus Gittinger |
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2262 |
" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2263 |
! ! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2264 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2265 |
!DisplaySurface::DeviceViewHandle methodsFor:'finalization'! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2266 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2267 |
disposed |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2268 |
"the view for which I am a handle was collected |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2269 |
- release system resources" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2270 |
|
2096 | 2271 |
|v id| |
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2272 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2273 |
drawableId notNil ifTrue:[ |
3152 | 2274 |
(id := gcId) notNil ifTrue:[ |
2275 |
gcId := nil. |
|
2276 |
device deviceIOErrorSignal handle:[:ex | |
|
2277 |
] do:[ |
|
2278 |
device destroyGC:id. |
|
2279 |
] |
|
2280 |
]. |
|
2281 |
||
2282 |
"/ care for lost-view trouble: |
|
2283 |
"/ if the windowID is still registered, |
|
2284 |
"/ this may be due to a not-yet-reclaimed |
|
2285 |
"/ subview of a view which has already been destroyed |
|
2286 |
"/ (X recycles window handles.) |
|
2287 |
"/ In this case, we arrive here with a nil-view argument, |
|
2288 |
"/ and a windowId, which is already reused for some other view. |
|
2289 |
"/ The situation is detected by finding a non-nil (and non-zero) |
|
2290 |
"/ view in the devices id<->view table for the given windowId. |
|
2291 |
||
2292 |
(device viewIdKnown:drawableId) ifTrue:[ |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2293 |
"/ 'Display [info]: recycled view (' infoPrint. v infoPrint. ') not destroyed: ' infoPrint. |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2294 |
"/ drawableId displayString infoPrintCR. |
3152 | 2295 |
drawableId := nil. |
2296 |
] ifFalse:[ |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2297 |
"/ 'GC destroy: ' print. drawableId displayString printCR. |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2298 |
"/ device checkKnownViewId:drawableId. |
3152 | 2299 |
id := drawableId. |
2300 |
drawableId := nil. |
|
2301 |
device deviceIOErrorSignal handle:[:ex | |
|
2302 |
] do:[ |
|
2303 |
device destroyView:nil withId:id. |
|
2304 |
] |
|
2305 |
] |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2306 |
]. |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2307 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2308 |
"Modified: 4.4.1997 / 11:01:48 / cg" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2309 |
"Created: 25.9.1997 / 10:01:46 / stefan" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2310 |
! ! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1884
diff
changeset
|
2311 |
|
1093 | 2312 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2313 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2314 |
version |
3342 | 2315 |
^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.82 2000-10-27 13:14:29 ca Exp $' |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
! ! |
3211 | 2317 |
DisplaySurface initialize! |