author | Claus Gittinger <cg@exept.de> |
Wed, 22 Aug 2018 12:58:11 +0200 | |
changeset 8451 | 6eafe0433763 |
parent 8349 | 1a56a0337599 |
child 8467 | 0c1a2545c932 |
permissions | -rw-r--r-- |
8349 | 1 |
"{ Encoding: utf8 }" |
2 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
COPYRIGHT (c) 1992 by Claus Gittinger |
8259 | 5 |
All Rights Reserved |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
This software is furnished under a license and may be used |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
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
|
9 |
inclusion of the above copyright notice. This software may not |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
be provided or otherwise made available to, or used by, any |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
other person. No title to or ownership of the software is |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
hereby transferred. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
" |
3211 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
6770 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
GraphicsMedium subclass:#DisplaySurface |
8349 | 19 |
instanceVariableNames:'viewBackground cursor eventMask moreAttributes renderer uuid |
20 |
backed flags delegate updateRegion' |
|
21 |
classVariableNames:'GotExposeFlagMask SaveUnderFlagMask' |
|
22 |
poolDictionaries:'' |
|
23 |
category:'Graphics-Support' |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
25 |
|
1093 | 26 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
copyright |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
COPYRIGHT (c) 1992 by Claus Gittinger |
8259 | 31 |
All Rights Reserved |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
This software is furnished under a license and may be used |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
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
|
35 |
inclusion of the above copyright notice. This software may not |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
be provided or otherwise made available to, or used by, any |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
other person. No title to or ownership of the software is |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
hereby transferred. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
documentation |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
43 |
" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
44 |
this abstract class describes stuff common to any Window on a display |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
45 |
device. i.e. RootWindow, TopWindows, PopUps and Subwindows. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
46 |
That is, they have a viewBackground, cursor etc. and especially events. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
47 |
A special feature is the delegate field, which allows key- and button |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
48 |
events to be stolen from a view. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
49 |
If the delegate is non-nil, these events will be sent to it instead. |
8147 | 50 |
So you can change a view's behavior even if it was not initially designed |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
51 |
for it. Also, controller functionality could be simulated using delegates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
52 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
[instance variables:] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
54 |
|
7691 | 55 |
viewBackground <Color|Form|Image> the view's background |
56 |
||
57 |
cursor <Cursor> the cursor |
|
58 |
||
59 |
eventMask mask specifying the enabled |
|
60 |
events. |
|
61 |
||
62 |
moreAttributes optional dictionary, allowing for more attributes |
|
63 |
to be store there |
|
64 |
fields: |
|
65 |
middleButtonMenu a fix popup menu for the middle button. |
|
66 |
||
67 |
keyCommands not yet supported |
|
68 |
||
69 |
||
70 |
backed one of #always, #whenMapped or #never |
|
71 |
corresponds to X's backing store mechanism. |
|
72 |
May be ignored by other devices. |
|
73 |
||
74 |
flags flag bits |
|
75 |
||
76 |
saveUnder bit 1; 1 if saveunder store for |
|
77 |
that view is enabled |
|
78 |
||
79 |
gotExpose bit 2; 1 if an expose/noExpose event arrived |
|
80 |
(for exposure handling after a scroll) |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
81 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
82 |
delegate for event delegation |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
83 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
84 |
[see also:] |
7691 | 85 |
DeviceWorkstation |
86 |
WindowGroup |
|
87 |
StandardSYstemView SimpleView View |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
88 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
89 |
[author:] |
7691 | 90 |
Claus Gittinger |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
91 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
92 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
93 |
|
3152 | 94 |
!DisplaySurface class methodsFor:'initialization'! |
95 |
||
96 |
initialize |
|
97 |
SaveUnderFlagMask := 1. |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
98 |
GotExposeFlagMask := 2. |
3152 | 99 |
! ! |
100 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
101 |
!DisplaySurface methodsFor:'accessing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
102 |
|
4050 | 103 |
addUpdateRectangle:newRectangle |
4052 | 104 |
"return true, if the newRectangle is not already contained in the updateRegion |
105 |
(i.e. if it added any pixels to the region" |
|
106 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
107 |
|closure lastRect numRect lastTop lastBottom lastLeft lastRight |
4391 | 108 |
newTop newBottom newLeft newRight| |
4050 | 109 |
|
110 |
updateRegion isNil ifTrue:[ |
|
8259 | 111 |
updateRegion := OrderedCollection with:newRectangle. |
112 |
^ true |
|
4050 | 113 |
]. |
114 |
(updateRegion contains:[:oldRectangle | (newRectangle isContainedIn:oldRectangle)]) ifTrue:[ |
|
8259 | 115 |
^ false. |
4050 | 116 |
]. |
4052 | 117 |
|
4391 | 118 |
numRect := updateRegion size. |
5564
3db1b17c4ac6
changed: #addUpdateRectangle:
Claus Gittinger <cg@exept.de>
parents:
5541
diff
changeset
|
119 |
numRect > 20 ifTrue:[ |
8259 | 120 |
closure := updateRegion |
121 |
inject:newRectangle |
|
122 |
into:[:boundsSoFar :thisRectangle | |
|
123 |
boundsSoFar quickMerge:thisRectangle |
|
124 |
]. |
|
125 |
updateRegion := OrderedCollection with:closure. |
|
126 |
^ true |
|
4050 | 127 |
]. |
4052 | 128 |
|
4391 | 129 |
lastRect := updateRegion at:numRect. |
130 |
lastTop := lastRect top. |
|
131 |
lastBottom := lastRect bottom. |
|
132 |
lastLeft := lastRect left. |
|
133 |
lastRight := lastRect right. |
|
134 |
newTop := newRectangle top. |
|
135 |
newBottom := newRectangle bottom. |
|
136 |
newLeft := newRectangle left. |
|
137 |
newRight := newRectangle right. |
|
138 |
||
139 |
lastTop = newTop ifTrue:[ |
|
8259 | 140 |
lastBottom = newBottom ifTrue:[ |
141 |
lastLeft <= newLeft ifTrue:[ |
|
142 |
lastRight >= newLeft ifTrue:[ |
|
143 |
updateRegion at:numRect put:(lastRect copy right:newRight). |
|
144 |
^ false "/ true |
|
145 |
] |
|
146 |
] |
|
147 |
]. |
|
4391 | 148 |
]. |
149 |
lastLeft = newLeft ifTrue:[ |
|
8259 | 150 |
lastRight = newRight ifTrue:[ |
151 |
lastTop <= newTop ifTrue:[ |
|
152 |
lastBottom >= newTop ifTrue:[ |
|
153 |
updateRegion at:numRect put:(lastRect copy bottom:newBottom). |
|
154 |
^ false "/ true |
|
155 |
] |
|
156 |
] |
|
157 |
]. |
|
4391 | 158 |
]. |
159 |
||
4050 | 160 |
updateRegion add:newRectangle. |
161 |
^ true |
|
162 |
! |
|
163 |
||
7977 | 164 |
application |
165 |
"to be redefined in real widgets. |
|
166 |
Here nil is returned as fallback" |
|
167 |
||
168 |
^ nil |
|
169 |
||
170 |
"Created: / 15-03-2017 / 10:42:10 / cg" |
|
171 |
! |
|
172 |
||
7868 | 173 |
basicViewBackground:aColorOrFormOrViewBackground |
3699 | 174 |
"set the viewBackground to something, a color, image or form. |
175 |
The viewBackground is the color or pattern with which exposed |
|
176 |
regions are filled - do not confuse this with the drawing background |
|
177 |
color, which is used with opaque drawing." |
|
178 |
||
7868 | 179 |
viewBackground ~~ aColorOrFormOrViewBackground ifTrue:[ |
180 |
viewBackground := aColorOrFormOrViewBackground. |
|
181 |
self drawableId notNil ifTrue:[ |
|
182 |
self setViewBackground |
|
183 |
] |
|
3699 | 184 |
] |
7868 | 185 |
|
186 |
"Modified (format): / 12-02-2017 / 12:57:07 / cg" |
|
3699 | 187 |
! |
188 |
||
4043 | 189 |
controller |
190 |
"return nil - I have no controller" |
|
191 |
||
192 |
^ nil |
|
193 |
! |
|
194 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
195 |
depth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
196 |
"return the depth in pixels of the view. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
197 |
Notice, that this is currently the devices depth, |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
198 |
but support for mixed depth views is being prepared. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
199 |
(especially useful on SGI, with 24bit view)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
^ device depth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
202 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
203 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
204 |
insideColor:aColor |
7691 | 205 |
"set the view's background color - ST-80 compatibility" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
206 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
207 |
self viewBackground:aColor. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
208 |
self background:aColor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
209 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
210 |
|
2142
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
211 |
keyboardMap |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
212 |
"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
|
213 |
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
|
214 |
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
|
215 |
|
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
216 |
^ device keyboardMap |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
217 |
! |
200b8ac20fa5
return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
218 |
|
5541 | 219 |
renderer |
220 |
"warning: this is experimental and not yet implemented" |
|
221 |
^ renderer |
|
222 |
! |
|
223 |
||
224 |
renderer:something |
|
225 |
"warning: this is experimental and not yet implemented" |
|
226 |
renderer := something. |
|
227 |
! |
|
228 |
||
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
229 |
sensor |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
230 |
"I can only return a SynchronousWindowSensor, |
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
231 |
since I do not have a window group" |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
232 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
233 |
^ SynchronousWindowSensor new |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
234 |
! |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
235 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
setViewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
237 |
"install the viewBackground for the receiver on the device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
239 |
|id devBgPixmap bgPixmap w h colorMap |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
240 |
pixmapDepth deviceDepth defBG| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
242 |
self drawableId notNil ifTrue:[ |
7631 | 243 |
viewBackground isColor ifTrue:[ |
244 |
viewBackground := viewBackground onDevice:self graphicsDevice. |
|
245 |
id := viewBackground colorId. |
|
246 |
" |
|
247 |
a real color (i.e. one supported by the device) ? |
|
248 |
" |
|
249 |
id notNil ifTrue:[ |
|
250 |
self graphicsDevice setWindowBackground:id in:self drawableId. |
|
251 |
^ self |
|
252 |
]. |
|
253 |
" |
|
254 |
no, a dithered one - must have a dither-pattern |
|
255 |
(which is ready for the device, since viewBackground |
|
256 |
is already assigned to the device) |
|
257 |
" |
|
258 |
bgPixmap := viewBackground ditherForm. |
|
259 |
] ifFalse:[ |
|
260 |
viewBackground notNil ifTrue:[ |
|
261 |
viewBackground isViewBackground ifTrue:[ |
|
262 |
^ self. |
|
263 |
]. |
|
264 |
||
265 |
" |
|
266 |
assume, it can convert itself to a form |
|
267 |
" |
|
268 |
bgPixmap := viewBackground asFormOn:self graphicsDevice. |
|
269 |
bgPixmap isNil ifTrue:[ |
|
270 |
"/ assume it knows how to draw itself |
|
271 |
^ self |
|
272 |
]. |
|
273 |
]. |
|
274 |
]. |
|
275 |
||
276 |
" |
|
277 |
must now have: |
|
278 |
a dithered color or bitmap or pixmap |
|
279 |
" |
|
280 |
bgPixmap isNil ifTrue:[ |
|
281 |
'DisplaySurface [warning]: background not convertable - ignored' errorPrintCR. |
|
282 |
^ self |
|
283 |
]. |
|
284 |
||
285 |
"/ if the device does not support background pixmaps, |
|
286 |
"/ set the backgroundColor to the default background. |
|
287 |
"/ this will avoid flicker in win32 systems, |
|
288 |
"/ since that background is drawn directly in the |
|
289 |
"/ devices expose event handling. |
|
290 |
"/ (in contrast, the pixmap filling is done by the |
|
291 |
"/ window itself in its expose event handler) |
|
292 |
||
293 |
(self graphicsDevice supportsViewBackgroundPixmap:bgPixmap) ifFalse:[ |
|
294 |
defBG := View defaultViewBackgroundColor. |
|
295 |
defBG isColor ifTrue:[ |
|
296 |
defBG := defBG onDevice:self graphicsDevice. |
|
297 |
id := defBG colorId. |
|
298 |
id notNil ifTrue:[ |
|
299 |
self graphicsDevice setWindowBackground:id in:self drawableId. |
|
300 |
]. |
|
301 |
]. |
|
302 |
^ self |
|
303 |
]. |
|
304 |
||
305 |
w := bgPixmap width. |
|
306 |
h := bgPixmap height. |
|
307 |
||
308 |
deviceDepth := self depth. |
|
309 |
pixmapDepth := bgPixmap depth. |
|
310 |
||
311 |
(pixmapDepth ~~ deviceDepth) ifTrue:[ |
|
312 |
(pixmapDepth ~~ 1) ifTrue:[ |
|
313 |
'DisplaySurface [warning]: Bad dither depth (must be one or devices depth)' errorPrintCR. |
|
314 |
^ self |
|
315 |
]. |
|
316 |
||
317 |
" |
|
318 |
convert it into a deep form |
|
319 |
" |
|
320 |
colorMap := bgPixmap colorMap. |
|
321 |
devBgPixmap := Form width:w height:h depth:deviceDepth onDevice:self graphicsDevice. |
|
322 |
devBgPixmap isNil ifTrue:[ |
|
323 |
'DisplaySurface [warning]: could not create a device form for viewBackground' infoPrintCR. |
|
324 |
^ self |
|
325 |
]. |
|
326 |
devBgPixmap paint:(colorMap at:1). |
|
327 |
devBgPixmap fillRectangleX:0 y:0 width:w height:h. |
|
328 |
devBgPixmap foreground:(colorMap at:2) background:(colorMap at:1). |
|
329 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
330 |
bgPixmap := devBgPixmap. |
|
331 |
] ifFalse:[ |
|
332 |
(pixmapDepth == 1) ifTrue:[ |
|
333 |
" |
|
334 |
although depth matches, |
|
335 |
values in the dither are to be interpreted via the ditherForms |
|
336 |
colormap, which is not always the same as blackpixel/whitepixel ... |
|
337 |
" |
|
338 |
colorMap := bgPixmap colorMap. |
|
339 |
(colorMap at:1) colorId == self graphicsDevice whitepixel ifTrue:[ |
|
340 |
(colorMap at:2) colorId == self graphicsDevice blackpixel ifTrue:[ |
|
341 |
" |
|
342 |
ok, can use it |
|
343 |
" |
|
344 |
self graphicsDevice setWindowBackgroundPixmap:(bgPixmap drawableId) in:self drawableId. |
|
345 |
^ self |
|
346 |
] |
|
347 |
]. |
|
348 |
||
349 |
" |
|
350 |
no, must invert it |
|
351 |
" |
|
352 |
devBgPixmap := Form width:w height:h depth:deviceDepth onDevice:self graphicsDevice. |
|
353 |
devBgPixmap paint:(colorMap at:2) on:(colorMap at:1). |
|
354 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
355 |
bgPixmap := devBgPixmap. |
|
356 |
] |
|
357 |
]. |
|
358 |
self graphicsDevice setWindowBackgroundPixmap:(bgPixmap drawableId) in:self drawableId. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
359 |
] |
1134 | 360 |
|
5686 | 361 |
"Modified: / 23-01-2011 / 01:44:38 / cg" |
727
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 |
|
4041 | 364 |
updateRegion |
365 |
^ updateRegion |
|
366 |
! |
|
367 |
||
368 |
updateRegion:something |
|
369 |
updateRegion := something. |
|
370 |
! |
|
371 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
372 |
viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
373 |
"return the viewBackground" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
374 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
375 |
^ viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
376 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
377 |
|
7868 | 378 |
viewBackground:aColorOrFormOrViewBackground |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
379 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
380 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
381 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
color, which is used with opaque drawing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
|
7868 | 384 |
viewBackground ~~ aColorOrFormOrViewBackground ifTrue:[ |
385 |
self basicViewBackground:aColorOrFormOrViewBackground |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
] |
7868 | 387 |
|
388 |
"Modified (format): / 12-02-2017 / 12:57:01 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
391 |
viewBackgroundAndClear:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
and clear the View. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
color, which is used with opaque drawing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
398 |
self viewBackground:something. |
4070 | 399 |
self clearView. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
401 |
"Created: 27.4.1996 / 14:09:08 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
viewGravity |
7691 | 405 |
"return the view's gravity" |
727
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 |
^ #NorthWest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
408 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
409 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
viewOrigin |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
"0@0 here, since by default we cannot be scrolled" |
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 |
^ 0 @ 0 |
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 |
widget |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
"ST-80 compatibility" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
^ self |
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
420 |
! |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
421 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
422 |
windowClass:classString name:nameString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
423 |
gc windowClass:classString name:nameString. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
424 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
425 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
426 |
windowGroup |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
427 |
"return nil - I have no windowGroup" |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
428 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
429 |
^ nil |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
430 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
431 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
432 |
windowName:aString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
433 |
gc windowName:aString. |
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
436 |
!DisplaySurface methodsFor:'accessing-cursor'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
437 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
cursor |
7691 | 439 |
"return the view's cursor" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
440 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
441 |
^ cursor |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
444 |
cursor:aCursor |
7691 | 445 |
"set the view's cursor. This cursor will be automatically displayed whenever |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
446 |
the mouse-pointer enters the receiver. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
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
|
448 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
449 |
self cursor:aCursor now:true |
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 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
|v| |
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 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
[v shown] whileFalse:[Processor yield]. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
458 |
[v shown] whileTrue:[ |
7691 | 459 |
(Delay forSeconds:1) wait. |
460 |
v cursor:(Cursor normal). |
|
461 |
(Delay forSeconds:1) wait. |
|
462 |
v cursor:(Cursor wait). |
|
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
"Modified: 14.12.1995 / 21:28:14 / cg" |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
cursor:aCursor now:showImmediately |
7691 | 470 |
"set the view's cursor. This cursor will be automatically displayed whenever |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
471 |
the mouse-pointer enters the receiver. |
7691 | 472 |
Cursors are typically set at view creation time and left as installed. |
473 |
The showImmediately parameter controls if the request is to be buffered, |
|
474 |
or enforced immediately. Under XWindows, that makes a performance difference if many |
|
475 |
cursors (a whole group) are set, because the setting involves an XServer round trip." |
|
727
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 |
aCursor notNil ifTrue:[ |
7691 | 478 |
(aCursor ~~ cursor) ifTrue:[ |
479 |
cursor := aCursor. |
|
480 |
self drawableId notNil ifTrue:[ |
|
481 |
self setCursor. |
|
482 |
(showImmediately and:[realized]) ifTrue:[ |
|
483 |
"flush, to make cursor immediately visible" |
|
484 |
self flush |
|
485 |
] |
|
486 |
] |
|
487 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
489 |
|
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 |
|v| |
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 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
494 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
495 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
496 |
[v shown] whileFalse:[Processor yield]. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
497 |
[v shown] whileTrue:[ |
7691 | 498 |
(Delay forSeconds:1) wait. |
499 |
v cursor:(Cursor normal). |
|
500 |
(Delay forSeconds:1) wait. |
|
501 |
v cursor:(Cursor wait). |
|
727
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 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
"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
|
506 |
"Modified: 28.3.1997 / 13:47:58 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
|
1960 | 509 |
setCursor |
510 |
|id| |
|
511 |
||
6226 | 512 |
cursor isNil ifTrue:[ ^ self]. |
7268 | 513 |
cursor := cursor onDevice:device. |
6226 | 514 |
cursor isNil ifTrue:[ ^ self]. |
515 |
||
516 |
id := cursor id. |
|
517 |
id isNil ifTrue:[ |
|
8259 | 518 |
'DisplaySurface [warning]: nil cursorId ignored; shape=' errorPrint. |
519 |
cursor shape errorPrintCR. |
|
520 |
^ self. |
|
6226 | 521 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
522 |
gc setCursorId:id . |
1960 | 523 |
! |
524 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
withCursor:aCursor do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
526 |
"evaluate aBlock showing aCursor until ready; then restore the old cursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
and return the value as returned by aBlock. |
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 |
Notice, that this method only changes the cursor for a SINGLE (sub-)view. |
1337 | 530 |
Most applications want to have the cursor changed in all of its views. |
531 |
Use 'aView windowGroup withCursor:do:' or 'aView topView withCursor:do:' |
|
8254 | 532 |
to accomplish this." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
533 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
534 |
|savedCursor| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
535 |
|
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
536 |
cursor == aCursor ifTrue:[ |
7702 | 537 |
^ aBlock value |
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
538 |
]. |
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
539 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
savedCursor := cursor. |
7702 | 541 |
^ [ |
542 |
self cursor:aCursor now:true. |
|
543 |
aBlock value |
|
544 |
] ensure:[ |
|
545 |
self cursor:savedCursor now:true |
|
546 |
] |
|
1337 | 547 |
|
8254 | 548 |
"Modified: / 27-02-1997 / 17:20:43 / cg" |
549 |
"Modified (comment): / 17-01-2018 / 15:18:35 / mawalch" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
withExecuteCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
"evaluate aBlock while showing an execute cursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
555 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
556 |
^ self withCursor:(Cursor execute) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
557 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
"Created: 10.1.1996 / 13:53:03 / cg" |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
withReadCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
"evaluate aBlock while showing a readCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
Return the value as returned by aBlock." |
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 |
^ self withCursor:(Cursor read) do:aBlock |
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 |
"Modified: 14.12.1995 / 20:57:40 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
"Created: 10.1.1996 / 13:52:52 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
|
5565 | 571 |
withVisibleCursor:aCursor do:aBlock |
572 |
"evaluate aBlock, showing a aCursor. |
|
573 |
Return the value of aBlock. |
|
6815 | 574 |
Ensure, that the cursor is visible for the user for a minimal amount of time |
575 |
(even if the computation would be too quick for a cursor to be visible, |
|
576 |
show the execute cursor for some time as a feedback)." |
|
5565 | 577 |
|
578 |
|ret| |
|
579 |
||
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
580 |
cursor == aCursor ifTrue:[ |
8259 | 581 |
^ aBlock value |
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
582 |
]. |
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
583 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
584 |
self |
8259 | 585 |
withCursor:aCursor do:[ |
586 |
|timeToExecute remainingShowTime| |
|
587 |
||
588 |
timeToExecute := Time millisecondsToRun:[ ret := aBlock value]. |
|
589 |
remainingShowTime := UserPreferences current waitCursorVisibleTime - timeToExecute. |
|
590 |
remainingShowTime > 0 ifTrue:[ |
|
591 |
Delay waitForMilliseconds:remainingShowTime. |
|
592 |
]. |
|
593 |
]. |
|
5565 | 594 |
^ ret. |
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
595 |
|
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
596 |
"Modified (comment): / 12-09-2011 / 12:14:29 / cg" |
5565 | 597 |
! |
598 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
599 |
withWaitCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
600 |
"evaluate aBlock while showing a waitCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
601 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
602 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
603 |
^ self withCursor:(Cursor wait) do:aBlock |
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 |
"Created: 10.1.1996 / 13:51:08 / cg" |
5923 | 606 |
! |
607 |
||
608 |
withWriteCursorDo:aBlock |
|
609 |
"evaluate aBlock while showing a writeCursor in all my views. |
|
610 |
Return the value as returned by aBlock." |
|
611 |
||
612 |
^ self withCursor:(Cursor write) do:aBlock |
|
613 |
||
614 |
"Modified: / 14-12-1995 / 20:57:40 / cg" |
|
615 |
"Created: / 27-07-2012 / 09:43:08 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
617 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
618 |
!DisplaySurface methodsFor:'accessing-hierarchy'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
619 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
620 |
delegate |
6396 | 621 |
"return the delegate - that's the one getting keyboard and button events. |
622 |
See dispatchEvent:... method" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
623 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
624 |
^ delegate |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
625 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
626 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
627 |
delegate:someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
628 |
"set the delegate - keyboard- and button events will be forwarded to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
629 |
that object if it is interested in them. |
6396 | 630 |
See the dispatchEvent... method." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
631 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
632 |
delegate := someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
633 |
! |
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 |
superView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
636 |
"return the superView - nil here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
637 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
638 |
^ nil |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
641 |
topComponent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
"return the topView - that the one with no superview" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
"Created: 9.5.1996 / 01:39:43 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
647 |
! |
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 |
topView |
6642 | 650 |
"return the topView - that's the one with no superview" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
651 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
652 |
^ self |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
!DisplaySurface methodsFor:'accessing-limits'! |
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 |
maxExtent |
7691 | 658 |
"return the view's maximum extent - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
661 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
662 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
663 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
maxExtent:extent |
7691 | 665 |
"set the view's maximum extent - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
666 |
Only standardSystemViews support this." |
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 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
669 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
670 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
671 |
minExtent |
7691 | 672 |
"return the view's minimum extent - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
673 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
674 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
675 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
676 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
677 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
minExtent:extent |
7691 | 679 |
"set the view's minimum extent - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
680 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
681 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
682 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
683 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
684 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
685 |
!DisplaySurface methodsFor:'accessing-misc'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
686 |
|
8219 | 687 |
automationUUID |
688 |
"return my uuid (for automation and the pollonium st/x capture/replay tool). |
|
689 |
This is a widget id, as specified in the uispec (if it is defined there). |
|
690 |
Will be the same for all instances |
|
691 |
(i.e. the same in different instances of the application). |
|
692 |
Contrast this with the instanceUUID, which is unique for each view. |
|
693 |
||
694 |
Notice: old uiSpecs do not provide/define a uuid, and nil is returned; |
|
695 |
so the application's specs must be re-edited and saved again." |
|
696 |
||
697 |
uuid isNil ifTrue:[^ uuid]. |
|
698 |
^ uuid asUUID |
|
699 |
||
700 |
" |
|
701 |
Transcript topView uuid |
|
702 |
Transcript topView instanceUuid |
|
703 |
" |
|
704 |
||
705 |
"Created: / 09-11-2017 / 22:33:10 / cg" |
|
706 |
! |
|
707 |
||
708 |
automationUUID:aUuidOrUuidString |
|
709 |
"set my uuid (for automation and the pollonium st/x capture/replay tool). |
|
710 |
This is a widget id, as specified in the uispec (if it is definedthere). |
|
711 |
Will be the same for all instances |
|
712 |
(i.e. the same in different instances of the application). |
|
713 |
Contrast this with the instanceUUID, which is unique for each view. |
|
714 |
||
715 |
Notice: old uiSpecs do not provide/define a uuid, and nil is returned from uuid; |
|
716 |
so the application's specs must be re-edited and saved again." |
|
717 |
||
718 |
uuid := aUuidOrUuidString |
|
719 |
||
720 |
"Created: / 09-11-2017 / 22:33:14 / cg" |
|
721 |
! |
|
722 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
backingStore:how |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
"turn on/off backingStore (saving my pixels) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
how may true/false, but also #always, #whenMapped or #never." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
how ~~ backed ifTrue:[ |
8259 | 728 |
backed := how. |
729 |
super backingStore:how. |
|
727
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 |
! |
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 |
eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
734 |
"return a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
this is X-specific and will be removed / replaced by symbolic values)" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
736 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
737 |
^ eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
740 |
eventMask:aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
741 |
"set a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
this is X-specific and will be removed / replaced by symbolic values)" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
743 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
744 |
eventMask := aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
745 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
746 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
747 |
getKeyboardFocus |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
748 |
"tell the Display to assign keyboard focus to the receiver" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
749 |
|
3674 | 750 |
self shown ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
751 |
device setInputFocusTo:self drawableId. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
752 |
]. |
2512 | 753 |
|
754 |
"Modified: / 15.3.1999 / 08:25:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
755 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
756 |
|
8219 | 757 |
instanceUUID |
8216 | 758 |
"return my unique uuid. |
759 |
This will be assigned once and only once per instance |
|
760 |
(i.e. the same type of view within different applications will |
|
8219 | 761 |
have different instanceUUIDs)" |
8216 | 762 |
|
763 |
|id| |
|
764 |
||
8219 | 765 |
(id := self getAttribute:#instanceUUID) isNil ifTrue:[ |
766 |
self setAttribute:#instanceUUID to:(id := UUID new). |
|
8216 | 767 |
]. |
768 |
^ id |
|
769 |
||
770 |
" |
|
771 |
Transcript topView getAttribute:#instanceUuid |
|
772 |
Transcript topView instanceUuid |
|
773 |
" |
|
774 |
||
8219 | 775 |
"Created: / 09-11-2017 / 22:32:07 / cg" |
8216 | 776 |
! |
777 |
||
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
778 |
isInputOnly |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
779 |
"return true, if the receiver is an input only view - that is: |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
780 |
the view will realize as a transparent view, into which you cannot |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
781 |
draw, but get events as usual. Thich can be used to catch events away from |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
782 |
others, which where never meant to work in such a setup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
783 |
(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
|
784 |
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
|
785 |
or on other plattforms." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
786 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
787 |
^ false |
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
788 |
|
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
789 |
"Created: 1.6.1996 / 13:21:51 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
790 |
! |
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 |
preferredDepth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
793 |
"return a non nil integer, if a specific depth is wanted in this view. |
8158 | 794 |
Return nil if we do not care (i.e. the display's default is wanted). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
795 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
796 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
797 |
^ nil |
8158 | 798 |
|
799 |
"Modified (comment): / 01-09-2017 / 09:57:44 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
800 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
801 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
802 |
preferredVisual |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
803 |
"return a non nil id, if a specific visual is wanted in this view. |
8158 | 804 |
Return nil if we do not care (i.e. the display's default is wanted). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
805 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
806 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
807 |
^ nil |
8158 | 808 |
|
809 |
"Modified (comment): / 01-09-2017 / 09:57:49 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
810 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
811 |
|
3152 | 812 |
saveUnder |
813 |
"return the saveUnder flag" |
|
814 |
||
815 |
^ flags bitTest:SaveUnderFlagMask |
|
816 |
! |
|
817 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
818 |
saveUnder:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
"turn on/off saveUnder (saving pixels under myself) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
820 |
- used for temporary views (i.e. PopUps and ModalBoxes)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
821 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
822 |
aBoolean ifTrue:[ |
8259 | 823 |
flags := flags bitOr:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
824 |
] ifFalse:[ |
8259 | 825 |
flags := flags bitClear:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
826 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
827 |
gc saveUnder:aBoolean. |
3859
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
828 |
! |
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
829 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
830 |
setPointerPosition:aRelativePoint |
7691 | 831 |
"set the pointer to aRelativePoint relative to the view's origin" |
3859
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
832 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
833 |
device setPointerPosition:aRelativePoint in:self drawableId. |
3859
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
834 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
835 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
836 |
Transcript setPointerPosition:Transcript extent // 2. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
837 |
Screen current rootView setPointerPosition:100@100. |
3859
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
838 |
" |
8216 | 839 |
! |
840 |
||
841 |
uuid |
|
8219 | 842 |
<resource: #obsolete> |
843 |
^ self automationUUID |
|
8216 | 844 |
|
845 |
" |
|
846 |
Transcript topView uuid |
|
847 |
Transcript topView instanceUuid |
|
848 |
" |
|
849 |
||
8219 | 850 |
"Modified: / 09-11-2017 / 22:33:24 / cg" |
8216 | 851 |
! |
852 |
||
8218 | 853 |
uuid:aUuidOrUuidString |
8219 | 854 |
<resource: #obsolete> |
855 |
^ self automationUUID:aUuidOrUuidString |
|
856 |
||
857 |
"Modified: / 09-11-2017 / 22:34:12 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
858 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
859 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
860 |
!DisplaySurface methodsFor:'accessing-names'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
861 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
862 |
icon |
7691 | 863 |
"return the view's icon - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
864 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
865 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
866 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
867 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
868 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
869 |
icon:aBitmap |
7691 | 870 |
"set the view's icon - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
871 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
872 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
873 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
874 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
875 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
876 |
iconLabel |
7691 | 877 |
"return the view's icon label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
878 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
879 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
880 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
881 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
882 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
883 |
iconLabel:aLabel |
7691 | 884 |
"set the view's icon label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
885 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
886 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
887 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
888 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
889 |
|
1481 | 890 |
iconMask |
7691 | 891 |
"return the view's iconMask - this is nil here. |
1481 | 892 |
Only standardSystemViews may support labels and icons." |
893 |
||
894 |
^ nil |
|
895 |
! |
|
896 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
897 |
iconView |
7691 | 898 |
"return the view's iconView - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
899 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
900 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
901 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
902 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
903 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
904 |
iconView:aView |
7691 | 905 |
"set the view's icon view - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
906 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
907 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
908 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
909 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
910 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
911 |
label |
7691 | 912 |
"return the view's label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
913 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
914 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
915 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
916 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
917 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
918 |
label:aLabel |
7691 | 919 |
"set the view's label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
920 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
921 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
922 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
923 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
924 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
925 |
!DisplaySurface methodsFor:'accessing-private'! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
926 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
927 |
clearGotExposeFlag |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
928 |
"internal; used to wait for an expose-event after a scroll operation" |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
929 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
930 |
flags := flags bitClear:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
931 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
932 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
933 |
getAttribute:key |
7556 | 934 |
"a place for additional attributes; |
935 |
allows for non-instvar slots to be added" |
|
936 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
937 |
moreAttributes isNil ifTrue:[ ^ nil]. |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
938 |
^ moreAttributes at:key ifAbsent:nil. |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
939 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
940 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
941 |
gotExpose |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
942 |
"internal; used to wait for an expose-event after a scroll operation" |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
943 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
944 |
^ flags bitTest:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
945 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
946 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
947 |
setAttribute:key to:newValue |
7556 | 948 |
"a place for additional attributes; |
949 |
allows for non-instvar slots to be added" |
|
950 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
951 |
newValue isNil ifTrue:[ |
7556 | 952 |
moreAttributes notNil ifTrue:[ |
953 |
moreAttributes removeKey:key ifAbsent:[]. |
|
954 |
moreAttributes := moreAttributes asNilIfEmpty |
|
955 |
] |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
956 |
] ifFalse:[ |
7556 | 957 |
moreAttributes isNil ifTrue:[ |
958 |
moreAttributes := IdentityDictionary new. |
|
959 |
]. |
|
960 |
moreAttributes at:key put:newValue. |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
961 |
]. |
5081 | 962 |
! |
963 |
||
964 |
setGotExposeFlag |
|
965 |
"internal; used to wait for an expose-event after a scroll operation" |
|
966 |
||
967 |
flags := flags bitOr:GotExposeFlagMask. |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
968 |
! ! |
4969 | 969 |
|
5136 | 970 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
971 |
!DisplaySurface methodsFor:'button menus'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
972 |
|
5773 | 973 |
getMiddleButtonMenu |
974 |
"return the menu associated with the middle mouse button. |
|
975 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
976 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
977 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
978 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
979 |
^ self getAttribute:#middleButtonMenu |
5773 | 980 |
|
981 |
"Created: / 07-07-2011 / 18:16:21 / cg" |
|
982 |
! |
|
983 |
||
984 |
middleButtonMenu |
|
985 |
"return the menu associated with the middle mouse button. |
|
986 |
Here, return a hooked on menu, but usually redefined to provide a widget-specific |
|
987 |
menu." |
|
988 |
||
989 |
^ self getMiddleButtonMenu |
|
990 |
||
991 |
"Modified (comment): / 07-07-2011 / 18:18:28 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
992 |
! |
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 |
middleButtonMenu:aMenu |
5773 | 995 |
"associate aMenu with the middle mouse button. |
996 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
997 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
998 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
999 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1000 |
|oldMenu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1001 |
|
5773 | 1002 |
(oldMenu := self getMiddleButtonMenu) notNil ifTrue:[ |
8259 | 1003 |
oldMenu isArray ifFalse:[ |
1004 |
oldMenu destroy |
|
1005 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1006 |
]. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1007 |
self setMiddleButtonMenu:aMenu |
5740 | 1008 |
|
5773 | 1009 |
"Modified: / 07-07-2011 / 18:18:00 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1010 |
! |
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 |
setMiddleButtonMenu:aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1013 |
"associate aMenu with the middle mouse button. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1014 |
Do not destroy the old menu if any" |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1015 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1016 |
self setAttribute:#middleButtonMenu to:aMenu |
727
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 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1019 |
!DisplaySurface methodsFor:'clipboard'! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1020 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1021 |
getClipboardObject |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1022 |
"return the object selection |
8158 | 1023 |
- either the local one, or the display's clipBoard buffer." |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1024 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1025 |
^ device getClipboardObjectFor:self drawableId. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1026 |
|
8158 | 1027 |
"Modified: / 13-02-1997 / 13:18:50 / cg" |
1028 |
"Modified (comment): / 01-09-2017 / 09:57:21 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1029 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1030 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1031 |
getClipboardText |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1032 |
"return the copyBuffers contents |
8158 | 1033 |
- either the local one, or the display's clipBoard buffer." |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1034 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1035 |
^ self getClipboardText:#clipboard |
8158 | 1036 |
|
1037 |
"Modified (comment): / 01-09-2017 / 09:57:24 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1038 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1039 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1040 |
getClipboardText:selectionBufferSymbol |
8158 | 1041 |
"return the text selection - either the local one, or one of the display's |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1042 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1043 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1044 |
or: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1045 |
#selection. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1046 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1047 |
Return aString or nil if there is no selection" |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1048 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1049 |
^ device getClipboardText:selectionBufferSymbol for:self drawableId. |
8158 | 1050 |
|
1051 |
"Modified (comment): / 01-09-2017 / 09:57:31 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1052 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1053 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1054 |
getSelection |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1055 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1056 |
self obsoleteMethodWarning:'use #getClipboardObject'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1057 |
^ self getClipboardObject |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1058 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1059 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1060 |
getTextSelection |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1061 |
"return the copyBuffers contents |
8158 | 1062 |
- either the local one, or the display's clipBoard buffer." |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1063 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1064 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1065 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1066 |
self obsoleteMethodWarning:'use #getClipboardText'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1067 |
^ self getClipboardText |
8158 | 1068 |
|
1069 |
"Modified (comment): / 01-09-2017 / 09:57:35 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1070 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1071 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1072 |
getTextSelection:selectionBufferSymbol |
8158 | 1073 |
"return the text selection - either the local one, or one of the display's |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1074 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
8158 | 1075 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1076 |
or: |
8158 | 1077 |
#selection. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1078 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1079 |
Return aString or nil if there is no selection" |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1080 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1081 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1082 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1083 |
self obsoleteMethodWarning:'#use getClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1084 |
^ self getClipboardText:selectionBufferSymbol |
8158 | 1085 |
|
1086 |
"Modified (comment): / 01-09-2017 / 09:57:38 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1087 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1088 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1089 |
setClipboardObject:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1090 |
"set the object selection - both the local one, and tell the display |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1091 |
that we have changed it (i.e. place it into the clipBoard)." |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1092 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1093 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1094 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1095 |
|
7687 | 1096 |
setClipboardText:aString |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1097 |
"set the text selection - both the local one, and tell the display |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1098 |
that we have changed it (i.e. place it into the clipBoard)." |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1099 |
|
7687 | 1100 |
device setClipboardText:aString ownerView:self |
1101 |
||
1102 |
"Modified (format): / 21-11-2016 / 23:36:59 / cg" |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1103 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1104 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1105 |
setSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1106 |
"set the object selection - both the local one, and tell the display |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1107 |
that we have changed it (i.e. place it into the clipBoard)." |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1108 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1109 |
<resource: #obsolete> |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1110 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1111 |
self obsoleteMethodWarning:'use setClipboardObject:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1112 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1113 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1114 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1115 |
setTextSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1116 |
"set the text selection - both the local one, and tell the display |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1117 |
that we have changed it (i.e. place it into the clipBoard)." |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1118 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1119 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1120 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1121 |
self obsoleteMethodWarning:'use setClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1122 |
device setClipboardText:something ownerView:self |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1123 |
! ! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1124 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1125 |
!DisplaySurface methodsFor:'drawing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1126 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1127 |
clearDeviceRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1128 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1129 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1130 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1131 |
|
7020 | 1132 |
|oldPaint org patternOffsetX patternOffsetY| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1133 |
|
7744 | 1134 |
(w <= 0 or:[h <= 0]) ifTrue:[^ self]. |
1135 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1136 |
gc isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1137 |
"nothing to clear" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1138 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1139 |
]. |
7302 | 1140 |
viewBackground isNil ifTrue:[^ self]. "/ how can this happen? |
1141 |
||
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1142 |
viewBackground isColor ifFalse:[ |
6240 | 1143 |
viewBackground isViewBackground ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1144 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1145 |
self |
7744 | 1146 |
paint:gc background; |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1147 |
fillDeviceRectangleX:x y:y width:w height:h; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1148 |
paint:oldPaint. |
6240 | 1149 |
viewBackground fillRectangleX:x y:y width:w height:h in:self. |
1150 |
^ self. |
|
1151 |
]. |
|
1152 |
||
7473 | 1153 |
org := self viewOrigin. |
7020 | 1154 |
(device supportsMaskedDrawingWith:viewBackground) ifFalse:[ |
1155 |
"/ hand-fill: the device cannot draw with a bitmap pattern underneath. |
|
7473 | 1156 |
self fillDeviceRectangleWithPattern:viewBackground x:x y:y width:w height:h patternOffset:org. |
7020 | 1157 |
^ self. |
1158 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1159 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1160 |
patternOffsetX := (org x rounded \\ viewBackground width). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1161 |
patternOffsetY := (org y rounded \\ viewBackground height). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1162 |
(patternOffsetX ~= 0 or:[patternOffsetY ~= 0]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1163 |
(device supportsMaskedDrawingWithOffset:viewBackground) ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1164 |
"/ hand-fill: the device cannot draw with a shifted bitmap pattern underneath. |
7473 | 1165 |
self fillDeviceRectangleWithPattern:viewBackground x:x y:y width:w height:h patternOffset:org. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1166 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1167 |
]. |
5458 | 1168 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1169 |
gc setDeviceMaskOriginX:patternOffsetX negated y:patternOffsetY negated. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1170 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1171 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1172 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1173 |
fill in device coordinates - not logical coordinates |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1174 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1175 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1176 |
self |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1177 |
paint:viewBackground; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1178 |
fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground"; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1179 |
paint:oldPaint. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1180 |
|
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1181 |
"Modified: / 4.5.1999 / 13:00:34 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1182 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1183 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1184 |
clearRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1185 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1186 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1187 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1188 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1189 |
|pX pY pW pH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1190 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1191 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1192 |
currentTransformation notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1193 |
pX := currentTransformation applyToX:x. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1194 |
pY := currentTransformation applyToY:y. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1195 |
pW := currentTransformation applyScaleX:w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1196 |
pH := currentTransformation applyScaleY:h. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1197 |
] ifFalse:[ |
6692 | 1198 |
pX := x. |
1199 |
pY := y. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1200 |
pW := w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1201 |
pH := h. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1202 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1203 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1204 |
^ self clearDeviceRectangleX:pX rounded y:pY rounded width:pW ceiling height:pH ceiling. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1205 |
|
2393
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
1206 |
"Modified: / 30.10.1998 / 15:00:37 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1207 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1208 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1209 |
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
|
1210 |
"fill a rectangular area with some pattern. |
5458 | 1211 |
A helper for devices which do not support pixmap drawing (i.e. win95). |
1212 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1213 |
Caller must ensure that aPixmap is really a form. |
1214 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1215 |
therefore it is actually not obsolete." |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1216 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1217 |
|r b |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1218 |
pW "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1219 |
pH "{ Class: SmallInteger }" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1220 |
xR0 |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1221 |
xR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1222 |
yR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1223 |
xE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1224 |
yE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1225 |
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
|
1226 |
offsX "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1227 |
offsY "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1228 |
oX "{ Class: SmallInteger }" |
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1229 |
oY "{ Class: SmallInteger }"| |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1230 |
|
2640
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1231 |
x := xIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1232 |
y := yIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1233 |
w := wIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1234 |
h := hIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1235 |
|
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1236 |
x := x max:0. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1237 |
y := y max:0. |
7744 | 1238 |
r := (xIn + w) min:width. |
1239 |
b := (yIn + h) min:height. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1240 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1241 |
pW := aPixmap width. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1242 |
pH := aPixmap height. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1243 |
|
7470 | 1244 |
oldClip := self deviceClippingBoundsOrNil. |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1245 |
oldClip notNil ifTrue:[ |
7426 | 1246 |
x := x max:oldClip left. |
1247 |
y := y max:oldClip top. |
|
1248 |
r := r min:oldClip right. |
|
1249 |
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
|
1250 |
]. |
7744 | 1251 |
w := r-x. |
1252 |
h := b-y. |
|
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1253 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1254 |
yR := (y // pH) * pH. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1255 |
yE := y+h. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1256 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1257 |
yR >= yE ifTrue:[^ self]. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1258 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1259 |
xR0 := (x // pW) * pW. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1260 |
xE := x+w. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1261 |
|
6770 | 1262 |
xR0 >= xE ifTrue:[^ self]. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1263 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1264 |
aPixmap depth == 1 ifTrue:[ |
7744 | 1265 |
oldFg := gc foreground. |
1266 |
oldBg := gc background. |
|
7426 | 1267 |
(clrMap := aPixmap colorMap) notNil ifTrue:[ |
1268 |
bg := clrMap at:1. |
|
1269 |
fg := clrMap at:2. |
|
1270 |
] ifFalse:[ |
|
1271 |
bg := self whiteColor. |
|
1272 |
fg := self blackColor. |
|
1273 |
]. |
|
7744 | 1274 |
gc foreground:fg background:bg. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1275 |
]. |
7470 | 1276 |
self deviceClippingBounds:(Rectangle left:x top:y width:w height:h). |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1277 |
|
5458 | 1278 |
offsX := (xR0 + pattOffs x) \\ pW. |
1279 |
offsY := (yR + pattOffs y) \\ pH. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1280 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1281 |
oY := offsY. |
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1282 |
[yR < yE] whileTrue:[ |
7426 | 1283 |
xR := xR0. |
1284 |
oX := offsX. |
|
1285 |
[xR < xE] whileTrue:[ |
|
1286 |
self |
|
1287 |
copyFrom:aPixmap |
|
1288 |
x:oX y:oY |
|
1289 |
toX:xR y:yR |
|
1290 |
width:(pW - oX) height:(pH - oY) |
|
1291 |
async:true. |
|
1292 |
xR := xR + pW - oX. |
|
1293 |
oX := 0. |
|
1294 |
]. |
|
1295 |
yR := yR + pH - oY. |
|
1296 |
oY := 0. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1297 |
]. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1298 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1299 |
oldFg notNil ifTrue:[ |
7744 | 1300 |
gc foreground:oldFg background:oldBg. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1301 |
]. |
7470 | 1302 |
self deviceClippingBounds:oldClip. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1303 |
|
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1304 |
"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
|
1305 |
"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
|
1306 |
"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
|
1307 |
! |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1308 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1309 |
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
|
1310 |
"fill a rectangular area with aPixmap. |
5458 | 1311 |
A helper for devices which do not support pixmap filling (i.e. win95 screens). |
1312 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1313 |
Caller must ensure that the aPixmap is really a form. |
1314 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1315 |
therefore it is actually not obsolete." |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1316 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1317 |
|pX pY nW nH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1318 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1319 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1320 |
currentTransformation notNil ifTrue:[ |
7744 | 1321 |
pX := currentTransformation applyToX:x. |
1322 |
pY := currentTransformation applyToY:y. |
|
1323 |
nW := currentTransformation applyScaleX:w. |
|
1324 |
nH := currentTransformation applyScaleY:h. |
|
1325 |
nW < 0 ifTrue:[ |
|
1326 |
nW := nW abs. |
|
1327 |
pX := pX - nW. |
|
1328 |
]. |
|
1329 |
nH < 0 ifTrue:[ |
|
1330 |
nH := nH abs. |
|
1331 |
pY := pY - nH. |
|
1332 |
]. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1333 |
] ifFalse:[ |
7744 | 1334 |
pX := x. |
1335 |
pY := y. |
|
1336 |
nW := w. |
|
1337 |
nH := h. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1338 |
]. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1339 |
pX := pX rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1340 |
pY := pY rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1341 |
nW := nW rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1342 |
nH := nH rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1343 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1344 |
self |
7744 | 1345 |
fillDeviceRectangleWithPattern:aPixmap |
1346 |
x:pX y:pY width:nW height:nH |
|
1347 |
patternOffset:pattOffs |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1348 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1349 |
"Modified: 4.6.1996 / 17:58:49 / cg" |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1350 |
! |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1351 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1352 |
redraw |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1353 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1354 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1355 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1356 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1357 |
!DisplaySurface methodsFor:'enable/disable events'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1358 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1359 |
compressMotionEvents:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1360 |
"enable/disable motion event compression |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1361 |
(i.e. replacing all motion events by the last one). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1362 |
Compression makes almost always sense, except when |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1363 |
doing things like freehand drawing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1364 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1365 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1366 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1367 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1368 |
windowGroup notNil ifTrue:[ |
8259 | 1369 |
windowGroup sensor compressMotionEvents:aBoolean. |
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1370 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1371 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1372 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1373 |
disableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1374 |
"disable all button events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1375 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1376 |
self disableEvent:#buttonPress; disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1377 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1378 |
"Modified: 29.4.1996 / 11:09:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1379 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1380 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1381 |
disableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1382 |
"disable button motion-while-button-is-pressed events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1383 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1384 |
self disableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1385 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1386 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1387 |
disableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1388 |
"disable button press events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1389 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1390 |
self disableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1391 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1392 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1393 |
disableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1394 |
"disable button release events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1395 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1396 |
self disableEvent:#buttonRelease |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1399 |
disableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1400 |
"disable both mouse-pointer enter and leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
self disableEvent:#enter; disableEvent:#leave |
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 |
"Modified: 29.4.1996 / 11:09:37 / cg" |
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 |
disableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1408 |
"disable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1409 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1410 |
for a list of allowed event symbols see Workstation class" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1411 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1412 |
eventMask := eventMask bitAnd:(self graphicsDevice eventMaskFor:anEventSymbol) bitInvert. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1413 |
self drawableId notNil ifTrue:[ |
8259 | 1414 |
self graphicsDevice setEventMask:eventMask in:self drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1415 |
] |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1418 |
disableMotionEvents |
1332 | 1419 |
"disable mouse-pointer motion events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1420 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1421 |
self disableEvent:#pointerMotion |
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 |
enableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1425 |
"enable both mouse button press and release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1426 |
These are enabled by default anyway." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1427 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
self enableEvent:#buttonPress; enableEvent:#buttonRelease |
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 |
"Modified: 29.4.1996 / 11:09:46 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1431 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1432 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1433 |
enableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
"enable mouse-pointer motion-while-button-is-pressed events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1435 |
These are enabled by default anyway." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1436 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
self enableEvent:#buttonMotion |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1440 |
enableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1441 |
"enable mouse button press events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1442 |
These are enabled by default anyway." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1443 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1444 |
self enableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1445 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1446 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1447 |
enableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1448 |
"enable mouse button release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1449 |
These are enabled by default anyway." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1450 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1451 |
self enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1452 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1453 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1454 |
enableEnterEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1455 |
"enable mouse-pointer enter events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1456 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1457 |
self enableEvent:#enter |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1458 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1459 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1460 |
enableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1461 |
"enable both mouse-pointer enter and leave events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1462 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1463 |
self enableEvent:#enter; enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1464 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1465 |
"Modified: 29.4.1996 / 11:09:55 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1466 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1467 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1468 |
enableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1469 |
"enable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1470 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1471 |
for a list of allowed event symbols see Workstation class" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1472 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1473 |
eventMask := (eventMask ? 0) bitOr:(self graphicsDevice eventMaskFor:anEventSymbol). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1474 |
self drawableId notNil ifTrue:[ |
8259 | 1475 |
self graphicsDevice setEventMask:eventMask in:self drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1476 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1477 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1478 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1479 |
enableFocusEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1480 |
"enable keyboard focus change events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1481 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1482 |
self enableEvent:#focusChange |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1485 |
enableKeyEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1486 |
"this is a compatibility leftover - |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1487 |
starting with 2.10.3, keyPress is always enabled to allow |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1488 |
^C processing." |
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 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1491 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1492 |
enableKeyPressEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1493 |
"this is a compatibility leftover - |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1494 |
starting with 2.10.3, keyPress is always enabled to allow |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1495 |
^C processing." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1496 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1497 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1498 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1499 |
enableKeyReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1500 |
"enable key release events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1501 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1502 |
self enableEvent:#keyRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1503 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1504 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1505 |
enableLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1506 |
"enable mouse-pointer leave events" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1507 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1508 |
self enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1509 |
! |
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 |
enableMotionEvents |
4453 | 1512 |
"enable mouse-pointer motion events (those without a pressed button)" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1513 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1514 |
self enableEvent:#pointerMotion |
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 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1517 |
!DisplaySurface methodsFor:'event dispatching'! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1518 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1519 |
dispatchEvent:event |
2962 | 1520 |
"dispatch an event" |
1521 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1522 |
^ self |
8259 | 1523 |
dispatchEvent:event |
1524 |
withFocusOn:nil |
|
1525 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1526 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1527 |
"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
|
1528 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1529 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1530 |
dispatchEvent:type arguments:arguments |
2962 | 1531 |
"dispatch an event" |
1532 |
||
3094 | 1533 |
"/ XXXX: TO BE ELIMINATED |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1534 |
^ self |
8259 | 1535 |
dispatchEvent:nil |
1536 |
type:type |
|
1537 |
arguments:arguments |
|
1538 |
withFocusOn:nil |
|
1539 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1540 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1541 |
"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
|
1542 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1543 |
|
3094 | 1544 |
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
|
1545 |
"dispatch the event represented by type and arguments either to my delegate, |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1546 |
or to my controller (which may be myself, if I implement the controller functionality myself). |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1547 |
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
|
1548 |
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
|
1549 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1550 |
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
|
1551 |
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
|
1552 |
handle events which are already delegated. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1553 |
If there is a delegate, only messages which are understood by it are |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1554 |
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
|
1555 |
before. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1556 |
Delegated messages get the original view as an extra argument. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1557 |
Delegation has higher priority than both controller or focusView |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1558 |
forwarding." |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1559 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1560 |
|delegate selector delegateMessage delegateQuery |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1561 |
eventReceiver controller deviceMessage |
7410 | 1562 |
isKeyEvent isButtonEvent isMouseWheelEvent isPointerEvent isExposeEvent |
1563 |
||
4041 | 1564 |
rect x y w h delegatedEvent rgn| |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1565 |
|
2498 | 1566 |
type == #damage ifTrue:[ |
7739 | 1567 |
"/ OLDdamage scheme - this will vanish |
1568 |
self shown ifTrue:[ |
|
1569 |
rect := argArray. |
|
1570 |
x := rect left. |
|
1571 |
y := rect top. |
|
1572 |
w := rect width. |
|
1573 |
h := rect height. |
|
1574 |
gc transformation notNil ifTrue:[ |
|
1575 |
self deviceExposeX:x y:y width:w height:h |
|
1576 |
] ifFalse:[ |
|
1577 |
self exposeX:x y:y width:w height:h |
|
1578 |
] |
|
1579 |
]. |
|
1580 |
^ self |
|
4041 | 1581 |
]. |
1582 |
||
1583 |
type == #newDamage ifTrue:[ |
|
7739 | 1584 |
"/ New damage scheme |
1585 |
rgn := updateRegion. |
|
1586 |
updateRegion := nil. |
|
1587 |
self shown ifTrue:[ |
|
1588 |
rgn notNil ifTrue:[ |
|
1589 |
rgn do:[:rect | |
|
1590 |
"/ cg: I think the check for being realized may not be enough; |
|
1591 |
"/ there is a race here, if the view gets closed, while in the loop... |
|
1592 |
realized ifTrue:[ |
|
1593 |
x := rect left. |
|
1594 |
y := rect top. |
|
1595 |
w := rect width. |
|
1596 |
h := rect height. |
|
1597 |
gc transformation notNil ifTrue:[ |
|
1598 |
self deviceExposeX:x y:y width:w height:h |
|
1599 |
] ifFalse:[ |
|
1600 |
self exposeX:x y:y width:w height:h |
|
1601 |
] |
|
1602 |
] |
|
1603 |
] |
|
1604 |
] |
|
1605 |
]. |
|
1606 |
^ self |
|
2498 | 1607 |
]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1608 |
|
7410 | 1609 |
isKeyEvent := isButtonEvent := isPointerEvent := isMouseWheelEvent := isExposeEvent := false. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1610 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1611 |
(type == #'keyPress:x:y:') ifTrue:[ |
7739 | 1612 |
isKeyEvent := true. |
1613 |
deviceMessage := #'deviceKeyPress:x:y:'. |
|
1614 |
delegateMessage := #'keyPress:x:y:view:'. |
|
1615 |
delegateQuery := #'handlesKeyPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1616 |
] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[ |
7739 | 1617 |
isKeyEvent := true. |
1618 |
deviceMessage := #'deviceKeyRelease:x:y:'. |
|
1619 |
delegateMessage := #'keyRelease:x:y:view:'. |
|
1620 |
delegateQuery := #'handlesKeyRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1621 |
] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[ |
7739 | 1622 |
isButtonEvent := true. |
1623 |
deviceMessage := #'deviceButtonMotion:x:y:'. |
|
1624 |
delegateMessage := #'buttonMotion:x:y:view:'. |
|
1625 |
delegateQuery := #'handlesButtonMotion:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1626 |
] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[ |
7739 | 1627 |
isButtonEvent := true. |
1628 |
deviceMessage := #'deviceButtonPress:x:y:'. |
|
1629 |
delegateMessage := #'buttonPress:x:y:view:'. |
|
1630 |
delegateQuery := #'handlesButtonPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1631 |
] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[ |
7739 | 1632 |
isButtonEvent := true. |
1633 |
deviceMessage := #'deviceButtonRelease:x:y:'. |
|
1634 |
delegateMessage := #'buttonRelease:x:y:view:'. |
|
1635 |
delegateQuery := #'handlesButtonRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1636 |
] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[ |
7739 | 1637 |
isButtonEvent := true. |
1638 |
deviceMessage := #'deviceButtonShiftPress:x:y:'. |
|
1639 |
delegateMessage := #'buttonShiftPress:x:y:view:'. |
|
1640 |
delegateQuery := #'handlesButtonShiftPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1641 |
] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[ |
7739 | 1642 |
isButtonEvent := true. |
1643 |
deviceMessage := #'deviceButtonMultiPress:x:y:'. |
|
1644 |
delegateMessage := #'buttonMultiPress:x:y:view:'. |
|
1645 |
delegateQuery := #'handlesButtonMultiPress:inView:'. |
|
4856 | 1646 |
] ifFalse:[ (type == #mouseWheelMotion:x:y:amount:deltaTime:) ifTrue:[ |
7739 | 1647 |
isMouseWheelEvent := true. |
1648 |
deviceMessage := type. |
|
1649 |
delegateMessage := #mouseWheelMotion:x:y:amount:deltaTime:view:. |
|
1650 |
delegateQuery := #handlesMouseWheelMotion:inView:. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1651 |
] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[ |
7739 | 1652 |
isPointerEvent := true. |
1653 |
deviceMessage := #'devicePointerEnter:x:y:'. |
|
1654 |
delegateMessage := #'pointerEnter:x:y:view:'. |
|
1655 |
delegateQuery := #'handlesPointerEnter:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1656 |
] ifFalse:[ (type == #'pointerLeave:') ifTrue:[ |
7739 | 1657 |
isPointerEvent := true. |
1658 |
deviceMessage := type. |
|
1659 |
delegateMessage := #'pointerLeave:view:'. |
|
1660 |
delegateQuery := #'handlesPointerLeave:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1661 |
] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[ |
7739 | 1662 |
isExposeEvent := true. |
1663 |
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
|
1664 |
] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[ |
7739 | 1665 |
isExposeEvent := true. |
1666 |
deviceMessage := #'deviceGraphicsExposeX:y:width:height:final:'. |
|
4856 | 1667 |
]]]]]]]]]]]]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1668 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1669 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1670 |
if there is a focusView, and its a keyboard event, pass it |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1671 |
to that view (or its controller, or its delegate). |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1672 |
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
|
1673 |
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
|
1674 |
" |
5208 | 1675 |
((isKeyEvent "or:[isMouseWheelEvent]") |
1676 |
and:[focusView notNil and:[self ~~ focusView]]) ifTrue:[ |
|
7739 | 1677 |
delegatedEvent := ev shallowCopy. |
1678 |
delegatedEvent delegatedFrom:ev. |
|
1679 |
delegatedEvent arguments:(ev arguments shallowCopy). |
|
1680 |
delegatedEvent x:-1; y:-1. |
|
1681 |
||
1682 |
focusView |
|
1683 |
dispatchEvent:delegatedEvent |
|
8081 | 1684 |
type:delegatedEvent type |
1685 |
arguments:(delegatedEvent arguments) |
|
7739 | 1686 |
withFocusOn:nil |
1687 |
delegate:doDelegate. |
|
1688 |
^ self |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1689 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1690 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1691 |
doDelegate ifTrue:[ |
7739 | 1692 |
" |
1693 |
handle delegated messages |
|
1694 |
" |
|
1695 |
(isKeyEvent |
|
1696 |
or:[isButtonEvent |
|
1697 |
or:[isMouseWheelEvent |
|
1698 |
or:[isPointerEvent]]]) ifTrue:[ |
|
1699 |
delegate := self delegate. |
|
1700 |
||
1701 |
" |
|
1702 |
what a kludge - sending to delegate requires |
|
1703 |
another selector and an additional argument ... |
|
1704 |
" |
|
1705 |
(delegate notNil) ifTrue:[ |
|
1706 |
" |
|
1707 |
is the delegate interested in that event ? |
|
1708 |
(if it does not respond to the handlesXXX message, assume: NO) |
|
1709 |
" |
|
1710 |
(delegate askFor:delegateQuery with:(argArray at:1) with:self) ifTrue:[ |
|
1711 |
" |
|
1712 |
mhmh ... have to convert to logical coordinates |
|
1713 |
" |
|
1714 |
|currentTransformation| |
|
1715 |
||
1716 |
currentTransformation := gc transformation. |
|
1717 |
currentTransformation notNil ifTrue:[ |
|
1718 |
argArray size > 2 ifTrue:[ |
|
1719 |
argArray at:2 put:(currentTransformation applyInverseToX:(argArray at:2)). |
|
1720 |
argArray at:3 put:(currentTransformation applyInverseToY:(argArray at:3)). |
|
1721 |
]. |
|
1722 |
]. |
|
1723 |
argArray isNil ifTrue:[ |
|
1724 |
delegate perform:delegateMessage with:self |
|
1725 |
] ifFalse:[ |
|
1726 |
delegate perform:delegateMessage withArguments:(argArray copyWith:self) |
|
1727 |
]. |
|
1728 |
^ self |
|
1729 |
] |
|
1730 |
]. |
|
1731 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1732 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1733 |
|
2708 | 1734 |
" |
1735 |
if I am not shown, ignore input events |
|
1736 |
" |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1737 |
(isKeyEvent |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1738 |
or:[isButtonEvent |
5208 | 1739 |
or:[isMouseWheelEvent |
1740 |
or:[isPointerEvent]]]) ifTrue:[ |
|
7739 | 1741 |
realized ifFalse:[ |
1742 |
^ self |
|
1743 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1744 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1745 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1746 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1747 |
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
|
1748 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1749 |
eventReceiver := self. |
8081 | 1750 |
((controller := self controller) notNil and:[controller ~~ eventReceiver]) ifTrue:[ |
7739 | 1751 |
(isKeyEvent |
1752 |
or:[isButtonEvent |
|
1753 |
or:[isMouseWheelEvent |
|
1754 |
or:[isPointerEvent |
|
1755 |
or:[(type == #focusIn) |
|
1756 |
or:[(type == #focusOut)]]]]]) ifTrue:[ |
|
1757 |
eventReceiver := controller. |
|
1758 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1759 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1760 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1761 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1762 |
finally, another one: |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1763 |
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
|
1764 |
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
|
1765 |
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
|
1766 |
in DisplaySurface translates and resends). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1767 |
Actually, I could always send deviceXXX without speed penalty |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1768 |
(event sending is no high frequency operation), but that just adds |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1769 |
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
|
1770 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1771 |
selector := type. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1772 |
|
7739 | 1773 |
(isKeyEvent |
1774 |
or:[isButtonEvent |
|
1775 |
or:[isMouseWheelEvent |
|
1776 |
or:[isPointerEvent |
|
1777 |
or:[isExposeEvent]]]]) ifTrue:[ |
|
1778 |
gc transformation notNil ifTrue:[ |
|
1779 |
selector := deviceMessage |
|
1780 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1781 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1782 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1783 |
eventReceiver perform:selector withArguments:argArray |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1784 |
|
8081 | 1785 |
"Created: / 20-05-1998 / 22:46:25 / cg" |
1786 |
"Modified: / 17-08-2017 / 09:47:01 / cg" |
|
2962 | 1787 |
! |
1788 |
||
1789 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
1790 |
"dispatch the event" |
|
1791 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1792 |
^ self |
8259 | 1793 |
dispatchEvent:event |
1794 |
withFocusOn:focusViewOrNil |
|
1795 |
delegate:true |
|
3094 | 1796 |
|
1797 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
|
1798 |
! |
|
1799 |
||
1800 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
1801 |
"dispatch the event" |
|
1802 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1803 |
^ self |
8259 | 1804 |
dispatchEvent:event |
1805 |
type:event type |
|
1806 |
arguments:(event arguments) |
|
1807 |
withFocusOn:focusViewOrNil |
|
1808 |
delegate:doDelegate |
|
2962 | 1809 |
|
1810 |
"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
|
1811 |
! ! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1812 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1813 |
!DisplaySurface methodsFor:'event handling'! |
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 |
activateMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1816 |
"if there is a menu, show it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1817 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1818 |
|menu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1819 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1820 |
(menu := self middleButtonMenu) notNil ifTrue:[ |
8349 | 1821 |
menu isBlock ifTrue:[ menu := menu value ]. |
7977 | 1822 |
menu isArray ifTrue:[ |
1823 |
"/ a spec array |
|
1824 |
menu := menu decodeAsLiteralArray. |
|
8349 | 1825 |
menu findGuiResourcesIn:(self application ? self) for:self. |
7977 | 1826 |
menu receiver:self. |
1827 |
]. |
|
1828 |
menu showAtPointer |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1829 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1830 |
|
7977 | 1831 |
"Created: / 01-03-1996 / 13:24:55 / cg" |
1832 |
"Modified: / 15-03-2017 / 10:41:26 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1833 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1834 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1835 |
buttonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1836 |
"mouse was moved while button is pressed - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1837 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1838 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1839 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1840 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1841 |
buttonMultiPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1842 |
"button was pressed fast after previous press - default to press-again" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1843 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1844 |
^ self buttonPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1845 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1846 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1847 |
buttonPress:button x:x y:y |
7879 | 1848 |
"button was pressed - if it's middle button and there is a menu, show it." |
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1849 |
|
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1850 |
(button == 2) ifTrue:[ |
7879 | 1851 |
UserPreferences current showRightButtonMenuOnRelease ifFalse:[ |
1852 |
self activateMenu. |
|
1853 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1854 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1855 |
|
7879 | 1856 |
"Modified: / 01-03-1996 / 13:25:07 / cg" |
1857 |
"Modified (comment): / 13-02-2017 / 20:01:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1858 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1859 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1860 |
buttonRelease:button x:x y:y |
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1861 |
(button == 2) ifTrue:[ |
8259 | 1862 |
UserPreferences current showRightButtonMenuOnRelease ifTrue:[ |
1863 |
self activateMenu. |
|
1864 |
]. |
|
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1865 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1866 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1867 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1868 |
catchExpose |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1869 |
"this MUST be sent BEFORE doing a bit-blt copy (i.e. copyFrom...), |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1870 |
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
|
1871 |
Sometime after the bit-blt, waitForExpose should be sent, to finally |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1872 |
suspend until the expose/noExpose event arrives. |
8041 | 1873 |
This is an X speciality - for devices that do not need this kind of |
1332 | 1874 |
asynchronous bit-blt confirmation, this is a noop. |
8041 | 1875 |
Answer true if the sender is required to do a waitForExpose, false if not. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1876 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1877 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1878 |
|wg| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1879 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1880 |
device scrollsAsynchronous ifFalse:[ |
7466 | 1881 |
self setGotExposeFlag. |
1882 |
^ false |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1883 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1884 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1885 |
self setGraphicsExposures:true. |
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1886 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
1887 |
self clearGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1888 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1889 |
wg notNil ifTrue:[ |
7466 | 1890 |
" |
8041 | 1891 |
must process any pending expose events, since |
7466 | 1892 |
usually the origin is changed soon so that previous |
1893 |
expose events coordinates are invalid |
|
1894 |
" |
|
1895 |
wg processRealExposeEventsFor:self. |
|
1896 |
wg sensor catchExposeFor:self. |
|
1897 |
^ true |
|
1898 |
]. |
|
1899 |
^ false. |
|
1245
4a4e15a3e4fd
pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents:
1236
diff
changeset
|
1900 |
|
8041 | 1901 |
"Modified: / 06-08-1997 / 19:50:15 / cg" |
1902 |
"Modified (comment): / 30-05-2017 / 18:58:45 / mawalch" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1903 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1904 |
|
3595
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1905 |
coveredBy:aView |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1906 |
"the receiver has been covered by another view; |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1907 |
we are not interested in that here (but see modalBox for more)." |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1908 |
! |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1909 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1910 |
deviceButtonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1911 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1912 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1913 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1914 |
and send a #buttonMotion with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1915 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1916 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1917 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1918 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1919 |
should redefine #buttonMotion:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1920 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1921 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1922 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1923 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1924 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1925 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1926 |
currentTransformation notNil ifTrue:[ |
8259 | 1927 |
lx notNil ifTrue:[ |
1928 |
lx := currentTransformation applyInverseToX:lx. |
|
1929 |
ly := currentTransformation applyInverseToY:ly. |
|
1930 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1931 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1932 |
self buttonMotion:state x:lx y:ly |
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 |
"Modified: 20.5.1996 / 17:45:25 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1935 |
"Modified: 14.10.1996 / 22:25:12 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1936 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1937 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1938 |
deviceButtonMultiPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1939 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1940 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1941 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1942 |
and send a buttonMultiPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1943 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1944 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1945 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1946 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
should redefine #buttonMultiPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1948 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1949 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1950 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1951 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1952 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1953 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1954 |
currentTransformation notNil ifTrue:[ |
8259 | 1955 |
lx notNil ifTrue:[ |
1956 |
lx := currentTransformation applyInverseToX:lx. |
|
1957 |
ly := currentTransformation applyInverseToY:ly. |
|
1958 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1959 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1960 |
self buttonMultiPress:butt x:lx y:ly |
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 |
"Modified: 20.5.1996 / 17:45:22 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1963 |
"Modified: 14.10.1996 / 22:25:22 / stefan" |
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1966 |
deviceButtonPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1967 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1968 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1969 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1970 |
and send a buttonPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1971 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1972 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1973 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1974 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1975 |
should redefine #buttonPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1976 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1977 |
|lx ly currentTransformation| |
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1980 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1981 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1982 |
currentTransformation notNil ifTrue:[ |
8259 | 1983 |
lx notNil ifTrue:[ |
1984 |
lx := currentTransformation applyInverseToX:lx. |
|
1985 |
ly := currentTransformation applyInverseToY:ly. |
|
1986 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1987 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1988 |
self buttonPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1989 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1990 |
"Modified: 20.5.1996 / 17:45:18 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1991 |
"Modified: 14.10.1996 / 22:25:30 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1992 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1993 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1994 |
deviceButtonRelease:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1996 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1997 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1998 |
and send a buttonRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1999 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2000 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2001 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2002 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
should redefine #buttonRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2004 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2005 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2006 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2007 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2008 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2009 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2010 |
currentTransformation notNil ifTrue:[ |
8259 | 2011 |
lx notNil ifTrue:[ |
2012 |
lx := currentTransformation applyInverseToX:lx. |
|
2013 |
ly := currentTransformation applyInverseToY:ly. |
|
2014 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2015 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2016 |
self buttonRelease:butt x:lx y:ly |
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 |
"Modified: 20.5.1996 / 17:45:14 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2019 |
"Modified: 14.10.1996 / 22:25:37 / stefan" |
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2022 |
deviceButtonShiftPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2023 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2024 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2025 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2026 |
and send a buttonShiftPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2027 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2028 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2029 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2030 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2031 |
should redefine #buttonShiftPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2032 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2033 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2034 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2035 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2036 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2037 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2038 |
currentTransformation notNil ifTrue:[ |
8259 | 2039 |
lx notNil ifTrue:[ |
2040 |
lx := currentTransformation applyInverseToX:lx. |
|
2041 |
ly := currentTransformation applyInverseToY:ly. |
|
2042 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2043 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2044 |
self buttonShiftPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2045 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2046 |
"Modified: 20.5.1996 / 17:45:09 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2047 |
"Modified: 14.10.1996 / 22:25:49 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2048 |
! |
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 |
deviceExposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2051 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2052 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2053 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2054 |
and send an expose with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2056 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2057 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2058 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
should redefine #exposeX:x:y:width:height:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2061 |
|lx ly lw lh currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2062 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2063 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2064 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2065 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2066 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2067 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2068 |
currentTransformation notNil ifTrue:[ |
8259 | 2069 |
lx := currentTransformation applyInverseToX:lx. |
2070 |
ly := currentTransformation applyInverseToY:ly. |
|
2071 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2072 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2073 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
self exposeX:lx y:ly width:lw height:lh |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2075 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2076 |
"Modified: 13.5.1996 / 11:31:44 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2077 |
"Modified: 14.10.1996 / 22:26:00 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2078 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2079 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2080 |
deviceGraphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2081 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2082 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2083 |
If there is a transformation, apply the inverse |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2084 |
and send a graphicsExpose with the logical coordinates. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2085 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2086 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2087 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2088 |
those which are interested in logical coordinates |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2089 |
should redefine #graphicsExposeX:x:y:width:height:" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2090 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2091 |
|lx ly lw lh currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2092 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2093 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2094 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2095 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2096 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2097 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2098 |
currentTransformation notNil ifTrue:[ |
8259 | 2099 |
lx := currentTransformation applyInverseToX:lx. |
2100 |
ly := currentTransformation applyInverseToY:ly. |
|
2101 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2102 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2103 |
]. |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2104 |
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
|
2105 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2106 |
"Modified: 13.5.1996 / 11:31:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2107 |
"Modified: 14.10.1996 / 22:26:08 / stefan" |
727
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 |
deviceKeyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2111 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2112 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2113 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2114 |
and send a keyPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2115 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2116 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2117 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2118 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2119 |
should redefine #keyPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2120 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2121 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2123 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2125 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2126 |
currentTransformation notNil ifTrue:[ |
8259 | 2127 |
lx notNil ifTrue:[ |
2128 |
lx := currentTransformation applyInverseToX:lx. |
|
2129 |
ly := currentTransformation applyInverseToY:ly. |
|
2130 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2131 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2132 |
self keyPress:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
"Modified: 20.5.1996 / 17:44:59 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2135 |
"Modified: 14.10.1996 / 22:26:17 / stefan" |
727
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 |
deviceKeyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2140 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2141 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2142 |
and send a keyRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2143 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2144 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2145 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2146 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2147 |
should redefine #keyRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2148 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2149 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2150 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2151 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2152 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2153 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2154 |
currentTransformation notNil ifTrue:[ |
8259 | 2155 |
lx notNil ifTrue:[ |
2156 |
lx := currentTransformation applyInverseToX:lx. |
|
2157 |
ly := currentTransformation applyInverseToY:ly. |
|
2158 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2159 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2160 |
self keyRelease:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2161 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
"Modified: 20.5.1996 / 17:44:42 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2163 |
"Modified: 14.10.1996 / 22:26:28 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2164 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2165 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2166 |
devicePointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2167 |
"this is the low-level (untransformed) event as received |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2168 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2170 |
and send a pointerEnter with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2172 |
Views which are interested in deviceCoordinates should |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2173 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2174 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
should redefine #pointerEnter:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2176 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2177 |
|lx ly currentTransformation| |
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2180 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2181 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2182 |
currentTransformation notNil ifTrue:[ |
8259 | 2183 |
lx notNil ifTrue:[ |
2184 |
lx := currentTransformation applyInverseToX:lx. |
|
2185 |
ly := currentTransformation applyInverseToY:ly. |
|
2186 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2187 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2188 |
self pointerEnter:state x:lx y:ly |
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 |
"Modified: 20.5.1996 / 17:44:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2191 |
"Modified: 14.10.1996 / 22:26:35 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2192 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2193 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2194 |
exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2195 |
"an expose event - nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2196 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2197 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2198 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2199 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2200 |
focusIn |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2201 |
"got keyboard focus - do nothing here" |
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 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2204 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2205 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2206 |
focusOut |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
"lost keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2209 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2211 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2212 |
graphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
"an expose event after a scroll - do normal redraw processing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2214 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
self exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2216 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2217 |
|
5961 | 2218 |
hotkeyWithId:aId rawKey:aKey |
2219 |
"default action is to do nothing - may be reimplemented " |
|
2220 |
^ self |
|
2221 |
! |
|
2222 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2223 |
keyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2224 |
"a key was pressed in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2225 |
Here only keyCommands are handled - more action has to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
be implemented by redefining this method" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2227 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2228 |
|action rest restKey keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2229 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2230 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2231 |
action := keyCommands at:key ifAbsent:[nil]. |
2232 |
action value |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
]. |
3514 | 2234 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2235 |
key isSymbol ifTrue:[ |
8259 | 2236 |
(key startsWith:'Basic') ifTrue:[ |
2237 |
"/ an unhandled BasicFoo key; |
|
2238 |
"/ retry as Foo |
|
2239 |
rest := key withoutPrefix:'Basic'. |
|
2240 |
restKey := rest asSymbolIfInterned. |
|
2241 |
restKey notNil ifTrue:[ |
|
2242 |
self keyPress:restKey x:x y:y |
|
2243 |
] |
|
2244 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2245 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2246 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2247 |
"Modified: 6.11.1996 / 17:51:15 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2248 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2249 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
keyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2251 |
"default action is to do nothing" |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2252 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2253 |
key isSymbol ifTrue:[ |
8259 | 2254 |
(key startsWith:#Basic) ifTrue:[ |
2255 |
"/ an unhandled BasicFoo key; |
|
2256 |
"/ retry as Foo |
|
2257 |
||
2258 |
self keyRelease:(key copyFrom:#Basic size) asSymbol x:x y:y |
|
2259 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2260 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2261 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2262 |
^ self |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2263 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2264 |
"Modified: 6.11.1996 / 17:51:20 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2265 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
|
6828 | 2267 |
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime |
2268 |
"ignored" |
|
2269 |
||
2270 |
^ self |
|
2271 |
! |
|
2272 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2273 |
noExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2274 |
"a no expose event after a scroll (event-mode only)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2275 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
2276 |
self setGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2277 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2278 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2279 |
pointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2280 |
"mouse cursor entered view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2281 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2282 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2283 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2284 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2285 |
pointerLeave:state |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2286 |
"mouse cursor left view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2287 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2288 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2289 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2290 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2291 |
resizeRequest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2294 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2295 |
waitForExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2296 |
"wait until an expose event arrives (to wait for scroll-finish)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2297 |
|
2421 | 2298 |
|wg endPollTime pollDelay| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2299 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2300 |
device scrollsAsynchronous ifFalse:[ |
6372 | 2301 |
self setGotExposeFlag. |
2302 |
^ self |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2303 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2304 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2305 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2306 |
wg notNil ifTrue:[ |
6372 | 2307 |
"/ |
2308 |
"/ a normal (suspendable) view. |
|
2309 |
"/ wait by doing a real wait |
|
2310 |
"/ |
|
2311 |
wg sensor waitForExposeFor:self |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2312 |
] ifFalse:[ |
6372 | 2313 |
"/ |
2314 |
"/ a pure event driven view. |
|
2315 |
"/ wait by doing a direct dispatch loop until the event arrives. |
|
2316 |
"/ i.e. poll for the event |
|
2317 |
"/ |
|
2318 |
device isWindowsPlatform ifTrue:[ |
|
7744 | 2319 |
pollDelay := 0.5. |
6372 | 2320 |
] ifFalse:[ |
7744 | 2321 |
pollDelay := 1. |
6372 | 2322 |
]. |
2323 |
endPollTime := Timestamp now addSeconds:pollDelay. |
|
2324 |
||
2325 |
[self gotExpose] whileFalse:[ |
|
2326 |
realized ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2327 |
(device exposeEventPendingFor:gc drawableId withSync:true) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2328 |
device dispatchExposeEventFor:gc drawableId. |
6372 | 2329 |
]. |
2330 |
]. |
|
2331 |
realized ifFalse:[ |
|
2332 |
self setGotExposeFlag. |
|
2333 |
^ self |
|
2334 |
]. |
|
2335 |
||
2336 |
"/ break out of the poll after a while |
|
2337 |
||
2338 |
Timestamp now > endPollTime ifTrue:[ |
|
2339 |
'DisplaySurface [warning]: lost expose event' errorPrintCR. |
|
2340 |
self setGotExposeFlag. |
|
2341 |
^ self |
|
2342 |
]. |
|
2343 |
Processor yield. |
|
2344 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2345 |
] |
1129
2a3eaf218500
destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
2346 |
|
2421 | 2347 |
"Modified: / 9.1.1999 / 01:58:09 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2348 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2349 |
|
3884 | 2350 |
!DisplaySurface methodsFor:'initialization & release'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2351 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2352 |
destroy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2353 |
"view is about to be destroyed - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2354 |
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
|
2355 |
then the view is physically destroyed." |
4291 | 2356 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2357 |
self |
7448 | 2358 |
middleButtonMenu:nil; |
2359 |
keyCommands:nil. |
|
7449 | 2360 |
device notNil ifTrue:[ |
2361 |
device removeKnownView:self withId:nil. |
|
2362 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2363 |
super destroy. |
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2364 |
! |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2365 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2366 |
destroyed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2367 |
"view has been destroyed by someone else" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2368 |
|
4435 | 2369 |
|id| |
2370 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2371 |
(id := self drawableId) notNil ifTrue:[ |
7444 | 2372 |
gc setId:nil. |
2373 |
self graphicsDevice removeKnownView:self withId:id. |
|
2374 |
realized := false. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2375 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2376 |
self destroy |
1481 | 2377 |
|
2378 |
"Modified: 22.3.1997 / 14:56:34 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2379 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2380 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2381 |
initCursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2382 |
"default cursor for all views" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2383 |
|
2453 | 2384 |
cursor := Cursor normal |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2385 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2386 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2387 |
initStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2388 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2389 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2390 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2391 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2392 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2393 |
initialize |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2394 |
"initialize defaults" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2395 |
|
7844 | 2396 |
<modifier: #super> "must be called if redefined" |
2397 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2398 |
super initialize. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2399 |
|
4137 | 2400 |
eventMask := 0. |
2995 | 2401 |
device notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2402 |
eventMask := device defaultEventMask. |
2995 | 2403 |
]. |
7616 | 2404 |
gc notNil ifTrue:[ viewBackground := gc background]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2405 |
backed := false. |
3152 | 2406 |
flags := 0. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2407 |
self initCursor |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2408 |
|
7844 | 2409 |
"Modified: / 08-02-2017 / 00:26:56 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2410 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2411 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2412 |
prepareForReinit |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2413 |
gc notNil ifTrue:[ |
8259 | 2414 |
gc prepareForReinit. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2415 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2416 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2417 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2418 |
reAdjustGeometry |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2419 |
"sent late during snapin processing, nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2420 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2421 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2422 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2423 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2424 |
recreate |
3300 | 2425 |
"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
|
2426 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2427 |
viewBackground isColor ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2428 |
viewBackground := viewBackground onDevice:device. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2429 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2430 |
super recreate. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2431 |
cursor notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2432 |
cursor := cursor onDevice:device. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2433 |
]. |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2434 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
2435 |
"Modified: 28.3.1997 / 13:48:06 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2436 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2437 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2438 |
reinitStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2439 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2440 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2441 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2442 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2443 |
|
3291 | 2444 |
releaseDeviceResources |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2445 |
super destroy. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2446 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2447 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2448 |
!DisplaySurface methodsFor:'keyboard commands'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2449 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2450 |
addActionForKey:aKey action:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2451 |
"define a keyboard command function" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2452 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2453 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2454 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2455 |
(keyCommands := self keyCommands) isNil ifTrue:[ |
8259 | 2456 |
self keyCommands:(keyCommands := IdentityDictionary new). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2457 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2458 |
keyCommands at:aKey put:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2459 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2460 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2461 |
keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2462 |
^ self getAttribute:#keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2463 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2464 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2465 |
keyCommands:aDictionaryOrNil |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2466 |
self setAttribute:#keyCommands to:aDictionaryOrNil |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2467 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2468 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2469 |
removeActionForKey:aKey |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2470 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2471 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2472 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2473 |
keyCommands removeKey:aKey ifAbsent:nil |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2474 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2475 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2476 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2477 |
!DisplaySurface methodsFor:'queries'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2478 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2479 |
buttonMotionEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2480 |
"return true, if a button motion event is pending. |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2481 |
Normally, you don't want to use this, since no polling is needed |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2482 |
(not even for mouse-tracking). |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2483 |
Also, don't use it, since it does not honor the windowGroup, |
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2484 |
but goes directly to the device instead. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2485 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2486 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2487 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2488 |
^ device eventPending:#buttonMotion for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2489 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2490 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2491 |
buttonReleaseEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2492 |
"return true, if a button release event is pending. |
7655 | 2493 |
Don't use it, since it does not honor the windowGroup, but |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2494 |
goes directly to the device instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2495 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2496 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2497 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2498 |
^ device eventPending:#buttonRelease for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2499 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2500 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2501 |
exposeEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2502 |
"return true, if an expose event is pending." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2503 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2504 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2505 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2506 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2507 |
windowGroup notNil ifTrue:[ |
8259 | 2508 |
(windowGroup sensor hasExposeEventFor:self) ifTrue:[^ true]. |
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2509 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2510 |
^ device eventPending:#expose for:gc drawableId |
2352 | 2511 |
|
2512 |
"Modified: / 15.9.1998 / 23:18:16 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2513 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2514 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2515 |
redrawsFull |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2516 |
^ false |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2517 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2518 |
"Created: 4.3.1996 / 14:17:22 / cg" |
3674 | 2519 |
! |
2520 |
||
2521 |
shown |
|
2522 |
"return true if at least a part of myself is currently visible |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2523 |
(I am mapped and not completely covered). |
3674 | 2524 |
Assumed that I am always visible when realized." |
2525 |
||
2526 |
^ realized |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2527 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2528 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2529 |
!DisplaySurface methodsFor:'queries-contents'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2531 |
heightOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
"return the height of the contents in pixels. |
7691 | 2533 |
Since we don't know here, just return the view's size. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2534 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2535 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2536 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2537 |
^ self height |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2539 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2540 |
widthOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2541 |
"return the width of the contents in pixels. |
7691 | 2542 |
Since we don't know here, just return the view's size. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2545 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2546 |
^ self width |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2547 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2548 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2549 |
xOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2550 |
"return the x-origin of the contents in pixels. |
7655 | 2551 |
Since we don't know here, just return 0 for left. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2552 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2553 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2554 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2555 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2556 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2557 |
yOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2558 |
"return the y-origin of the contents in pixels. |
7655 | 2559 |
Since we don't know here, just return 0 for top. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2560 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2561 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2562 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2563 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2564 |
|
7734 | 2565 |
!DisplaySurface methodsFor:'testing'! |
2566 |
||
2567 |
isDebugView |
|
2568 |
^ false |
|
2569 |
! |
|
2570 |
||
2571 |
isPopUpView |
|
2572 |
"return true, if this view should be put on top (raised) automatically. |
|
2573 |
usually this is true for alertBoxes etc." |
|
2574 |
||
2575 |
^ false |
|
2576 |
||
2577 |
"Created: / 22.1.1998 / 15:01:32 / stefan" |
|
2578 |
! |
|
2579 |
||
2580 |
isRootView |
|
2581 |
"return true, if the receiver is a root view |
|
2582 |
false is returned here, this is only redefined in DisplayRootView." |
|
2583 |
||
2584 |
^ false |
|
2585 |
||
2586 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2587 |
"Created: 5.7.1996 / 14:58:55 / cg" |
|
2588 |
! |
|
2589 |
||
2590 |
isTopView |
|
2591 |
"return true, if the receiver is some kind of topview; |
|
2592 |
false is returned here; redefined in some subclasses." |
|
2593 |
||
2594 |
^ false |
|
2595 |
||
2596 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2597 |
"Created: 22.3.1997 / 14:45:29 / cg" |
|
2598 |
! |
|
2599 |
||
2600 |
isView |
|
2601 |
"return true, if the receiver is some kind of view; |
|
2602 |
true is returned here." |
|
2603 |
||
2604 |
^ true |
|
2605 |
||
2606 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2607 |
! ! |
|
2608 |
||
3276 | 2609 |
!DisplaySurface methodsFor:'user interaction & notifications'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2610 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2611 |
beep |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2612 |
"output an audible beep or bell on my screen device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2613 |
|
8257 | 2614 |
device beep |
2615 |
||
2616 |
"Created: 28.5.1996 / 16:16:13 / cg" |
|
2617 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
|
2618 |
! |
|
2619 |
||
2620 |
beepInEditor |
|
8259 | 2621 |
"output an audible beep or bell on my screen device, if enabled. |
2622 |
||
2623 |
Beep to wakeup the user after some error/not found condition in an editor. |
|
2624 |
Use this ONLY to beep in response to a bad user operation (not system failure beeps). |
|
2625 |
Can be disabled via the settings if too annoying" |
|
8257 | 2626 |
|
2627 |
device beepInEditor |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2628 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2629 |
"Created: 28.5.1996 / 16:16:13 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2630 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2631 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2632 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2633 |
showActivity:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2634 |
"this is sent indirectly by the activityNotification mechanism. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2635 |
Defined here as a fallback, if ever sent to non topviews." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2636 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2637 |
Transcript showCR:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2638 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2639 |
"Modified: 18.5.1996 / 15:44:33 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2640 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2641 |
|
1093 | 2642 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2643 |
|
6710 | 2644 |
version |
6937 | 2645 |
^ '$Header$' |
6710 | 2646 |
! |
2647 |
||
5458 | 2648 |
version_CVS |
6937 | 2649 |
^ '$Header$' |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2650 |
! ! |
3791 | 2651 |
|
6063 | 2652 |
|
3211 | 2653 |
DisplaySurface initialize! |