author | Claus Gittinger <cg@exept.de> |
Sun, 04 Aug 2019 22:18:05 +0200 | |
changeset 8758 | c8ffbed1d428 |
parent 8724 | 561f7af71a49 |
child 8843 | 6a876fd40a2e |
permissions | -rw-r--r-- |
8597 | 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 |
8597 | 688 |
"return my uuid (for automation and the polonium st/x capture/replay tool). |
8219 | 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 |
" |
|
8597 | 701 |
Transcript topView automationUUID |
702 |
Transcript topView instanceUUID |
|
8219 | 703 |
" |
704 |
||
705 |
"Created: / 09-11-2017 / 22:33:10 / cg" |
|
8597 | 706 |
"Modified (comment): / 05-12-2018 / 17:50:03 / Stefan Vogel" |
8219 | 707 |
! |
708 |
||
709 |
automationUUID:aUuidOrUuidString |
|
710 |
"set my uuid (for automation and the pollonium st/x capture/replay tool). |
|
711 |
This is a widget id, as specified in the uispec (if it is definedthere). |
|
712 |
Will be the same for all instances |
|
713 |
(i.e. the same in different instances of the application). |
|
714 |
Contrast this with the instanceUUID, which is unique for each view. |
|
715 |
||
716 |
Notice: old uiSpecs do not provide/define a uuid, and nil is returned from uuid; |
|
717 |
so the application's specs must be re-edited and saved again." |
|
718 |
||
719 |
uuid := aUuidOrUuidString |
|
720 |
||
721 |
"Created: / 09-11-2017 / 22:33:14 / cg" |
|
722 |
! |
|
723 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
backingStore:how |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
"turn on/off backingStore (saving my pixels) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
how may true/false, but also #always, #whenMapped or #never." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
728 |
how ~~ backed ifTrue:[ |
8259 | 729 |
backed := how. |
730 |
super backingStore:how. |
|
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
734 |
eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
"return a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
736 |
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
|
737 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
^ eventMask |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
741 |
eventMask:aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
"set a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
743 |
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
|
744 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
745 |
eventMask := aMask |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
748 |
getKeyboardFocus |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
749 |
"tell the Display to assign keyboard focus to the receiver" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
750 |
|
3674 | 751 |
self shown ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
752 |
device setInputFocusTo:self drawableId. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
753 |
]. |
2512 | 754 |
|
755 |
"Modified: / 15.3.1999 / 08:25:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
756 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
757 |
|
8219 | 758 |
instanceUUID |
8216 | 759 |
"return my unique uuid. |
760 |
This will be assigned once and only once per instance |
|
761 |
(i.e. the same type of view within different applications will |
|
8219 | 762 |
have different instanceUUIDs)" |
8216 | 763 |
|
764 |
|id| |
|
765 |
||
8219 | 766 |
(id := self getAttribute:#instanceUUID) isNil ifTrue:[ |
767 |
self setAttribute:#instanceUUID to:(id := UUID new). |
|
8216 | 768 |
]. |
769 |
^ id |
|
770 |
||
771 |
" |
|
772 |
Transcript topView getAttribute:#instanceUuid |
|
773 |
Transcript topView instanceUuid |
|
774 |
" |
|
775 |
||
8219 | 776 |
"Created: / 09-11-2017 / 22:32:07 / cg" |
8216 | 777 |
! |
778 |
||
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
779 |
isInputOnly |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
780 |
"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
|
781 |
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
|
782 |
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
|
783 |
others, which where never meant to work in such a setup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
784 |
(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
|
785 |
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
|
786 |
or on other plattforms." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
787 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
788 |
^ false |
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
789 |
|
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
790 |
"Created: 1.6.1996 / 13:21:51 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
791 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
792 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
793 |
preferredDepth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
794 |
"return a non nil integer, if a specific depth is wanted in this view. |
8158 | 795 |
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
|
796 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
797 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
798 |
^ nil |
8158 | 799 |
|
800 |
"Modified (comment): / 01-09-2017 / 09:57:44 / cg" |
|
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
803 |
preferredVisual |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
804 |
"return a non nil id, if a specific visual is wanted in this view. |
8158 | 805 |
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
|
806 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
807 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
808 |
^ nil |
8158 | 809 |
|
810 |
"Modified (comment): / 01-09-2017 / 09:57:49 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
811 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
812 |
|
3152 | 813 |
saveUnder |
814 |
"return the saveUnder flag" |
|
815 |
||
816 |
^ flags bitTest:SaveUnderFlagMask |
|
817 |
! |
|
818 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
saveUnder:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
820 |
"turn on/off saveUnder (saving pixels under myself) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
821 |
- used for temporary views (i.e. PopUps and ModalBoxes)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
822 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
823 |
aBoolean ifTrue:[ |
8259 | 824 |
flags := flags bitOr:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
825 |
] ifFalse:[ |
8259 | 826 |
flags := flags bitClear:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
827 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
828 |
gc saveUnder:aBoolean. |
3859
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 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
831 |
setPointerPosition:aRelativePoint |
8467 | 832 |
"set the pointer to aRelativePoint relative to the view's origin. |
833 |
Warning: moving the mouse pointer may lead to the mouse falling off the table |
|
834 |
after a while. So it should be used very very seldom (if at all)" |
|
3859
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 |
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
|
837 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
838 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
839 |
Transcript setPointerPosition:Transcript extent // 2. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
840 |
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
|
841 |
" |
8467 | 842 |
|
843 |
"Modified (comment): / 14-09-2018 / 17:59:18 / Claus Gittinger" |
|
8216 | 844 |
! |
845 |
||
846 |
uuid |
|
8219 | 847 |
<resource: #obsolete> |
848 |
^ self automationUUID |
|
8216 | 849 |
|
850 |
" |
|
851 |
Transcript topView uuid |
|
852 |
Transcript topView instanceUuid |
|
853 |
" |
|
854 |
||
8219 | 855 |
"Modified: / 09-11-2017 / 22:33:24 / cg" |
8216 | 856 |
! |
857 |
||
8218 | 858 |
uuid:aUuidOrUuidString |
8219 | 859 |
<resource: #obsolete> |
860 |
^ self automationUUID:aUuidOrUuidString |
|
861 |
||
862 |
"Modified: / 09-11-2017 / 22:34:12 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
863 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
864 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
865 |
!DisplaySurface methodsFor:'accessing-names'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
866 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
867 |
icon |
7691 | 868 |
"return the view's icon - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
869 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
870 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
871 |
^ nil |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
874 |
icon:aBitmap |
7691 | 875 |
"set the view's icon - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
876 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
877 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
878 |
^ self |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
881 |
iconLabel |
7691 | 882 |
"return the view's icon label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
883 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
884 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
885 |
^ nil |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
888 |
iconLabel:aLabel |
7691 | 889 |
"set the view's icon label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
890 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
891 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
892 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
893 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
894 |
|
1481 | 895 |
iconMask |
7691 | 896 |
"return the view's iconMask - this is nil here. |
1481 | 897 |
Only standardSystemViews may support labels and icons." |
898 |
||
899 |
^ nil |
|
900 |
! |
|
901 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
902 |
iconView |
7691 | 903 |
"return the view's iconView - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
904 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
905 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
906 |
^ nil |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
909 |
iconView:aView |
7691 | 910 |
"set the view's icon view - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
911 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
912 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
913 |
^ self |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
916 |
label |
7691 | 917 |
"return the view's label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
918 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
919 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
920 |
^ nil |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
923 |
label:aLabel |
7691 | 924 |
"set the view's label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
925 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
926 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
927 |
^ self |
8724 | 928 |
! |
929 |
||
930 |
label:aLabel iconLabel:iconLabel |
|
931 |
"set both the label and the iconLabel. |
|
932 |
Only standardSystemViews support labels and icons." |
|
933 |
||
934 |
self label:aLabel. |
|
935 |
self iconLabel:iconLabel |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
936 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
937 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
938 |
!DisplaySurface methodsFor:'accessing-private'! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
939 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
940 |
clearGotExposeFlag |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
941 |
"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
|
942 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
943 |
flags := flags bitClear:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
944 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
945 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
946 |
getAttribute:key |
7556 | 947 |
"a place for additional attributes; |
948 |
allows for non-instvar slots to be added" |
|
949 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
950 |
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
|
951 |
^ 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
|
952 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
953 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
954 |
gotExpose |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
955 |
"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
|
956 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
957 |
^ flags bitTest:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
958 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
959 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
960 |
setAttribute:key to:newValue |
7556 | 961 |
"a place for additional attributes; |
962 |
allows for non-instvar slots to be added" |
|
963 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
964 |
newValue isNil ifTrue:[ |
7556 | 965 |
moreAttributes notNil ifTrue:[ |
966 |
moreAttributes removeKey:key ifAbsent:[]. |
|
967 |
moreAttributes := moreAttributes asNilIfEmpty |
|
968 |
] |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
969 |
] ifFalse:[ |
7556 | 970 |
moreAttributes isNil ifTrue:[ |
971 |
moreAttributes := IdentityDictionary new. |
|
972 |
]. |
|
973 |
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
|
974 |
]. |
5081 | 975 |
! |
976 |
||
977 |
setGotExposeFlag |
|
978 |
"internal; used to wait for an expose-event after a scroll operation" |
|
979 |
||
980 |
flags := flags bitOr:GotExposeFlagMask. |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
981 |
! ! |
4969 | 982 |
|
5136 | 983 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
984 |
!DisplaySurface methodsFor:'button menus'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
985 |
|
5773 | 986 |
getMiddleButtonMenu |
987 |
"return the menu associated with the middle mouse button. |
|
988 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
989 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
990 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
991 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
992 |
^ self getAttribute:#middleButtonMenu |
5773 | 993 |
|
994 |
"Created: / 07-07-2011 / 18:16:21 / cg" |
|
995 |
! |
|
996 |
||
997 |
middleButtonMenu |
|
998 |
"return the menu associated with the middle mouse button. |
|
999 |
Here, return a hooked on menu, but usually redefined to provide a widget-specific |
|
1000 |
menu." |
|
1001 |
||
1002 |
^ self getMiddleButtonMenu |
|
1003 |
||
1004 |
"Modified (comment): / 07-07-2011 / 18:18:28 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1005 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1006 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1007 |
middleButtonMenu:aMenu |
5773 | 1008 |
"associate aMenu with the middle mouse button. |
1009 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
1010 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
1011 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1012 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1013 |
|oldMenu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1014 |
|
5773 | 1015 |
(oldMenu := self getMiddleButtonMenu) notNil ifTrue:[ |
8259 | 1016 |
oldMenu isArray ifFalse:[ |
1017 |
oldMenu destroy |
|
1018 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1019 |
]. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1020 |
self setMiddleButtonMenu:aMenu |
5740 | 1021 |
|
5773 | 1022 |
"Modified: / 07-07-2011 / 18:18:00 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1023 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1024 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1025 |
setMiddleButtonMenu:aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1026 |
"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
|
1027 |
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
|
1028 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1029 |
self setAttribute:#middleButtonMenu to:aMenu |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1030 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1031 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1032 |
!DisplaySurface methodsFor:'clipboard'! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1033 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1034 |
getClipboardObject |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1035 |
"return the object selection |
8158 | 1036 |
- 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
|
1037 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1038 |
^ device getClipboardObjectFor:self drawableId. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1039 |
|
8158 | 1040 |
"Modified: / 13-02-1997 / 13:18:50 / cg" |
1041 |
"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
|
1042 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1043 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1044 |
getClipboardText |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1045 |
"return the copyBuffers contents |
8158 | 1046 |
- 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
|
1047 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1048 |
^ self getClipboardText:#clipboard |
8158 | 1049 |
|
1050 |
"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
|
1051 |
! |
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 |
getClipboardText:selectionBufferSymbol |
8158 | 1054 |
"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
|
1055 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1056 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1057 |
or: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1058 |
#selection. |
4283
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 |
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
|
1061 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1062 |
^ device getClipboardText:selectionBufferSymbol for:self drawableId. |
8158 | 1063 |
|
1064 |
"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
|
1065 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1066 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1067 |
getSelection |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1068 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1069 |
self obsoleteMethodWarning:'use #getClipboardObject'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1070 |
^ self getClipboardObject |
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 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1073 |
getTextSelection |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1074 |
"return the copyBuffers contents |
8158 | 1075 |
- 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
|
1076 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1077 |
<resource: #obsolete> |
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 |
self obsoleteMethodWarning:'use #getClipboardText'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1080 |
^ self getClipboardText |
8158 | 1081 |
|
1082 |
"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
|
1083 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1084 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1085 |
getTextSelection:selectionBufferSymbol |
8158 | 1086 |
"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
|
1087 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
8158 | 1088 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1089 |
or: |
8158 | 1090 |
#selection. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1091 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1092 |
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
|
1093 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1094 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1095 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1096 |
self obsoleteMethodWarning:'#use getClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1097 |
^ self getClipboardText:selectionBufferSymbol |
8158 | 1098 |
|
1099 |
"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
|
1100 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1101 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1102 |
setClipboardObject:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1103 |
"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
|
1104 |
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
|
1105 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1106 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1107 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1108 |
|
7687 | 1109 |
setClipboardText:aString |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1110 |
"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
|
1111 |
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
|
1112 |
|
7687 | 1113 |
device setClipboardText:aString ownerView:self |
1114 |
||
1115 |
"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
|
1116 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1117 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1118 |
setSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1119 |
"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
|
1120 |
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
|
1121 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1122 |
<resource: #obsolete> |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1123 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1124 |
self obsoleteMethodWarning:'use setClipboardObject:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1125 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1126 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1127 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1128 |
setTextSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1129 |
"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
|
1130 |
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
|
1131 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1132 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1133 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1134 |
self obsoleteMethodWarning:'use setClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1135 |
device setClipboardText:something ownerView:self |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1136 |
! ! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1137 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1138 |
!DisplaySurface methodsFor:'drawing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1139 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1140 |
clearDeviceRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1141 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1142 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1143 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1144 |
|
7020 | 1145 |
|oldPaint org patternOffsetX patternOffsetY| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1146 |
|
7744 | 1147 |
(w <= 0 or:[h <= 0]) ifTrue:[^ self]. |
1148 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1149 |
gc isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1150 |
"nothing to clear" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1151 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1152 |
]. |
7302 | 1153 |
viewBackground isNil ifTrue:[^ self]. "/ how can this happen? |
1154 |
||
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1155 |
viewBackground isColor ifFalse:[ |
6240 | 1156 |
viewBackground isViewBackground ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1157 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1158 |
self |
7744 | 1159 |
paint:gc background; |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1160 |
fillDeviceRectangleX:x y:y width:w height:h; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1161 |
paint:oldPaint. |
6240 | 1162 |
viewBackground fillRectangleX:x y:y width:w height:h in:self. |
1163 |
^ self. |
|
1164 |
]. |
|
1165 |
||
7473 | 1166 |
org := self viewOrigin. |
7020 | 1167 |
(device supportsMaskedDrawingWith:viewBackground) ifFalse:[ |
1168 |
"/ hand-fill: the device cannot draw with a bitmap pattern underneath. |
|
7473 | 1169 |
self fillDeviceRectangleWithPattern:viewBackground x:x y:y width:w height:h patternOffset:org. |
7020 | 1170 |
^ self. |
1171 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1172 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1173 |
patternOffsetX := (org x rounded \\ viewBackground width). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1174 |
patternOffsetY := (org y rounded \\ viewBackground height). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1175 |
(patternOffsetX ~= 0 or:[patternOffsetY ~= 0]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1176 |
(device supportsMaskedDrawingWithOffset:viewBackground) ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1177 |
"/ hand-fill: the device cannot draw with a shifted bitmap pattern underneath. |
7473 | 1178 |
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
|
1179 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1180 |
]. |
5458 | 1181 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1182 |
gc setDeviceMaskOriginX:patternOffsetX negated y:patternOffsetY negated. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1183 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1184 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1185 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1186 |
fill in device coordinates - not logical coordinates |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1187 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1188 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1189 |
self |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1190 |
paint:viewBackground; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1191 |
fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground"; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1192 |
paint:oldPaint. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1193 |
|
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1194 |
"Modified: / 4.5.1999 / 13:00:34 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1195 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1196 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1197 |
clearRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1198 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1199 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1200 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1201 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1202 |
|pX pY pW pH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1203 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1204 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1205 |
currentTransformation notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1206 |
pX := currentTransformation applyToX:x. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1207 |
pY := currentTransformation applyToY:y. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1208 |
pW := currentTransformation applyScaleX:w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1209 |
pH := currentTransformation applyScaleY:h. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1210 |
] ifFalse:[ |
6692 | 1211 |
pX := x. |
1212 |
pY := y. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1213 |
pW := w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1214 |
pH := h. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1215 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1216 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1217 |
^ 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
|
1218 |
|
2393
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
1219 |
"Modified: / 30.10.1998 / 15:00:37 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1220 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1221 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1222 |
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
|
1223 |
"fill a rectangular area with some pattern. |
5458 | 1224 |
A helper for devices which do not support pixmap drawing (i.e. win95). |
1225 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1226 |
Caller must ensure that aPixmap is really a form. |
1227 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1228 |
therefore it is actually not obsolete." |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1229 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1230 |
|r b |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1231 |
pW "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1232 |
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
|
1233 |
xR0 |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1234 |
xR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1235 |
yR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1236 |
xE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1237 |
yE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1238 |
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
|
1239 |
offsX "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1240 |
offsY "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1241 |
oX "{ Class: SmallInteger }" |
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1242 |
oY "{ Class: SmallInteger }"| |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1243 |
|
2640
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1244 |
x := xIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1245 |
y := yIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1246 |
w := wIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1247 |
h := hIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1248 |
|
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1249 |
x := x max:0. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1250 |
y := y max:0. |
7744 | 1251 |
r := (xIn + w) min:width. |
1252 |
b := (yIn + h) min:height. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1253 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1254 |
pW := aPixmap width. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1255 |
pH := aPixmap height. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1256 |
|
7470 | 1257 |
oldClip := self deviceClippingBoundsOrNil. |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1258 |
oldClip notNil ifTrue:[ |
7426 | 1259 |
x := x max:oldClip left. |
1260 |
y := y max:oldClip top. |
|
1261 |
r := r min:oldClip right. |
|
1262 |
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
|
1263 |
]. |
7744 | 1264 |
w := r-x. |
1265 |
h := b-y. |
|
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1266 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1267 |
yR := (y // pH) * pH. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1268 |
yE := y+h. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1269 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1270 |
yR >= yE ifTrue:[^ self]. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1271 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1272 |
xR0 := (x // pW) * pW. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1273 |
xE := x+w. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1274 |
|
6770 | 1275 |
xR0 >= xE ifTrue:[^ self]. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1276 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1277 |
aPixmap depth == 1 ifTrue:[ |
7744 | 1278 |
oldFg := gc foreground. |
1279 |
oldBg := gc background. |
|
7426 | 1280 |
(clrMap := aPixmap colorMap) notNil ifTrue:[ |
1281 |
bg := clrMap at:1. |
|
1282 |
fg := clrMap at:2. |
|
1283 |
] ifFalse:[ |
|
1284 |
bg := self whiteColor. |
|
1285 |
fg := self blackColor. |
|
1286 |
]. |
|
7744 | 1287 |
gc foreground:fg background:bg. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1288 |
]. |
7470 | 1289 |
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
|
1290 |
|
5458 | 1291 |
offsX := (xR0 + pattOffs x) \\ pW. |
1292 |
offsY := (yR + pattOffs y) \\ pH. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1293 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1294 |
oY := offsY. |
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1295 |
[yR < yE] whileTrue:[ |
7426 | 1296 |
xR := xR0. |
1297 |
oX := offsX. |
|
1298 |
[xR < xE] whileTrue:[ |
|
1299 |
self |
|
1300 |
copyFrom:aPixmap |
|
1301 |
x:oX y:oY |
|
1302 |
toX:xR y:yR |
|
1303 |
width:(pW - oX) height:(pH - oY) |
|
1304 |
async:true. |
|
1305 |
xR := xR + pW - oX. |
|
1306 |
oX := 0. |
|
1307 |
]. |
|
1308 |
yR := yR + pH - oY. |
|
1309 |
oY := 0. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1310 |
]. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1311 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1312 |
oldFg notNil ifTrue:[ |
7744 | 1313 |
gc foreground:oldFg background:oldBg. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1314 |
]. |
7470 | 1315 |
self deviceClippingBounds:oldClip. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1316 |
|
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1317 |
"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
|
1318 |
"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
|
1319 |
"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
|
1320 |
! |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1321 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1322 |
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
|
1323 |
"fill a rectangular area with aPixmap. |
5458 | 1324 |
A helper for devices which do not support pixmap filling (i.e. win95 screens). |
1325 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1326 |
Caller must ensure that the aPixmap is really a form. |
1327 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1328 |
therefore it is actually not obsolete." |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1329 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1330 |
|pX pY nW nH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1331 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1332 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1333 |
currentTransformation notNil ifTrue:[ |
7744 | 1334 |
pX := currentTransformation applyToX:x. |
1335 |
pY := currentTransformation applyToY:y. |
|
1336 |
nW := currentTransformation applyScaleX:w. |
|
1337 |
nH := currentTransformation applyScaleY:h. |
|
1338 |
nW < 0 ifTrue:[ |
|
1339 |
nW := nW abs. |
|
1340 |
pX := pX - nW. |
|
1341 |
]. |
|
1342 |
nH < 0 ifTrue:[ |
|
1343 |
nH := nH abs. |
|
1344 |
pY := pY - nH. |
|
1345 |
]. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1346 |
] ifFalse:[ |
7744 | 1347 |
pX := x. |
1348 |
pY := y. |
|
1349 |
nW := w. |
|
1350 |
nH := h. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1351 |
]. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1352 |
pX := pX rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1353 |
pY := pY rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1354 |
nW := nW rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1355 |
nH := nH rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1356 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1357 |
self |
7744 | 1358 |
fillDeviceRectangleWithPattern:aPixmap |
1359 |
x:pX y:pY width:nW height:nH |
|
1360 |
patternOffset:pattOffs |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1361 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1362 |
"Modified: 4.6.1996 / 17:58:49 / cg" |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1363 |
! |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1364 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1365 |
redraw |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1366 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1367 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1368 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1369 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1370 |
!DisplaySurface methodsFor:'enable/disable events'! |
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 |
compressMotionEvents:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1373 |
"enable/disable motion event compression |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1374 |
(i.e. replacing all motion events by the last one). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1375 |
Compression makes almost always sense, except when |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1376 |
doing things like freehand drawing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1377 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1378 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1379 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1380 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1381 |
windowGroup notNil ifTrue:[ |
8259 | 1382 |
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
|
1383 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1384 |
! |
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 |
disableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1387 |
"disable all button events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1388 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1389 |
self disableEvent:#buttonPress; disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1390 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1391 |
"Modified: 29.4.1996 / 11:09:25 / cg" |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1394 |
disableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1395 |
"disable button motion-while-button-is-pressed events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1396 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1397 |
self disableEvent:#buttonMotion |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1400 |
disableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
"disable button press events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1403 |
self disableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1404 |
! |
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 |
disableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1407 |
"disable button release events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1408 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1409 |
self disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1410 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1411 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1412 |
disableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1413 |
"disable both mouse-pointer enter and leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1414 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1415 |
self disableEvent:#enter; disableEvent:#leave |
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 |
"Modified: 29.4.1996 / 11:09:37 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1418 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1419 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1420 |
disableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1421 |
"disable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1422 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1423 |
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
|
1424 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1425 |
eventMask := eventMask bitAnd:(self graphicsDevice eventMaskFor:anEventSymbol) bitInvert. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1426 |
self drawableId notNil ifTrue:[ |
8259 | 1427 |
self graphicsDevice setEventMask:eventMask in:self drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1429 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1430 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1431 |
disableMotionEvents |
1332 | 1432 |
"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
|
1433 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
self disableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1435 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1436 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
enableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
"enable both mouse button press and release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1439 |
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
|
1440 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1441 |
self enableEvent:#buttonPress; enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1442 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1443 |
"Modified: 29.4.1996 / 11:09:46 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1444 |
! |
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 |
enableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1447 |
"enable mouse-pointer motion-while-button-is-pressed events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1448 |
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
|
1449 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1450 |
self enableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1451 |
! |
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 |
enableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1454 |
"enable mouse button press events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1455 |
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
|
1456 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1457 |
self enableEvent:#buttonPress |
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 |
enableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1461 |
"enable mouse button release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1462 |
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
|
1463 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1464 |
self enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1465 |
! |
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 |
enableEnterEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1468 |
"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
|
1469 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1470 |
self enableEvent:#enter |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1471 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1472 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1473 |
enableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1474 |
"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
|
1475 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1476 |
self enableEvent:#enter; enableEvent:#leave |
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 |
"Modified: 29.4.1996 / 11:09:55 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1479 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1480 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1481 |
enableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1482 |
"enable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1483 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1484 |
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
|
1485 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1486 |
eventMask := (eventMask ? 0) bitOr:(self graphicsDevice eventMaskFor:anEventSymbol). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1487 |
self drawableId notNil ifTrue:[ |
8259 | 1488 |
self graphicsDevice setEventMask:eventMask in:self drawableId |
727
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 |
enableFocusEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1493 |
"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
|
1494 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1495 |
self enableEvent:#focusChange |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1496 |
! |
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 |
enableKeyEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1499 |
"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
|
1500 |
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
|
1501 |
^C processing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1502 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1503 |
! |
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 |
enableKeyPressEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1506 |
"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
|
1507 |
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
|
1508 |
^C processing." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1509 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1510 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1511 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1512 |
enableKeyReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1513 |
"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
|
1514 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1515 |
self enableEvent:#keyRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1516 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1517 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1518 |
enableLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1519 |
"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
|
1520 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1521 |
self enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1522 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1523 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1524 |
enableMotionEvents |
4453 | 1525 |
"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
|
1526 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1527 |
self enableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1528 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1529 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1530 |
!DisplaySurface methodsFor:'event dispatching'! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1531 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1532 |
dispatchEvent:event |
2962 | 1533 |
"dispatch an event" |
1534 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1535 |
^ self |
8259 | 1536 |
dispatchEvent:event |
1537 |
withFocusOn:nil |
|
1538 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1539 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1540 |
"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
|
1541 |
! |
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 |
dispatchEvent:type arguments:arguments |
8501 | 1544 |
<resource: #obsolete> |
1545 |
"dispatch an event. |
|
1546 |
Obsoleted - now we always pass around event objects." |
|
2962 | 1547 |
|
3094 | 1548 |
"/ 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
|
1549 |
^ self |
8259 | 1550 |
dispatchEvent:nil |
1551 |
type:type |
|
1552 |
arguments:arguments |
|
1553 |
withFocusOn:nil |
|
1554 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1555 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1556 |
"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
|
1557 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1558 |
|
3094 | 1559 |
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
|
1560 |
"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
|
1561 |
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
|
1562 |
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
|
1563 |
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
|
1564 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1565 |
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
|
1566 |
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
|
1567 |
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
|
1568 |
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
|
1569 |
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
|
1570 |
before. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1571 |
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
|
1572 |
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
|
1573 |
forwarding." |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1574 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1575 |
|delegate selector delegateMessage delegateQuery |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1576 |
eventReceiver controller deviceMessage |
7410 | 1577 |
isKeyEvent isButtonEvent isMouseWheelEvent isPointerEvent isExposeEvent |
1578 |
||
8487 | 1579 |
rect x y w h delegatedEvent rgn |
8543 | 1580 |
|
8487 | 1581 |
eventForLastEventQuery| |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1582 |
|
8543 | 1583 |
type == #damage ifTrue:[ |
7739 | 1584 |
"/ OLDdamage scheme - this will vanish |
1585 |
self shown ifTrue:[ |
|
1586 |
rect := argArray. |
|
1587 |
x := rect left. |
|
1588 |
y := rect top. |
|
1589 |
w := rect width. |
|
1590 |
h := rect height. |
|
1591 |
gc transformation notNil ifTrue:[ |
|
1592 |
self deviceExposeX:x y:y width:w height:h |
|
1593 |
] ifFalse:[ |
|
1594 |
self exposeX:x y:y width:w height:h |
|
1595 |
] |
|
1596 |
]. |
|
1597 |
^ self |
|
4041 | 1598 |
]. |
1599 |
||
1600 |
type == #newDamage ifTrue:[ |
|
7739 | 1601 |
"/ New damage scheme |
1602 |
rgn := updateRegion. |
|
1603 |
updateRegion := nil. |
|
1604 |
self shown ifTrue:[ |
|
1605 |
rgn notNil ifTrue:[ |
|
1606 |
rgn do:[:rect | |
|
1607 |
"/ cg: I think the check for being realized may not be enough; |
|
1608 |
"/ there is a race here, if the view gets closed, while in the loop... |
|
1609 |
realized ifTrue:[ |
|
1610 |
x := rect left. |
|
1611 |
y := rect top. |
|
1612 |
w := rect width. |
|
1613 |
h := rect height. |
|
1614 |
gc transformation notNil ifTrue:[ |
|
1615 |
self deviceExposeX:x y:y width:w height:h |
|
1616 |
] ifFalse:[ |
|
1617 |
self exposeX:x y:y width:w height:h |
|
1618 |
] |
|
1619 |
] |
|
1620 |
] |
|
1621 |
] |
|
1622 |
]. |
|
1623 |
^ self |
|
2498 | 1624 |
]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1625 |
|
7410 | 1626 |
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
|
1627 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1628 |
(type == #'keyPress:x:y:') ifTrue:[ |
7739 | 1629 |
isKeyEvent := true. |
1630 |
deviceMessage := #'deviceKeyPress:x:y:'. |
|
1631 |
delegateMessage := #'keyPress:x:y:view:'. |
|
1632 |
delegateQuery := #'handlesKeyPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1633 |
] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[ |
7739 | 1634 |
isKeyEvent := true. |
1635 |
deviceMessage := #'deviceKeyRelease:x:y:'. |
|
1636 |
delegateMessage := #'keyRelease:x:y:view:'. |
|
1637 |
delegateQuery := #'handlesKeyRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1638 |
] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[ |
7739 | 1639 |
isButtonEvent := true. |
1640 |
deviceMessage := #'deviceButtonMotion:x:y:'. |
|
1641 |
delegateMessage := #'buttonMotion:x:y:view:'. |
|
1642 |
delegateQuery := #'handlesButtonMotion:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1643 |
] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[ |
7739 | 1644 |
isButtonEvent := true. |
1645 |
deviceMessage := #'deviceButtonPress:x:y:'. |
|
1646 |
delegateMessage := #'buttonPress:x:y:view:'. |
|
1647 |
delegateQuery := #'handlesButtonPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1648 |
] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[ |
7739 | 1649 |
isButtonEvent := true. |
1650 |
deviceMessage := #'deviceButtonRelease:x:y:'. |
|
1651 |
delegateMessage := #'buttonRelease:x:y:view:'. |
|
1652 |
delegateQuery := #'handlesButtonRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1653 |
] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[ |
7739 | 1654 |
isButtonEvent := true. |
1655 |
deviceMessage := #'deviceButtonShiftPress:x:y:'. |
|
1656 |
delegateMessage := #'buttonShiftPress:x:y:view:'. |
|
1657 |
delegateQuery := #'handlesButtonShiftPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1658 |
] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[ |
7739 | 1659 |
isButtonEvent := true. |
1660 |
deviceMessage := #'deviceButtonMultiPress:x:y:'. |
|
1661 |
delegateMessage := #'buttonMultiPress:x:y:view:'. |
|
1662 |
delegateQuery := #'handlesButtonMultiPress:inView:'. |
|
4856 | 1663 |
] ifFalse:[ (type == #mouseWheelMotion:x:y:amount:deltaTime:) ifTrue:[ |
7739 | 1664 |
isMouseWheelEvent := true. |
1665 |
deviceMessage := type. |
|
1666 |
delegateMessage := #mouseWheelMotion:x:y:amount:deltaTime:view:. |
|
1667 |
delegateQuery := #handlesMouseWheelMotion:inView:. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1668 |
] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[ |
7739 | 1669 |
isPointerEvent := true. |
1670 |
deviceMessage := #'devicePointerEnter:x:y:'. |
|
1671 |
delegateMessage := #'pointerEnter:x:y:view:'. |
|
1672 |
delegateQuery := #'handlesPointerEnter:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1673 |
] ifFalse:[ (type == #'pointerLeave:') ifTrue:[ |
7739 | 1674 |
isPointerEvent := true. |
1675 |
deviceMessage := type. |
|
1676 |
delegateMessage := #'pointerLeave:view:'. |
|
1677 |
delegateQuery := #'handlesPointerLeave:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1678 |
] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[ |
7739 | 1679 |
isExposeEvent := true. |
1680 |
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
|
1681 |
] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[ |
7739 | 1682 |
isExposeEvent := true. |
1683 |
deviceMessage := #'deviceGraphicsExposeX:y:width:height:final:'. |
|
4856 | 1684 |
]]]]]]]]]]]]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1685 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1686 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1687 |
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
|
1688 |
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
|
1689 |
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
|
1690 |
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
|
1691 |
" |
5208 | 1692 |
((isKeyEvent "or:[isMouseWheelEvent]") |
1693 |
and:[focusView notNil and:[self ~~ focusView]]) ifTrue:[ |
|
7739 | 1694 |
delegatedEvent := ev shallowCopy. |
1695 |
delegatedEvent delegatedFrom:ev. |
|
1696 |
delegatedEvent arguments:(ev arguments shallowCopy). |
|
1697 |
delegatedEvent x:-1; y:-1. |
|
1698 |
||
1699 |
focusView |
|
1700 |
dispatchEvent:delegatedEvent |
|
8081 | 1701 |
type:delegatedEvent type |
1702 |
arguments:(delegatedEvent arguments) |
|
7739 | 1703 |
withFocusOn:nil |
1704 |
delegate:doDelegate. |
|
1705 |
^ self |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1706 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1707 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1708 |
doDelegate ifTrue:[ |
7739 | 1709 |
" |
1710 |
handle delegated messages |
|
1711 |
" |
|
1712 |
(isKeyEvent |
|
1713 |
or:[isButtonEvent |
|
1714 |
or:[isMouseWheelEvent |
|
1715 |
or:[isPointerEvent]]]) ifTrue:[ |
|
1716 |
delegate := self delegate. |
|
1717 |
||
1718 |
" |
|
1719 |
what a kludge - sending to delegate requires |
|
1720 |
another selector and an additional argument ... |
|
1721 |
" |
|
1722 |
(delegate notNil) ifTrue:[ |
|
1723 |
" |
|
1724 |
is the delegate interested in that event ? |
|
1725 |
(if it does not respond to the handlesXXX message, assume: NO) |
|
1726 |
" |
|
1727 |
(delegate askFor:delegateQuery with:(argArray at:1) with:self) ifTrue:[ |
|
1728 |
" |
|
1729 |
mhmh ... have to convert to logical coordinates |
|
1730 |
" |
|
1731 |
|currentTransformation| |
|
1732 |
||
1733 |
currentTransformation := gc transformation. |
|
1734 |
currentTransformation notNil ifTrue:[ |
|
1735 |
argArray size > 2 ifTrue:[ |
|
1736 |
argArray at:2 put:(currentTransformation applyInverseToX:(argArray at:2)). |
|
1737 |
argArray at:3 put:(currentTransformation applyInverseToY:(argArray at:3)). |
|
1738 |
]. |
|
1739 |
]. |
|
1740 |
argArray isNil ifTrue:[ |
|
1741 |
delegate perform:delegateMessage with:self |
|
1742 |
] ifFalse:[ |
|
1743 |
delegate perform:delegateMessage withArguments:(argArray copyWith:self) |
|
1744 |
]. |
|
1745 |
^ self |
|
1746 |
] |
|
1747 |
]. |
|
1748 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1749 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1750 |
|
2708 | 1751 |
" |
1752 |
if I am not shown, ignore input events |
|
1753 |
" |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1754 |
(isKeyEvent |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1755 |
or:[isButtonEvent |
5208 | 1756 |
or:[isMouseWheelEvent |
1757 |
or:[isPointerEvent]]]) ifTrue:[ |
|
7739 | 1758 |
realized ifFalse:[ |
1759 |
^ self |
|
1760 |
] |
|
2126
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 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1763 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1764 |
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
|
1765 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1766 |
eventReceiver := self. |
8081 | 1767 |
((controller := self controller) notNil and:[controller ~~ eventReceiver]) ifTrue:[ |
7739 | 1768 |
(isKeyEvent |
1769 |
or:[isButtonEvent |
|
1770 |
or:[isMouseWheelEvent |
|
1771 |
or:[isPointerEvent |
|
1772 |
or:[(type == #focusIn) |
|
1773 |
or:[(type == #focusOut)]]]]]) ifTrue:[ |
|
1774 |
eventReceiver := controller. |
|
1775 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1776 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1777 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1778 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1779 |
finally, another one: |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1780 |
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
|
1781 |
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
|
1782 |
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
|
1783 |
in DisplaySurface translates and resends). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1784 |
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
|
1785 |
(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
|
1786 |
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
|
1787 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1788 |
selector := type. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1789 |
|
7739 | 1790 |
(isKeyEvent |
1791 |
or:[isButtonEvent |
|
1792 |
or:[isMouseWheelEvent |
|
1793 |
or:[isPointerEvent |
|
1794 |
or:[isExposeEvent]]]]) ifTrue:[ |
|
1795 |
gc transformation notNil ifTrue:[ |
|
1796 |
selector := deviceMessage |
|
1797 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1798 |
]. |
8487 | 1799 |
|
1800 |
"sr: #ev is nil when called via #dispatchEvent:arguments: |
|
1801 |
I think we should pass the 'triggering' event at least" |
|
1802 |
eventForLastEventQuery := ev. |
|
1803 |
eventForLastEventQuery isNil ifTrue:[ |
|
1804 |
eventForLastEventQuery := WindowGroup lastEvent. |
|
1805 |
]. |
|
1806 |
||
1807 |
WindowGroup lastEventQuerySignal |
|
1808 |
answer:eventForLastEventQuery |
|
1809 |
do:[ |
|
1810 |
eventReceiver perform:selector withArguments:argArray |
|
1811 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1812 |
|
8081 | 1813 |
"Created: / 20-05-1998 / 22:46:25 / cg" |
1814 |
"Modified: / 17-08-2017 / 09:47:01 / cg" |
|
8477 | 1815 |
"Modified: / 21-09-2018 / 11:39:47 / Claus Gittinger" |
8487 | 1816 |
"Modified: / 01-10-2018 / 14:17:18 / sr" |
2962 | 1817 |
! |
1818 |
||
1819 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
1820 |
"dispatch the event" |
|
1821 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1822 |
^ self |
8259 | 1823 |
dispatchEvent:event |
1824 |
withFocusOn:focusViewOrNil |
|
1825 |
delegate:true |
|
3094 | 1826 |
|
1827 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
|
1828 |
! |
|
1829 |
||
1830 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
1831 |
"dispatch the event" |
|
1832 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1833 |
^ self |
8259 | 1834 |
dispatchEvent:event |
1835 |
type:event type |
|
1836 |
arguments:(event arguments) |
|
1837 |
withFocusOn:focusViewOrNil |
|
1838 |
delegate:doDelegate |
|
2962 | 1839 |
|
1840 |
"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
|
1841 |
! ! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1842 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1843 |
!DisplaySurface methodsFor:'event handling'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1844 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1845 |
activateMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1846 |
"if there is a menu, show it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1847 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1848 |
|menu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1849 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1850 |
(menu := self middleButtonMenu) notNil ifTrue:[ |
8654 | 1851 |
self activateMenu:menu |
1852 |
] |
|
1853 |
||
1854 |
"Created: / 01-03-1996 / 13:24:55 / cg" |
|
1855 |
"Modified: / 15-03-2017 / 10:41:26 / cg" |
|
1856 |
"Modified: / 02-03-2019 / 11:40:45 / Claus Gittinger" |
|
1857 |
! |
|
1858 |
||
1859 |
activateMenu:aMenu |
|
1860 |
"if aMenu is a menu, show it." |
|
1861 |
||
1862 |
|menu| |
|
1863 |
||
1864 |
(menu := aMenu) notNil ifTrue:[ |
|
8349 | 1865 |
menu isBlock ifTrue:[ menu := menu value ]. |
7977 | 1866 |
menu isArray ifTrue:[ |
1867 |
"/ a spec array |
|
1868 |
menu := menu decodeAsLiteralArray. |
|
8349 | 1869 |
menu findGuiResourcesIn:(self application ? self) for:self. |
7977 | 1870 |
menu receiver:self. |
1871 |
]. |
|
1872 |
menu showAtPointer |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1873 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1874 |
|
8654 | 1875 |
"Created: / 02-03-2019 / 11:40:29 / Claus Gittinger" |
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 |
buttonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1879 |
"mouse was moved while button is pressed - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1880 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1881 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1882 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1883 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1884 |
buttonMultiPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1885 |
"button was pressed fast after previous press - default to press-again" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1886 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1887 |
^ self buttonPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1888 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1889 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1890 |
buttonPress:button x:x y:y |
7879 | 1891 |
"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
|
1892 |
|
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1893 |
(button == 2) ifTrue:[ |
7879 | 1894 |
UserPreferences current showRightButtonMenuOnRelease ifFalse:[ |
1895 |
self activateMenu. |
|
1896 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1897 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1898 |
|
7879 | 1899 |
"Modified: / 01-03-1996 / 13:25:07 / cg" |
1900 |
"Modified (comment): / 13-02-2017 / 20:01:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1901 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1902 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1903 |
buttonRelease:button x:x y:y |
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1904 |
(button == 2) ifTrue:[ |
8259 | 1905 |
UserPreferences current showRightButtonMenuOnRelease ifTrue:[ |
1906 |
self activateMenu. |
|
1907 |
]. |
|
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1908 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1909 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1910 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1911 |
catchExpose |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1912 |
"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
|
1913 |
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
|
1914 |
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
|
1915 |
suspend until the expose/noExpose event arrives. |
8041 | 1916 |
This is an X speciality - for devices that do not need this kind of |
1332 | 1917 |
asynchronous bit-blt confirmation, this is a noop. |
8041 | 1918 |
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
|
1919 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1920 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1921 |
|wg| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1922 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1923 |
device scrollsAsynchronous ifFalse:[ |
7466 | 1924 |
self setGotExposeFlag. |
1925 |
^ false |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1926 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1927 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1928 |
self setGraphicsExposures:true. |
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1929 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
1930 |
self clearGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1931 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1932 |
wg notNil ifTrue:[ |
7466 | 1933 |
" |
8041 | 1934 |
must process any pending expose events, since |
7466 | 1935 |
usually the origin is changed soon so that previous |
1936 |
expose events coordinates are invalid |
|
1937 |
" |
|
1938 |
wg processRealExposeEventsFor:self. |
|
1939 |
wg sensor catchExposeFor:self. |
|
1940 |
^ true |
|
1941 |
]. |
|
1942 |
^ false. |
|
1245
4a4e15a3e4fd
pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents:
1236
diff
changeset
|
1943 |
|
8041 | 1944 |
"Modified: / 06-08-1997 / 19:50:15 / cg" |
1945 |
"Modified (comment): / 30-05-2017 / 18:58:45 / mawalch" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1946 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
|
3595
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1948 |
coveredBy:aView |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1949 |
"the receiver has been covered by another view; |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1950 |
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
|
1951 |
! |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1952 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1953 |
deviceButtonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1954 |
"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
|
1955 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1956 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1957 |
and send a #buttonMotion with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1958 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1959 |
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
|
1960 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1961 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1962 |
should redefine #buttonMotion:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1963 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1964 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1967 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1968 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1969 |
currentTransformation notNil ifTrue:[ |
8259 | 1970 |
lx notNil ifTrue:[ |
1971 |
lx := currentTransformation applyInverseToX:lx. |
|
1972 |
ly := currentTransformation applyInverseToY:ly. |
|
1973 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1974 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1975 |
self buttonMotion:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1976 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1977 |
"Modified: 20.5.1996 / 17:45:25 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1978 |
"Modified: 14.10.1996 / 22:25:12 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1979 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1980 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1981 |
deviceButtonMultiPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1982 |
"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
|
1983 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1984 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1985 |
and send a buttonMultiPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1986 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1987 |
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
|
1988 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1989 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1990 |
should redefine #buttonMultiPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1991 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1992 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1996 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1997 |
currentTransformation notNil ifTrue:[ |
8259 | 1998 |
lx notNil ifTrue:[ |
1999 |
lx := currentTransformation applyInverseToX:lx. |
|
2000 |
ly := currentTransformation applyInverseToY:ly. |
|
2001 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2002 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
self buttonMultiPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2004 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2005 |
"Modified: 20.5.1996 / 17:45:22 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2006 |
"Modified: 14.10.1996 / 22:25:22 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2007 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2008 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2009 |
deviceButtonPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2010 |
"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
|
2011 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2012 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2013 |
and send a buttonPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2014 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2015 |
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
|
2016 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2017 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2018 |
should redefine #buttonPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2019 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2020 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2023 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2024 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2025 |
currentTransformation notNil ifTrue:[ |
8259 | 2026 |
lx notNil ifTrue:[ |
2027 |
lx := currentTransformation applyInverseToX:lx. |
|
2028 |
ly := currentTransformation applyInverseToY:ly. |
|
2029 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2030 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2031 |
self buttonPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2032 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2033 |
"Modified: 20.5.1996 / 17:45:18 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2034 |
"Modified: 14.10.1996 / 22:25:30 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2035 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2036 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2037 |
deviceButtonRelease:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2038 |
"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
|
2039 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2040 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2041 |
and send a buttonRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2042 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2043 |
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
|
2044 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2045 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2046 |
should redefine #buttonRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2047 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2048 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2051 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2052 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2053 |
currentTransformation notNil ifTrue:[ |
8259 | 2054 |
lx notNil ifTrue:[ |
2055 |
lx := currentTransformation applyInverseToX:lx. |
|
2056 |
ly := currentTransformation applyInverseToY:ly. |
|
2057 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2058 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
self buttonRelease:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2061 |
"Modified: 20.5.1996 / 17:45:14 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2062 |
"Modified: 14.10.1996 / 22:25:37 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2063 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2064 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2065 |
deviceButtonShiftPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2066 |
"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
|
2067 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2068 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
and send a buttonShiftPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2070 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2071 |
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
|
2072 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2073 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
should redefine #buttonShiftPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2075 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2076 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2077 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2078 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2079 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2080 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2081 |
currentTransformation notNil ifTrue:[ |
8259 | 2082 |
lx notNil ifTrue:[ |
2083 |
lx := currentTransformation applyInverseToX:lx. |
|
2084 |
ly := currentTransformation applyInverseToY:ly. |
|
2085 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2086 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2087 |
self buttonShiftPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2088 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2089 |
"Modified: 20.5.1996 / 17:45:09 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2090 |
"Modified: 14.10.1996 / 22:25:49 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2091 |
! |
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 |
deviceExposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2094 |
"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
|
2095 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2096 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2097 |
and send an expose with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2098 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2099 |
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
|
2100 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2101 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2102 |
should redefine #exposeX:x:y:width:height:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2103 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2104 |
|lx ly lw lh currentTransformation| |
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2107 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2108 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2109 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2110 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2111 |
currentTransformation notNil ifTrue:[ |
8259 | 2112 |
lx := currentTransformation applyInverseToX:lx. |
2113 |
ly := currentTransformation applyInverseToY:ly. |
|
2114 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2115 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2116 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2117 |
self exposeX:lx y:ly width:lw height:lh |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2118 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2119 |
"Modified: 13.5.1996 / 11:31:44 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2120 |
"Modified: 14.10.1996 / 22:26:00 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2121 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2123 |
deviceGraphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
"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
|
2125 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2126 |
If there is a transformation, apply the inverse |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2127 |
and send a graphicsExpose with the logical coordinates. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2128 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2129 |
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
|
2130 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2131 |
those which are interested in logical coordinates |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2132 |
should redefine #graphicsExposeX:x:y:width:height:" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2134 |
|lx ly lw lh currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2135 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2136 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2137 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2138 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2140 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2141 |
currentTransformation notNil ifTrue:[ |
8259 | 2142 |
lx := currentTransformation applyInverseToX:lx. |
2143 |
ly := currentTransformation applyInverseToY:ly. |
|
2144 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2145 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2146 |
]. |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2147 |
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
|
2148 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2149 |
"Modified: 13.5.1996 / 11:31:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2150 |
"Modified: 14.10.1996 / 22:26:08 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2151 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2152 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2153 |
deviceKeyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2154 |
"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
|
2155 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2156 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2157 |
and send a keyPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2158 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2159 |
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
|
2160 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2161 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
should redefine #keyPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2163 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2164 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2167 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2168 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2169 |
currentTransformation notNil ifTrue:[ |
8259 | 2170 |
lx notNil ifTrue:[ |
2171 |
lx := currentTransformation applyInverseToX:lx. |
|
2172 |
ly := currentTransformation applyInverseToY:ly. |
|
2173 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
self keyPress:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2176 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2177 |
"Modified: 20.5.1996 / 17:44:59 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2178 |
"Modified: 14.10.1996 / 22:26:17 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2179 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2180 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2181 |
deviceKeyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
"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
|
2183 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2184 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2185 |
and send a keyRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2186 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2187 |
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
|
2188 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2189 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
should redefine #keyRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2191 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2192 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2195 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2196 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2197 |
currentTransformation notNil ifTrue:[ |
8259 | 2198 |
lx notNil ifTrue:[ |
2199 |
lx := currentTransformation applyInverseToX:lx. |
|
2200 |
ly := currentTransformation applyInverseToY:ly. |
|
2201 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2202 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
self keyRelease:key x:lx y:ly |
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 |
"Modified: 20.5.1996 / 17:44:42 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2206 |
"Modified: 14.10.1996 / 22:26:28 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2209 |
devicePointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
"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
|
2211 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
and send a pointerEnter with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2214 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2215 |
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
|
2216 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2217 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2218 |
should redefine #pointerEnter:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2219 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2220 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2221 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2223 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2224 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2225 |
currentTransformation notNil ifTrue:[ |
8259 | 2226 |
lx notNil ifTrue:[ |
2227 |
lx := currentTransformation applyInverseToX:lx. |
|
2228 |
ly := currentTransformation applyInverseToY:ly. |
|
2229 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2230 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
self pointerEnter:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2232 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
"Modified: 20.5.1996 / 17:44:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2234 |
"Modified: 14.10.1996 / 22:26:35 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2235 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2236 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2237 |
exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
"an expose event - nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2242 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
focusIn |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
"got keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2247 |
! |
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 |
focusOut |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
"lost keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2251 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2252 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2253 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2254 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2255 |
graphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2256 |
"an expose event after a scroll - do normal redraw processing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2257 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2258 |
self exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2259 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2260 |
|
5961 | 2261 |
hotkeyWithId:aId rawKey:aKey |
2262 |
"default action is to do nothing - may be reimplemented " |
|
2263 |
^ self |
|
2264 |
! |
|
2265 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
keyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2267 |
"a key was pressed in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2268 |
Here only keyCommands are handled - more action has to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2269 |
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
|
2270 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2271 |
|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
|
2272 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2273 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2274 |
action := keyCommands at:key ifAbsent:[nil]. |
2275 |
action value |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2276 |
]. |
3514 | 2277 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2278 |
key isSymbol ifTrue:[ |
8259 | 2279 |
(key startsWith:'Basic') ifTrue:[ |
2280 |
"/ an unhandled BasicFoo key; |
|
2281 |
"/ retry as Foo |
|
2282 |
rest := key withoutPrefix:'Basic'. |
|
2283 |
restKey := rest asSymbolIfInterned. |
|
2284 |
restKey notNil ifTrue:[ |
|
2285 |
self keyPress:restKey x:x y:y |
|
2286 |
] |
|
2287 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2288 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2289 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2290 |
"Modified: 6.11.1996 / 17:51:15 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2291 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
keyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2294 |
"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
|
2295 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2296 |
key isSymbol ifTrue:[ |
8259 | 2297 |
(key startsWith:#Basic) ifTrue:[ |
2298 |
"/ an unhandled BasicFoo key; |
|
2299 |
"/ retry as Foo |
|
2300 |
||
2301 |
self keyRelease:(key copyFrom:#Basic size) asSymbol x:x y:y |
|
2302 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2303 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2304 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2305 |
^ self |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2306 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2307 |
"Modified: 6.11.1996 / 17:51:20 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2308 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2309 |
|
6828 | 2310 |
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime |
2311 |
"ignored" |
|
2312 |
||
2313 |
^ self |
|
2314 |
! |
|
2315 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
noExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2317 |
"a no expose event after a scroll (event-mode only)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2318 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
2319 |
self setGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2320 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2321 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2322 |
pointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2323 |
"mouse cursor entered view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2324 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2325 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2326 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2327 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2328 |
pointerLeave:state |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2329 |
"mouse cursor left view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2330 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2331 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2332 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2333 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2334 |
resizeRequest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2335 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2336 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2337 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2338 |
waitForExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2339 |
"wait until an expose event arrives (to wait for scroll-finish)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2340 |
|
2421 | 2341 |
|wg endPollTime pollDelay| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2342 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2343 |
device scrollsAsynchronous ifFalse:[ |
6372 | 2344 |
self setGotExposeFlag. |
2345 |
^ self |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2346 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2347 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2348 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2349 |
wg notNil ifTrue:[ |
6372 | 2350 |
"/ |
2351 |
"/ a normal (suspendable) view. |
|
2352 |
"/ wait by doing a real wait |
|
2353 |
"/ |
|
2354 |
wg sensor waitForExposeFor:self |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2355 |
] ifFalse:[ |
6372 | 2356 |
"/ |
2357 |
"/ a pure event driven view. |
|
2358 |
"/ wait by doing a direct dispatch loop until the event arrives. |
|
2359 |
"/ i.e. poll for the event |
|
2360 |
"/ |
|
2361 |
device isWindowsPlatform ifTrue:[ |
|
7744 | 2362 |
pollDelay := 0.5. |
6372 | 2363 |
] ifFalse:[ |
7744 | 2364 |
pollDelay := 1. |
6372 | 2365 |
]. |
2366 |
endPollTime := Timestamp now addSeconds:pollDelay. |
|
2367 |
||
2368 |
[self gotExpose] whileFalse:[ |
|
2369 |
realized ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2370 |
(device exposeEventPendingFor:gc drawableId withSync:true) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2371 |
device dispatchExposeEventFor:gc drawableId. |
6372 | 2372 |
]. |
2373 |
]. |
|
2374 |
realized ifFalse:[ |
|
2375 |
self setGotExposeFlag. |
|
2376 |
^ self |
|
2377 |
]. |
|
2378 |
||
2379 |
"/ break out of the poll after a while |
|
2380 |
||
2381 |
Timestamp now > endPollTime ifTrue:[ |
|
2382 |
'DisplaySurface [warning]: lost expose event' errorPrintCR. |
|
2383 |
self setGotExposeFlag. |
|
2384 |
^ self |
|
2385 |
]. |
|
2386 |
Processor yield. |
|
2387 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2388 |
] |
1129
2a3eaf218500
destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
2389 |
|
2421 | 2390 |
"Modified: / 9.1.1999 / 01:58:09 / cg" |
727
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 |
|
3884 | 2393 |
!DisplaySurface methodsFor:'initialization & release'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2394 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2395 |
destroy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2396 |
"view is about to be destroyed - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2397 |
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
|
2398 |
then the view is physically destroyed." |
4291 | 2399 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2400 |
self |
7448 | 2401 |
middleButtonMenu:nil; |
2402 |
keyCommands:nil. |
|
7449 | 2403 |
device notNil ifTrue:[ |
2404 |
device removeKnownView:self withId:nil. |
|
2405 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2406 |
super destroy. |
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2407 |
! |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2408 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2409 |
destroyed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2410 |
"view has been destroyed by someone else" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2411 |
|
4435 | 2412 |
|id| |
2413 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2414 |
(id := self drawableId) notNil ifTrue:[ |
7444 | 2415 |
gc setId:nil. |
2416 |
self graphicsDevice removeKnownView:self withId:id. |
|
2417 |
realized := false. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2418 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2419 |
self destroy |
1481 | 2420 |
|
2421 |
"Modified: 22.3.1997 / 14:56:34 / cg" |
|
727
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 |
initCursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2425 |
"default cursor for all views" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2426 |
|
2453 | 2427 |
cursor := Cursor normal |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2428 |
! |
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 |
initStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2431 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2432 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2433 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2434 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2435 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2436 |
initialize |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2437 |
"initialize defaults" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2438 |
|
7844 | 2439 |
<modifier: #super> "must be called if redefined" |
2440 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2441 |
super initialize. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2442 |
|
4137 | 2443 |
eventMask := 0. |
2995 | 2444 |
device notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2445 |
eventMask := device defaultEventMask. |
2995 | 2446 |
]. |
7616 | 2447 |
gc notNil ifTrue:[ viewBackground := gc background]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2448 |
backed := false. |
3152 | 2449 |
flags := 0. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2450 |
self initCursor |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2451 |
|
7844 | 2452 |
"Modified: / 08-02-2017 / 00:26:56 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2453 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2454 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2455 |
prepareForReinit |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2456 |
gc notNil ifTrue:[ |
8259 | 2457 |
gc prepareForReinit. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2458 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2459 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2460 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2461 |
reAdjustGeometry |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2462 |
"sent late during snapin processing, nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2463 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2464 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2465 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2466 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2467 |
recreate |
3300 | 2468 |
"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
|
2469 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2470 |
viewBackground isColor ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2471 |
viewBackground := viewBackground onDevice:device. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2472 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2473 |
super recreate. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2474 |
cursor notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2475 |
cursor := cursor onDevice:device. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2476 |
]. |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2477 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
2478 |
"Modified: 28.3.1997 / 13:48:06 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2479 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2480 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2481 |
reinitStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2482 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2483 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2484 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2485 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2486 |
|
3291 | 2487 |
releaseDeviceResources |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2488 |
super destroy. |
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 |
!DisplaySurface methodsFor:'keyboard commands'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2492 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2493 |
addActionForKey:aKey action:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2494 |
"define a keyboard command function" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2495 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2496 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2497 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2498 |
(keyCommands := self keyCommands) isNil ifTrue:[ |
8259 | 2499 |
self keyCommands:(keyCommands := IdentityDictionary new). |
727
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 |
keyCommands at:aKey put:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2502 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2503 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2504 |
keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2505 |
^ self getAttribute:#keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2506 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2507 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2508 |
keyCommands:aDictionaryOrNil |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2509 |
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
|
2510 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2511 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2512 |
removeActionForKey:aKey |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2513 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2514 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2515 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2516 |
keyCommands removeKey:aKey ifAbsent:nil |
727
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 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2519 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2520 |
!DisplaySurface methodsFor:'queries'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2521 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2522 |
buttonMotionEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2523 |
"return true, if a button motion event is pending. |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2524 |
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
|
2525 |
(not even for mouse-tracking). |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2526 |
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
|
2527 |
but goes directly to the device instead. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2528 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2529 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2531 |
^ device eventPending:#buttonMotion for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2533 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2534 |
buttonReleaseEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2535 |
"return true, if a button release event is pending. |
7655 | 2536 |
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
|
2537 |
goes directly to the device instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
Actually, its a historical leftover" |
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 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2541 |
^ device eventPending:#buttonRelease for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2542 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
exposeEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2545 |
"return true, if an expose event is pending." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2546 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2547 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2548 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2549 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2550 |
windowGroup notNil ifTrue:[ |
8259 | 2551 |
(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
|
2552 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2553 |
^ device eventPending:#expose for:gc drawableId |
2352 | 2554 |
|
2555 |
"Modified: / 15.9.1998 / 23:18:16 / cg" |
|
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2558 |
redrawsFull |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2559 |
^ false |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2560 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2561 |
"Created: 4.3.1996 / 14:17:22 / cg" |
3674 | 2562 |
! |
2563 |
||
2564 |
shown |
|
2565 |
"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
|
2566 |
(I am mapped and not completely covered). |
3674 | 2567 |
Assumed that I am always visible when realized." |
2568 |
||
2569 |
^ realized |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2570 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2571 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2572 |
!DisplaySurface methodsFor:'queries-contents'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2573 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2574 |
heightOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2575 |
"return the height of the contents in pixels. |
7691 | 2576 |
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
|
2577 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2578 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2579 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2580 |
^ self height |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2581 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2582 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2583 |
widthOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2584 |
"return the width of the contents in pixels. |
7691 | 2585 |
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
|
2586 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2587 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2588 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2589 |
^ self width |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2590 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2591 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2592 |
xOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2593 |
"return the x-origin of the contents in pixels. |
7655 | 2594 |
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
|
2595 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2596 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2597 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2598 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2599 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2600 |
yOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2601 |
"return the y-origin of the contents in pixels. |
7655 | 2602 |
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
|
2603 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2604 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2605 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2606 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2607 |
|
7734 | 2608 |
!DisplaySurface methodsFor:'testing'! |
2609 |
||
2610 |
isDebugView |
|
2611 |
^ false |
|
2612 |
! |
|
2613 |
||
2614 |
isPopUpView |
|
2615 |
"return true, if this view should be put on top (raised) automatically. |
|
2616 |
usually this is true for alertBoxes etc." |
|
2617 |
||
2618 |
^ false |
|
2619 |
||
2620 |
"Created: / 22.1.1998 / 15:01:32 / stefan" |
|
2621 |
! |
|
2622 |
||
2623 |
isRootView |
|
2624 |
"return true, if the receiver is a root view |
|
2625 |
false is returned here, this is only redefined in DisplayRootView." |
|
2626 |
||
2627 |
^ false |
|
2628 |
||
2629 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2630 |
"Created: 5.7.1996 / 14:58:55 / cg" |
|
2631 |
! |
|
2632 |
||
2633 |
isTopView |
|
2634 |
"return true, if the receiver is some kind of topview; |
|
2635 |
false is returned here; redefined in some subclasses." |
|
2636 |
||
2637 |
^ false |
|
2638 |
||
2639 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2640 |
"Created: 22.3.1997 / 14:45:29 / cg" |
|
2641 |
! |
|
2642 |
||
2643 |
isView |
|
2644 |
"return true, if the receiver is some kind of view; |
|
2645 |
true is returned here." |
|
2646 |
||
2647 |
^ true |
|
2648 |
||
2649 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2650 |
! ! |
|
2651 |
||
3276 | 2652 |
!DisplaySurface methodsFor:'user interaction & notifications'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2653 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2654 |
beep |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2655 |
"output an audible beep or bell on my screen device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2656 |
|
8257 | 2657 |
device beep |
2658 |
||
2659 |
"Created: 28.5.1996 / 16:16:13 / cg" |
|
2660 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
|
2661 |
! |
|
2662 |
||
2663 |
beepInEditor |
|
8259 | 2664 |
"output an audible beep or bell on my screen device, if enabled. |
2665 |
||
2666 |
Beep to wakeup the user after some error/not found condition in an editor. |
|
2667 |
Use this ONLY to beep in response to a bad user operation (not system failure beeps). |
|
2668 |
Can be disabled via the settings if too annoying" |
|
8257 | 2669 |
|
2670 |
device beepInEditor |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2671 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2672 |
"Created: 28.5.1996 / 16:16:13 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2673 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2674 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2675 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2676 |
showActivity:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2677 |
"this is sent indirectly by the activityNotification mechanism. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2678 |
Defined here as a fallback, if ever sent to non topviews." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2679 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2680 |
Transcript showCR:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2681 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2682 |
"Modified: 18.5.1996 / 15:44:33 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2683 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2684 |
|
1093 | 2685 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2686 |
|
6710 | 2687 |
version |
6937 | 2688 |
^ '$Header$' |
6710 | 2689 |
! |
2690 |
||
5458 | 2691 |
version_CVS |
6937 | 2692 |
^ '$Header$' |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2693 |
! ! |
3791 | 2694 |
|
6063 | 2695 |
|
3211 | 2696 |
DisplaySurface initialize! |