author | Stefan Vogel <sv@exept.de> |
Tue, 28 Apr 2020 15:28:14 +0200 | |
changeset 9038 | dd177fea6408 |
parent 9010 | 652d7158a60e |
permissions | -rw-r--r-- |
8964 | 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 |
|
9010 | 219 |
monitorScaleFactor |
220 |
"answer the os scale factor for the current monitor of his view, |
|
221 |
regardless if the app is high dpi aware or not. |
|
222 |
||
223 |
this is the scale factor the user did enter in the os settings, |
|
224 |
for e.g. the user can choose between 100, 125, 150 etc. |
|
225 |
here we return 1, 1.25 1.5" |
|
226 |
||
227 |
^ device monitorScaleFactorForView:self |
|
228 |
! |
|
229 |
||
5541 | 230 |
renderer |
231 |
"warning: this is experimental and not yet implemented" |
|
232 |
^ renderer |
|
233 |
! |
|
234 |
||
235 |
renderer:something |
|
236 |
"warning: this is experimental and not yet implemented" |
|
237 |
renderer := something. |
|
238 |
! |
|
239 |
||
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
240 |
sensor |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
241 |
"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
|
242 |
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
|
243 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
244 |
^ SynchronousWindowSensor new |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
245 |
! |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
246 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
setViewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
"install the viewBackground for the receiver on the device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
250 |
|id devBgPixmap bgPixmap w h colorMap |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
251 |
pixmapDepth deviceDepth defBG| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
253 |
self drawableId notNil ifTrue:[ |
7631 | 254 |
viewBackground isColor ifTrue:[ |
255 |
viewBackground := viewBackground onDevice:self graphicsDevice. |
|
256 |
id := viewBackground colorId. |
|
257 |
" |
|
258 |
a real color (i.e. one supported by the device) ? |
|
259 |
" |
|
260 |
id notNil ifTrue:[ |
|
261 |
self graphicsDevice setWindowBackground:id in:self drawableId. |
|
262 |
^ self |
|
263 |
]. |
|
264 |
" |
|
265 |
no, a dithered one - must have a dither-pattern |
|
266 |
(which is ready for the device, since viewBackground |
|
267 |
is already assigned to the device) |
|
268 |
" |
|
269 |
bgPixmap := viewBackground ditherForm. |
|
270 |
] ifFalse:[ |
|
271 |
viewBackground notNil ifTrue:[ |
|
272 |
viewBackground isViewBackground ifTrue:[ |
|
273 |
^ self. |
|
274 |
]. |
|
275 |
||
276 |
" |
|
277 |
assume, it can convert itself to a form |
|
278 |
" |
|
279 |
bgPixmap := viewBackground asFormOn:self graphicsDevice. |
|
280 |
bgPixmap isNil ifTrue:[ |
|
281 |
"/ assume it knows how to draw itself |
|
282 |
^ self |
|
283 |
]. |
|
284 |
]. |
|
285 |
]. |
|
286 |
||
287 |
" |
|
288 |
must now have: |
|
289 |
a dithered color or bitmap or pixmap |
|
290 |
" |
|
291 |
bgPixmap isNil ifTrue:[ |
|
292 |
'DisplaySurface [warning]: background not convertable - ignored' errorPrintCR. |
|
293 |
^ self |
|
294 |
]. |
|
295 |
||
296 |
"/ if the device does not support background pixmaps, |
|
297 |
"/ set the backgroundColor to the default background. |
|
298 |
"/ this will avoid flicker in win32 systems, |
|
299 |
"/ since that background is drawn directly in the |
|
300 |
"/ devices expose event handling. |
|
301 |
"/ (in contrast, the pixmap filling is done by the |
|
302 |
"/ window itself in its expose event handler) |
|
303 |
||
304 |
(self graphicsDevice supportsViewBackgroundPixmap:bgPixmap) ifFalse:[ |
|
305 |
defBG := View defaultViewBackgroundColor. |
|
306 |
defBG isColor ifTrue:[ |
|
307 |
defBG := defBG onDevice:self graphicsDevice. |
|
308 |
id := defBG colorId. |
|
309 |
id notNil ifTrue:[ |
|
310 |
self graphicsDevice setWindowBackground:id in:self drawableId. |
|
311 |
]. |
|
312 |
]. |
|
313 |
^ self |
|
314 |
]. |
|
315 |
||
316 |
w := bgPixmap width. |
|
317 |
h := bgPixmap height. |
|
318 |
||
319 |
deviceDepth := self depth. |
|
320 |
pixmapDepth := bgPixmap depth. |
|
321 |
||
322 |
(pixmapDepth ~~ deviceDepth) ifTrue:[ |
|
323 |
(pixmapDepth ~~ 1) ifTrue:[ |
|
324 |
'DisplaySurface [warning]: Bad dither depth (must be one or devices depth)' errorPrintCR. |
|
325 |
^ self |
|
326 |
]. |
|
327 |
||
328 |
" |
|
329 |
convert it into a deep form |
|
330 |
" |
|
331 |
colorMap := bgPixmap colorMap. |
|
332 |
devBgPixmap := Form width:w height:h depth:deviceDepth onDevice:self graphicsDevice. |
|
333 |
devBgPixmap isNil ifTrue:[ |
|
334 |
'DisplaySurface [warning]: could not create a device form for viewBackground' infoPrintCR. |
|
335 |
^ self |
|
336 |
]. |
|
337 |
devBgPixmap paint:(colorMap at:1). |
|
338 |
devBgPixmap fillRectangleX:0 y:0 width:w height:h. |
|
339 |
devBgPixmap foreground:(colorMap at:2) background:(colorMap at:1). |
|
340 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
341 |
bgPixmap := devBgPixmap. |
|
342 |
] ifFalse:[ |
|
343 |
(pixmapDepth == 1) ifTrue:[ |
|
344 |
" |
|
345 |
although depth matches, |
|
346 |
values in the dither are to be interpreted via the ditherForms |
|
347 |
colormap, which is not always the same as blackpixel/whitepixel ... |
|
348 |
" |
|
349 |
colorMap := bgPixmap colorMap. |
|
350 |
(colorMap at:1) colorId == self graphicsDevice whitepixel ifTrue:[ |
|
351 |
(colorMap at:2) colorId == self graphicsDevice blackpixel ifTrue:[ |
|
352 |
" |
|
353 |
ok, can use it |
|
354 |
" |
|
355 |
self graphicsDevice setWindowBackgroundPixmap:(bgPixmap drawableId) in:self drawableId. |
|
356 |
^ self |
|
357 |
] |
|
358 |
]. |
|
359 |
||
360 |
" |
|
361 |
no, must invert it |
|
362 |
" |
|
363 |
devBgPixmap := Form width:w height:h depth:deviceDepth onDevice:self graphicsDevice. |
|
364 |
devBgPixmap paint:(colorMap at:2) on:(colorMap at:1). |
|
365 |
devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h. |
|
366 |
bgPixmap := devBgPixmap. |
|
367 |
] |
|
368 |
]. |
|
369 |
self graphicsDevice setWindowBackgroundPixmap:(bgPixmap drawableId) in:self drawableId. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
370 |
] |
1134 | 371 |
|
5686 | 372 |
"Modified: / 23-01-2011 / 01:44:38 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
373 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
374 |
|
4041 | 375 |
updateRegion |
376 |
^ updateRegion |
|
377 |
! |
|
378 |
||
379 |
updateRegion:something |
|
380 |
updateRegion := something. |
|
381 |
! |
|
382 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
384 |
"return the viewBackground" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
^ viewBackground |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
388 |
|
7868 | 389 |
viewBackground:aColorOrFormOrViewBackground |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
391 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
color, which is used with opaque drawing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
|
7868 | 395 |
viewBackground ~~ aColorOrFormOrViewBackground ifTrue:[ |
396 |
self basicViewBackground:aColorOrFormOrViewBackground |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
] |
7868 | 398 |
|
399 |
"Modified (format): / 12-02-2017 / 12:57:01 / cg" |
|
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
viewBackgroundAndClear:something |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
"set the viewBackground to something, a color, image or form. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
and clear the View. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
405 |
The viewBackground is the color or pattern with which exposed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
406 |
regions are filled - do not confuse this with the drawing background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
407 |
color, which is used with opaque drawing." |
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 |
self viewBackground:something. |
4070 | 410 |
self clearView. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
412 |
"Created: 27.4.1996 / 14:09:08 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
413 |
! |
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 |
viewGravity |
7691 | 416 |
"return the view's gravity" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
^ #NorthWest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
420 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
421 |
viewOrigin |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
422 |
"0@0 here, since by default we cannot be scrolled" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
423 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
^ 0 @ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
425 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
426 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
427 |
widget |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
428 |
"ST-80 compatibility" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
429 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
430 |
^ self |
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
431 |
! |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
432 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
433 |
windowClass:classString name:nameString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
434 |
gc windowClass:classString name:nameString. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
435 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
436 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
437 |
windowGroup |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
438 |
"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
|
439 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
440 |
^ nil |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
441 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
442 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
443 |
windowName:aString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
444 |
gc windowName:aString. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
!DisplaySurface methodsFor:'accessing-cursor'! |
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 |
cursor |
7691 | 450 |
"return the view's cursor" |
727
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 |
^ cursor |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
cursor:aCursor |
7691 | 456 |
"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
|
457 |
the mouse-pointer enters the receiver. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
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
|
459 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
self cursor:aCursor now:true |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
463 |
|v| |
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 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
[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
|
469 |
[v shown] whileTrue:[ |
7691 | 470 |
(Delay forSeconds:1) wait. |
471 |
v cursor:(Cursor normal). |
|
472 |
(Delay forSeconds:1) wait. |
|
473 |
v cursor:(Cursor wait). |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
474 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
475 |
" |
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 |
"Modified: 14.12.1995 / 21:28:14 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
478 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
479 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
cursor:aCursor now:showImmediately |
7691 | 481 |
"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
|
482 |
the mouse-pointer enters the receiver. |
7691 | 483 |
Cursors are typically set at view creation time and left as installed. |
484 |
The showImmediately parameter controls if the request is to be buffered, |
|
485 |
or enforced immediately. Under XWindows, that makes a performance difference if many |
|
486 |
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
|
487 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
aCursor notNil ifTrue:[ |
7691 | 489 |
(aCursor ~~ cursor) ifTrue:[ |
490 |
cursor := aCursor. |
|
491 |
self drawableId notNil ifTrue:[ |
|
492 |
self setCursor. |
|
493 |
(showImmediately and:[realized]) ifTrue:[ |
|
494 |
"flush, to make cursor immediately visible" |
|
495 |
self flush |
|
496 |
] |
|
497 |
] |
|
498 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
500 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
|v| |
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 |
v := View new. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
v cursor:(Cursor wait). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
v open. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
[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
|
508 |
[v shown] whileTrue:[ |
7691 | 509 |
(Delay forSeconds:1) wait. |
510 |
v cursor:(Cursor normal). |
|
511 |
(Delay forSeconds:1) wait. |
|
512 |
v cursor:(Cursor wait). |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
514 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
"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
|
517 |
"Modified: 28.3.1997 / 13:47:58 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
|
1960 | 520 |
setCursor |
521 |
|id| |
|
522 |
||
6226 | 523 |
cursor isNil ifTrue:[ ^ self]. |
7268 | 524 |
cursor := cursor onDevice:device. |
6226 | 525 |
cursor isNil ifTrue:[ ^ self]. |
526 |
||
527 |
id := cursor id. |
|
528 |
id isNil ifTrue:[ |
|
8259 | 529 |
'DisplaySurface [warning]: nil cursorId ignored; shape=' errorPrint. |
530 |
cursor shape errorPrintCR. |
|
531 |
^ self. |
|
6226 | 532 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
533 |
gc setCursorId:id . |
1960 | 534 |
! |
535 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
withCursor:aCursor do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
"evaluate aBlock showing aCursor until ready; then restore the old cursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
and return the value as returned by aBlock. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
539 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
Notice, that this method only changes the cursor for a SINGLE (sub-)view. |
1337 | 541 |
Most applications want to have the cursor changed in all of its views. |
542 |
Use 'aView windowGroup withCursor:do:' or 'aView topView withCursor:do:' |
|
8254 | 543 |
to accomplish this." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
|savedCursor| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
546 |
|
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
547 |
cursor == aCursor ifTrue:[ |
7702 | 548 |
^ aBlock value |
1388
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
549 |
]. |
ba20e718d36f
withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents:
1342
diff
changeset
|
550 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
savedCursor := cursor. |
7702 | 552 |
^ [ |
553 |
self cursor:aCursor now:true. |
|
554 |
aBlock value |
|
555 |
] ensure:[ |
|
556 |
self cursor:savedCursor now:true |
|
557 |
] |
|
1337 | 558 |
|
8254 | 559 |
"Modified: / 27-02-1997 / 17:20:43 / cg" |
560 |
"Modified (comment): / 17-01-2018 / 15:18:35 / mawalch" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
561 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
withExecuteCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
"evaluate aBlock while showing an execute cursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
Return the value as returned by 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 |
^ self withCursor:(Cursor execute) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
"Created: 10.1.1996 / 13:53:03 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
571 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
572 |
withReadCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
573 |
"evaluate aBlock while showing a readCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
574 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
575 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
576 |
^ self withCursor:(Cursor read) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
577 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
578 |
"Modified: 14.12.1995 / 20:57:40 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
579 |
"Created: 10.1.1996 / 13:52:52 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
580 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
581 |
|
5565 | 582 |
withVisibleCursor:aCursor do:aBlock |
583 |
"evaluate aBlock, showing a aCursor. |
|
584 |
Return the value of aBlock. |
|
6815 | 585 |
Ensure, that the cursor is visible for the user for a minimal amount of time |
586 |
(even if the computation would be too quick for a cursor to be visible, |
|
587 |
show the execute cursor for some time as a feedback)." |
|
5565 | 588 |
|
589 |
|ret| |
|
590 |
||
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
591 |
cursor == aCursor ifTrue:[ |
8259 | 592 |
^ aBlock value |
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
593 |
]. |
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
594 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
595 |
self |
8259 | 596 |
withCursor:aCursor do:[ |
597 |
|timeToExecute remainingShowTime| |
|
598 |
||
599 |
timeToExecute := Time millisecondsToRun:[ ret := aBlock value]. |
|
600 |
remainingShowTime := UserPreferences current waitCursorVisibleTime - timeToExecute. |
|
601 |
remainingShowTime > 0 ifTrue:[ |
|
602 |
Delay waitForMilliseconds:remainingShowTime. |
|
603 |
]. |
|
604 |
]. |
|
5565 | 605 |
^ ret. |
5783
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
606 |
|
92696252bc47
changed: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
5773
diff
changeset
|
607 |
"Modified (comment): / 12-09-2011 / 12:14:29 / cg" |
5565 | 608 |
! |
609 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
610 |
withWaitCursorDo:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
611 |
"evaluate aBlock while showing a waitCursor in all my views. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
612 |
Return the value as returned by aBlock." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
613 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
614 |
^ self withCursor:(Cursor wait) do:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
615 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
"Created: 10.1.1996 / 13:51:08 / cg" |
5923 | 617 |
! |
618 |
||
619 |
withWriteCursorDo:aBlock |
|
620 |
"evaluate aBlock while showing a writeCursor in all my views. |
|
621 |
Return the value as returned by aBlock." |
|
622 |
||
623 |
^ self withCursor:(Cursor write) do:aBlock |
|
624 |
||
625 |
"Modified: / 14-12-1995 / 20:57:40 / cg" |
|
626 |
"Created: / 27-07-2012 / 09:43:08 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
627 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
628 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
629 |
!DisplaySurface methodsFor:'accessing-hierarchy'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
630 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
631 |
delegate |
6396 | 632 |
"return the delegate - that's the one getting keyboard and button events. |
633 |
See dispatchEvent:... method" |
|
727
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 |
^ delegate |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
636 |
! |
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 |
delegate:someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
639 |
"set the delegate - keyboard- and button events will be forwarded to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
640 |
that object if it is interested in them. |
6396 | 641 |
See the dispatchEvent... method." |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
delegate := someOne |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
! |
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 |
superView |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
647 |
"return the superView - nil here" |
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 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
650 |
! |
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 |
topComponent |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
653 |
"return the topView - that the one with no superview" |
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 |
^ self |
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 |
"Created: 9.5.1996 / 01:39:43 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
658 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
topView |
6642 | 661 |
"return the topView - that's the one with no superview" |
727
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 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
665 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
666 |
!DisplaySurface methodsFor:'accessing-limits'! |
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 |
maxExtent |
7691 | 669 |
"return the view's maximum extent - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
670 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
671 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
672 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
673 |
! |
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 |
maxExtent:extent |
7691 | 676 |
"set the view's maximum extent - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
677 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
679 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
680 |
! |
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 |
minExtent |
7691 | 683 |
"return the view's minimum extent - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
684 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
685 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
686 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
687 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
688 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
689 |
minExtent:extent |
7691 | 690 |
"set the view's minimum extent - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
691 |
Only standardSystemViews support this." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
692 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
693 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
694 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
695 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
696 |
!DisplaySurface methodsFor:'accessing-misc'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
697 |
|
8219 | 698 |
automationUUID |
8597 | 699 |
"return my uuid (for automation and the polonium st/x capture/replay tool). |
8219 | 700 |
This is a widget id, as specified in the uispec (if it is defined there). |
701 |
Will be the same for all instances |
|
702 |
(i.e. the same in different instances of the application). |
|
703 |
Contrast this with the instanceUUID, which is unique for each view. |
|
704 |
||
705 |
Notice: old uiSpecs do not provide/define a uuid, and nil is returned; |
|
706 |
so the application's specs must be re-edited and saved again." |
|
707 |
||
708 |
uuid isNil ifTrue:[^ uuid]. |
|
709 |
^ uuid asUUID |
|
710 |
||
711 |
" |
|
8597 | 712 |
Transcript topView automationUUID |
713 |
Transcript topView instanceUUID |
|
8219 | 714 |
" |
715 |
||
716 |
"Created: / 09-11-2017 / 22:33:10 / cg" |
|
8597 | 717 |
"Modified (comment): / 05-12-2018 / 17:50:03 / Stefan Vogel" |
8219 | 718 |
! |
719 |
||
720 |
automationUUID:aUuidOrUuidString |
|
721 |
"set my uuid (for automation and the pollonium st/x capture/replay tool). |
|
722 |
This is a widget id, as specified in the uispec (if it is definedthere). |
|
723 |
Will be the same for all instances |
|
724 |
(i.e. the same in different instances of the application). |
|
725 |
Contrast this with the instanceUUID, which is unique for each view. |
|
726 |
||
727 |
Notice: old uiSpecs do not provide/define a uuid, and nil is returned from uuid; |
|
728 |
so the application's specs must be re-edited and saved again." |
|
729 |
||
730 |
uuid := aUuidOrUuidString |
|
731 |
||
732 |
"Created: / 09-11-2017 / 22:33:14 / cg" |
|
733 |
! |
|
734 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
backingStore:how |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
736 |
"turn on/off backingStore (saving my pixels) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
737 |
how may true/false, but also #always, #whenMapped or #never." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
how ~~ backed ifTrue:[ |
8259 | 740 |
backed := how. |
8926 | 741 |
gc backingStore:how. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
743 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
744 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
745 |
eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
746 |
"return a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
747 |
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
|
748 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
749 |
^ eventMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
750 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
751 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
752 |
eventMask:aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
753 |
"set a (numeric) mask of allowed events - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
754 |
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
|
755 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
756 |
eventMask := aMask |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
757 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
758 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
759 |
getKeyboardFocus |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
760 |
"tell the Display to assign keyboard focus to the receiver" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
761 |
|
3674 | 762 |
self shown ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
763 |
device setInputFocusTo:self drawableId. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
764 |
]. |
2512 | 765 |
|
766 |
"Modified: / 15.3.1999 / 08:25:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
767 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
768 |
|
8219 | 769 |
instanceUUID |
8216 | 770 |
"return my unique uuid. |
771 |
This will be assigned once and only once per instance |
|
772 |
(i.e. the same type of view within different applications will |
|
8219 | 773 |
have different instanceUUIDs)" |
8216 | 774 |
|
775 |
|id| |
|
776 |
||
8219 | 777 |
(id := self getAttribute:#instanceUUID) isNil ifTrue:[ |
778 |
self setAttribute:#instanceUUID to:(id := UUID new). |
|
8216 | 779 |
]. |
780 |
^ id |
|
781 |
||
782 |
" |
|
783 |
Transcript topView getAttribute:#instanceUuid |
|
784 |
Transcript topView instanceUuid |
|
785 |
" |
|
786 |
||
8219 | 787 |
"Created: / 09-11-2017 / 22:32:07 / cg" |
8216 | 788 |
! |
789 |
||
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
790 |
isInputOnly |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
791 |
"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
|
792 |
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
|
793 |
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
|
794 |
others, which where never meant to work in such a setup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
795 |
(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
|
796 |
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
|
797 |
or on other plattforms." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
798 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
799 |
^ false |
781
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
800 |
|
6a02db3a260a
renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents:
734
diff
changeset
|
801 |
"Created: 1.6.1996 / 13:21:51 / cg" |
727
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
804 |
preferredDepth |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
805 |
"return a non nil integer, if a specific depth is wanted in this view. |
8158 | 806 |
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
|
807 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
808 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
809 |
^ nil |
8158 | 810 |
|
811 |
"Modified (comment): / 01-09-2017 / 09:57:44 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
812 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
813 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
814 |
preferredVisual |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
815 |
"return a non nil id, if a specific visual is wanted in this view. |
8158 | 816 |
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
|
817 |
This is experimental and may change/vanish - do not use it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
818 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
^ nil |
8158 | 820 |
|
821 |
"Modified (comment): / 01-09-2017 / 09:57:49 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
822 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
823 |
|
3152 | 824 |
saveUnder |
825 |
"return the saveUnder flag" |
|
826 |
||
827 |
^ flags bitTest:SaveUnderFlagMask |
|
828 |
! |
|
829 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
830 |
saveUnder:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
831 |
"turn on/off saveUnder (saving pixels under myself) |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
832 |
- used for temporary views (i.e. PopUps and ModalBoxes)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
833 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
834 |
aBoolean ifTrue:[ |
8259 | 835 |
flags := flags bitOr:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
836 |
] ifFalse:[ |
8259 | 837 |
flags := flags bitClear:SaveUnderFlagMask. |
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
838 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
839 |
gc saveUnder:aBoolean. |
3859
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
840 |
! |
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
841 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
842 |
setPointerPosition:aRelativePoint |
8467 | 843 |
"set the pointer to aRelativePoint relative to the view's origin. |
844 |
Warning: moving the mouse pointer may lead to the mouse falling off the table |
|
845 |
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
|
846 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
847 |
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
|
848 |
|
a11d876ebc26
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
3856
diff
changeset
|
849 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
850 |
Transcript setPointerPosition:Transcript extent // 2. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
851 |
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
|
852 |
" |
8467 | 853 |
|
854 |
"Modified (comment): / 14-09-2018 / 17:59:18 / Claus Gittinger" |
|
8216 | 855 |
! |
856 |
||
857 |
uuid |
|
8219 | 858 |
<resource: #obsolete> |
859 |
^ self automationUUID |
|
8216 | 860 |
|
861 |
" |
|
862 |
Transcript topView uuid |
|
863 |
Transcript topView instanceUuid |
|
864 |
" |
|
865 |
||
8219 | 866 |
"Modified: / 09-11-2017 / 22:33:24 / cg" |
8216 | 867 |
! |
868 |
||
8218 | 869 |
uuid:aUuidOrUuidString |
8219 | 870 |
<resource: #obsolete> |
871 |
^ self automationUUID:aUuidOrUuidString |
|
872 |
||
873 |
"Modified: / 09-11-2017 / 22:34:12 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
874 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
875 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
876 |
!DisplaySurface methodsFor:'accessing-names'! |
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 |
icon |
7691 | 879 |
"return the view's icon - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
880 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
881 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
882 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
883 |
! |
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 |
icon:aBitmap |
7691 | 886 |
"set the view's icon - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
887 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
888 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
889 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
890 |
! |
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 |
iconLabel |
7691 | 893 |
"return the view's icon label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
894 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
895 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
896 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
897 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
898 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
899 |
iconLabel:aLabel |
7691 | 900 |
"set the view's icon label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
901 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
902 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
903 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
904 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
905 |
|
1481 | 906 |
iconMask |
7691 | 907 |
"return the view's iconMask - this is nil here. |
1481 | 908 |
Only standardSystemViews may support labels and icons." |
909 |
||
910 |
^ nil |
|
911 |
! |
|
912 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
913 |
iconView |
7691 | 914 |
"return the view's iconView - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
915 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
916 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
917 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
918 |
! |
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 |
iconView:aView |
7691 | 921 |
"set the view's icon view - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
922 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
923 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
924 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
925 |
! |
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 |
label |
7691 | 928 |
"return the view's label - this is nil here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
929 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
930 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
931 |
^ nil |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
932 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
933 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
934 |
label:aLabel |
7691 | 935 |
"set the view's label - ignored here. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
936 |
Only standardSystemViews support labels and icons." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
937 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
938 |
^ self |
8724 | 939 |
! |
940 |
||
941 |
label:aLabel iconLabel:iconLabel |
|
942 |
"set both the label and the iconLabel. |
|
943 |
Only standardSystemViews support labels and icons." |
|
944 |
||
945 |
self label:aLabel. |
|
946 |
self iconLabel:iconLabel |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
947 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
948 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
949 |
!DisplaySurface methodsFor:'accessing-private'! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
950 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
951 |
clearGotExposeFlag |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
952 |
"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
|
953 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
954 |
flags := flags bitClear:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
955 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
956 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
957 |
getAttribute:key |
7556 | 958 |
"a place for additional attributes; |
959 |
allows for non-instvar slots to be added" |
|
960 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
961 |
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
|
962 |
^ 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
|
963 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
964 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
965 |
gotExpose |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
966 |
"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
|
967 |
|
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
968 |
^ flags bitTest:GotExposeFlagMask. |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
969 |
! |
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
970 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
971 |
setAttribute:key to:newValue |
7556 | 972 |
"a place for additional attributes; |
973 |
allows for non-instvar slots to be added" |
|
974 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
975 |
newValue isNil ifTrue:[ |
7556 | 976 |
moreAttributes notNil ifTrue:[ |
977 |
moreAttributes removeKey:key ifAbsent:[]. |
|
978 |
moreAttributes := moreAttributes asNilIfEmpty |
|
979 |
] |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
980 |
] ifFalse:[ |
7556 | 981 |
moreAttributes isNil ifTrue:[ |
982 |
moreAttributes := IdentityDictionary new. |
|
983 |
]. |
|
984 |
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
|
985 |
]. |
5081 | 986 |
! |
987 |
||
988 |
setGotExposeFlag |
|
989 |
"internal; used to wait for an expose-event after a scroll operation" |
|
990 |
||
991 |
flags := flags bitOr:GotExposeFlagMask. |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
992 |
! ! |
4969 | 993 |
|
5136 | 994 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
995 |
!DisplaySurface methodsFor:'button menus'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
996 |
|
5773 | 997 |
getMiddleButtonMenu |
998 |
"return the menu associated with the middle mouse button. |
|
999 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
1000 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
1001 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1002 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1003 |
^ self getAttribute:#middleButtonMenu |
5773 | 1004 |
|
1005 |
"Created: / 07-07-2011 / 18:16:21 / cg" |
|
1006 |
! |
|
1007 |
||
1008 |
middleButtonMenu |
|
1009 |
"return the menu associated with the middle mouse button. |
|
1010 |
Here, return a hooked on menu, but usually redefined to provide a widget-specific |
|
1011 |
menu." |
|
1012 |
||
1013 |
^ self getMiddleButtonMenu |
|
1014 |
||
1015 |
"Modified (comment): / 07-07-2011 / 18:18:28 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1016 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1017 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1018 |
middleButtonMenu:aMenu |
5773 | 1019 |
"associate aMenu with the middle mouse button. |
1020 |
This is a possibly obsolete hook for views which do not define their own menu, |
|
1021 |
but are configured from the outside. Nowadays, widgets provide their own menu |
|
1022 |
or are configured using a menuHolder." |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1023 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1024 |
|oldMenu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1025 |
|
5773 | 1026 |
(oldMenu := self getMiddleButtonMenu) notNil ifTrue:[ |
8259 | 1027 |
oldMenu isArray ifFalse:[ |
1028 |
oldMenu destroy |
|
1029 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1030 |
]. |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1031 |
self setMiddleButtonMenu:aMenu |
5740 | 1032 |
|
5773 | 1033 |
"Modified: / 07-07-2011 / 18:18:00 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1034 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1035 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1036 |
setMiddleButtonMenu:aMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1037 |
"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
|
1038 |
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
|
1039 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1040 |
self setAttribute:#middleButtonMenu to:aMenu |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1041 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1042 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1043 |
!DisplaySurface methodsFor:'clipboard'! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1044 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1045 |
getClipboardObject |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1046 |
"return the object selection |
8158 | 1047 |
- 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
|
1048 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1049 |
^ device getClipboardObjectFor:self drawableId. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1050 |
|
8158 | 1051 |
"Modified: / 13-02-1997 / 13:18:50 / cg" |
1052 |
"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
|
1053 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1054 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1055 |
getClipboardText |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1056 |
"return the copyBuffers contents |
8158 | 1057 |
- 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
|
1058 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1059 |
^ self getClipboardText:#clipboard |
8158 | 1060 |
|
1061 |
"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
|
1062 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1063 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1064 |
getClipboardText:selectionBufferSymbol |
8158 | 1065 |
"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
|
1066 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1067 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1068 |
or: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1069 |
#selection. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1070 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1071 |
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
|
1072 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1073 |
^ device getClipboardText:selectionBufferSymbol for:self drawableId. |
8158 | 1074 |
|
1075 |
"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
|
1076 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1077 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1078 |
getSelection |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1079 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1080 |
self obsoleteMethodWarning:'use #getClipboardObject'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1081 |
^ self getClipboardObject |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1082 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1083 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1084 |
getTextSelection |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1085 |
"return the copyBuffers contents |
8158 | 1086 |
- 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
|
1087 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1088 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1089 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1090 |
self obsoleteMethodWarning:'use #getClipboardText'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1091 |
^ self getClipboardText |
8158 | 1092 |
|
1093 |
"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
|
1094 |
! |
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 |
getTextSelection:selectionBufferSymbol |
8158 | 1097 |
"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
|
1098 |
clipBoard buffers determined by selectionBufferSymbol, which should be one of: |
8158 | 1099 |
#clipboard |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1100 |
or: |
8158 | 1101 |
#selection. |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1102 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1103 |
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
|
1104 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1105 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1106 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1107 |
self obsoleteMethodWarning:'#use getClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1108 |
^ self getClipboardText:selectionBufferSymbol |
8158 | 1109 |
|
1110 |
"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
|
1111 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1112 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1113 |
setClipboardObject:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1114 |
"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
|
1115 |
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
|
1116 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1117 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1118 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1119 |
|
7687 | 1120 |
setClipboardText:aString |
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1121 |
"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
|
1122 |
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
|
1123 |
|
7687 | 1124 |
device setClipboardText:aString ownerView:self |
1125 |
||
1126 |
"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
|
1127 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1128 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1129 |
setSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1130 |
"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
|
1131 |
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
|
1132 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1133 |
<resource: #obsolete> |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1134 |
|
4283
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1135 |
self obsoleteMethodWarning:'use setClipboardObject:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1136 |
device setClipboardObject:something ownerView:self. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1137 |
! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1138 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1139 |
setTextSelection:something |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1140 |
"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
|
1141 |
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
|
1142 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1143 |
<resource: #obsolete> |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1144 |
|
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1145 |
self obsoleteMethodWarning:'use setClipboardText:'. |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1146 |
device setClipboardText:something ownerView:self |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1147 |
! ! |
a0ff53c935c6
category change and obsolete method marking
Stefan Vogel <sv@exept.de>
parents:
4280
diff
changeset
|
1148 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1149 |
!DisplaySurface methodsFor:'drawing'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1150 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1151 |
clearDeviceRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1152 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1153 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1154 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1155 |
|
7020 | 1156 |
|oldPaint org patternOffsetX patternOffsetY| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1157 |
|
7744 | 1158 |
(w <= 0 or:[h <= 0]) ifTrue:[^ self]. |
1159 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1160 |
gc isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1161 |
"nothing to clear" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1162 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1163 |
]. |
7302 | 1164 |
viewBackground isNil ifTrue:[^ self]. "/ how can this happen? |
1165 |
||
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1166 |
viewBackground isColor ifFalse:[ |
6240 | 1167 |
viewBackground isViewBackground ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1168 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1169 |
self |
7744 | 1170 |
paint:gc background; |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1171 |
fillDeviceRectangleX:x y:y width:w height:h; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1172 |
paint:oldPaint. |
6240 | 1173 |
viewBackground fillRectangleX:x y:y width:w height:h in:self. |
1174 |
^ self. |
|
1175 |
]. |
|
1176 |
||
7473 | 1177 |
org := self viewOrigin. |
7020 | 1178 |
(device supportsMaskedDrawingWith:viewBackground) ifFalse:[ |
1179 |
"/ hand-fill: the device cannot draw with a bitmap pattern underneath. |
|
7473 | 1180 |
self fillDeviceRectangleWithPattern:viewBackground x:x y:y width:w height:h patternOffset:org. |
7020 | 1181 |
^ self. |
1182 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1183 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1184 |
patternOffsetX := (org x rounded \\ viewBackground width). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1185 |
patternOffsetY := (org y rounded \\ viewBackground height). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1186 |
(patternOffsetX ~= 0 or:[patternOffsetY ~= 0]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1187 |
(device supportsMaskedDrawingWithOffset:viewBackground) ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1188 |
"/ hand-fill: the device cannot draw with a shifted bitmap pattern underneath. |
7473 | 1189 |
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
|
1190 |
^ self. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1191 |
]. |
5458 | 1192 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1193 |
gc setDeviceMaskOriginX:patternOffsetX negated y:patternOffsetY negated. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1194 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1195 |
|
727
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 |
fill in device coordinates - not logical coordinates |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1198 |
" |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1199 |
oldPaint := self paint. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1200 |
self |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1201 |
paint:viewBackground; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1202 |
fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground"; |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1203 |
paint:oldPaint. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1204 |
|
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1205 |
"Modified: / 4.5.1999 / 13:00:34 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1206 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1207 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1208 |
clearRectangleX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1209 |
"clear a rectangular area to viewBackground - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1210 |
redefined since GraphicsMedium fills with background |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1211 |
- not viewBackground as we want here." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1212 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1213 |
|pX pY pW pH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1214 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1215 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1216 |
currentTransformation notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1217 |
pX := currentTransformation applyToX:x. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1218 |
pY := currentTransformation applyToY:y. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1219 |
pW := currentTransformation applyScaleX:w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1220 |
pH := currentTransformation applyScaleY:h. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1221 |
] ifFalse:[ |
6692 | 1222 |
pX := x. |
1223 |
pY := y. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1224 |
pW := w. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1225 |
pH := h. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1226 |
]. |
2341
a7dc2588d6dc
clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents:
2300
diff
changeset
|
1227 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1228 |
^ 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
|
1229 |
|
2393
247e70febb7d
oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
1230 |
"Modified: / 30.10.1998 / 15:00:37 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1231 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1232 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1233 |
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
|
1234 |
"fill a rectangular area with some pattern. |
5458 | 1235 |
A helper for devices which do not support pixmap drawing (i.e. win95). |
1236 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1237 |
Caller must ensure that aPixmap is really a form. |
1238 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1239 |
therefore it is actually not obsolete." |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1240 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1241 |
|r b |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1242 |
pW "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1243 |
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
|
1244 |
xR0 |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1245 |
xR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1246 |
yR "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1247 |
xE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1248 |
yE "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1249 |
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
|
1250 |
offsX "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1251 |
offsY "{ Class: SmallInteger }" |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1252 |
oX "{ Class: SmallInteger }" |
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1253 |
oY "{ Class: SmallInteger }"| |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1254 |
|
2640
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1255 |
x := xIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1256 |
y := yIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1257 |
w := wIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1258 |
h := hIn. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1259 |
|
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1260 |
x := x max:0. |
033824608132
oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
1261 |
y := y max:0. |
7744 | 1262 |
r := (xIn + w) min:width. |
1263 |
b := (yIn + h) min:height. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1264 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1265 |
pW := aPixmap width. |
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1266 |
pH := aPixmap height. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1267 |
|
7470 | 1268 |
oldClip := self deviceClippingBoundsOrNil. |
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1269 |
oldClip notNil ifTrue:[ |
7426 | 1270 |
x := x max:oldClip left. |
1271 |
y := y max:oldClip top. |
|
1272 |
r := r min:oldClip right. |
|
1273 |
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
|
1274 |
]. |
7744 | 1275 |
w := r-x. |
1276 |
h := b-y. |
|
2398
bc2e3e470efe
fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents:
2393
diff
changeset
|
1277 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1278 |
yR := (y // pH) * pH. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1279 |
yE := y+h. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1280 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1281 |
yR >= yE ifTrue:[^ self]. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1282 |
|
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1283 |
xR0 := (x // pW) * pW. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1284 |
xE := x+w. |
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1285 |
|
6770 | 1286 |
xR0 >= xE ifTrue:[^ self]. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1287 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1288 |
aPixmap depth == 1 ifTrue:[ |
7744 | 1289 |
oldFg := gc foreground. |
1290 |
oldBg := gc background. |
|
7426 | 1291 |
(clrMap := aPixmap colorMap) notNil ifTrue:[ |
1292 |
bg := clrMap at:1. |
|
1293 |
fg := clrMap at:2. |
|
1294 |
] ifFalse:[ |
|
1295 |
bg := self whiteColor. |
|
1296 |
fg := self blackColor. |
|
1297 |
]. |
|
7744 | 1298 |
gc foreground:fg background:bg. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1299 |
]. |
7470 | 1300 |
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
|
1301 |
|
5458 | 1302 |
offsX := (xR0 + pattOffs x) \\ pW. |
1303 |
offsY := (yR + pattOffs y) \\ pH. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1304 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1305 |
oY := offsY. |
2632
e18b55db3e1e
replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
1306 |
[yR < yE] whileTrue:[ |
7426 | 1307 |
xR := xR0. |
1308 |
oX := offsX. |
|
1309 |
[xR < xE] whileTrue:[ |
|
1310 |
self |
|
1311 |
copyFrom:aPixmap |
|
1312 |
x:oX y:oY |
|
1313 |
toX:xR y:yR |
|
1314 |
width:(pW - oX) height:(pH - oY) |
|
1315 |
async:true. |
|
1316 |
xR := xR + pW - oX. |
|
1317 |
oX := 0. |
|
1318 |
]. |
|
1319 |
yR := yR + pH - oY. |
|
1320 |
oY := 0. |
|
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1321 |
]. |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1322 |
|
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1323 |
oldFg notNil ifTrue:[ |
7744 | 1324 |
gc foreground:oldFg background:oldBg. |
2656
c21d19544e16
care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1325 |
]. |
7470 | 1326 |
self deviceClippingBounds:oldClip. |
2300
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1327 |
|
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1328 |
"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
|
1329 |
"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
|
1330 |
"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
|
1331 |
! |
87306f56da51
ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents:
2196
diff
changeset
|
1332 |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1333 |
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
|
1334 |
"fill a rectangular area with aPixmap. |
5458 | 1335 |
A helper for devices which do not support pixmap filling (i.e. win95 screens). |
1336 |
This is never invoked with X11 or Win-NT/XP/Vista systems. |
|
7744 | 1337 |
Caller must ensure that the aPixmap is really a form. |
1338 |
CG: mhm it seems that XQuartz has a bug and also has problems doing this. |
|
1339 |
therefore it is actually not obsolete." |
|
2660
c6a707b38caa
generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents:
2658
diff
changeset
|
1340 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1341 |
|pX pY nW nH currentTransformation| |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1342 |
|
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1343 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1344 |
currentTransformation notNil ifTrue:[ |
7744 | 1345 |
pX := currentTransformation applyToX:x. |
1346 |
pY := currentTransformation applyToY:y. |
|
1347 |
nW := currentTransformation applyScaleX:w. |
|
1348 |
nH := currentTransformation applyScaleY:h. |
|
1349 |
nW < 0 ifTrue:[ |
|
1350 |
nW := nW abs. |
|
1351 |
pX := pX - nW. |
|
1352 |
]. |
|
1353 |
nH < 0 ifTrue:[ |
|
1354 |
nH := nH abs. |
|
1355 |
pY := pY - nH. |
|
1356 |
]. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1357 |
] ifFalse:[ |
7744 | 1358 |
pX := x. |
1359 |
pY := y. |
|
1360 |
nW := w. |
|
1361 |
nH := h. |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1362 |
]. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1363 |
pX := pX rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1364 |
pY := pY rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1365 |
nW := nW rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1366 |
nH := nH rounded. |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1367 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1368 |
self |
7744 | 1369 |
fillDeviceRectangleWithPattern:aPixmap |
1370 |
x:pX y:pY width:nW height:nH |
|
1371 |
patternOffset:pattOffs |
|
2654
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1372 |
|
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1373 |
"Modified: 4.6.1996 / 17:58:49 / cg" |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1374 |
! |
f919ca08f450
fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
1375 |
|
8964 | 1376 |
flashRectangle:rect |
1377 |
"flash part of the view - fill it flashColor, then white, |
|
1378 |
finally redraw. |
|
1379 |
Can be used to bring attention to some line/part of view" |
|
1380 |
||
1381 |
self xoring:[ |
|
1382 |
self fillRectangle:rect color:(self blackColor). |
|
1383 |
]. |
|
1384 |
||
1385 |
Delay waitForSeconds:0.1. |
|
1386 |
||
1387 |
self xoring:[ |
|
1388 |
self fillRectangle:rect color:(self blackColor). |
|
1389 |
]. |
|
1390 |
Delay waitForSeconds:0.1. |
|
1391 |
||
1392 |
" |
|
1393 |
Display rootView flashRectangle:(10@10 corner:100@100) |
|
1394 |
Display rootView flashRectangle:(100@100 corner:200@300) |
|
1395 |
" |
|
1396 |
! |
|
1397 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1398 |
redraw |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1399 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1400 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1403 |
!DisplaySurface methodsFor:'enable/disable events'! |
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 |
compressMotionEvents:aBoolean |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1406 |
"enable/disable motion event compression |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1407 |
(i.e. replacing all motion events by the last one). |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1408 |
Compression makes almost always sense, except when |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1409 |
doing things like freehand drawing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1410 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1411 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1412 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1413 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
1414 |
windowGroup notNil ifTrue:[ |
8259 | 1415 |
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
|
1416 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1417 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1418 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1419 |
disableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1420 |
"disable all button events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1421 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1422 |
self disableEvent:#buttonPress; disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1423 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1424 |
"Modified: 29.4.1996 / 11:09:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1425 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1426 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1427 |
disableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
"disable button motion-while-button-is-pressed events" |
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 |
self disableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1431 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1432 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1433 |
disableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
"disable button press events" |
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 |
self disableEvent:#buttonPress |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1439 |
disableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1440 |
"disable button release events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1441 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1442 |
self disableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1443 |
! |
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 |
disableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1446 |
"disable both mouse-pointer enter and leave events" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1447 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1448 |
self disableEvent:#enter; disableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1449 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1450 |
"Modified: 29.4.1996 / 11:09:37 / cg" |
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 |
disableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1454 |
"disable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1455 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1456 |
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
|
1457 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1458 |
eventMask := eventMask bitAnd:(self graphicsDevice eventMaskFor:anEventSymbol) bitInvert. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
1459 |
self drawableId notNil ifTrue:[ |
8259 | 1460 |
self graphicsDevice setEventMask:eventMask in:self drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1461 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1462 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1463 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1464 |
disableMotionEvents |
1332 | 1465 |
"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
|
1466 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1467 |
self disableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1468 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1469 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1470 |
enableButtonEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1471 |
"enable both mouse button press and release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1472 |
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
|
1473 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1474 |
self enableEvent:#buttonPress; enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1475 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1476 |
"Modified: 29.4.1996 / 11:09:46 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1477 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1478 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1479 |
enableButtonMotionEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1480 |
"enable mouse-pointer motion-while-button-is-pressed events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1481 |
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
|
1482 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1483 |
self enableEvent:#buttonMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1484 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1485 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1486 |
enableButtonPressEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1487 |
"enable mouse button press events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1488 |
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
|
1489 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1490 |
self enableEvent:#buttonPress |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1493 |
enableButtonReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1494 |
"enable mouse button release events. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1495 |
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
|
1496 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1497 |
self enableEvent:#buttonRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1498 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1499 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1500 |
enableEnterEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1501 |
"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
|
1502 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1503 |
self enableEvent:#enter |
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 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1506 |
enableEnterLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1507 |
"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
|
1508 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1509 |
self enableEvent:#enter; enableEvent:#leave |
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 |
"Modified: 29.4.1996 / 11:09:55 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1512 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1513 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1514 |
enableEvent:anEventSymbol |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1515 |
"enable an event - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1516 |
this is a private (internal) method not to be used externally. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1517 |
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
|
1518 |
|
8926 | 1519 |
|drawableId| |
1520 |
||
1521 |
drawableId := self drawableId. |
|
1522 |
eventMask := (eventMask ? 0) bitOr:(device eventMaskFor:anEventSymbol). |
|
1523 |
drawableId notNil ifTrue:[ |
|
1524 |
device setEventMask:eventMask in:drawableId |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1525 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1526 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1527 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1528 |
enableFocusEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1529 |
"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
|
1530 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1531 |
self enableEvent:#focusChange |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1532 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1533 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1534 |
enableKeyEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1535 |
"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
|
1536 |
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
|
1537 |
^C processing." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1538 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1539 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1540 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1541 |
enableKeyPressEvents |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1542 |
"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
|
1543 |
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
|
1544 |
^C processing." |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1545 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1546 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1547 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1548 |
enableKeyReleaseEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1549 |
"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
|
1550 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1551 |
self enableEvent:#keyRelease |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1552 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1553 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1554 |
enableLeaveEvents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1555 |
"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
|
1556 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1557 |
self enableEvent:#leave |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1558 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1559 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1560 |
enableMotionEvents |
4453 | 1561 |
"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
|
1562 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1563 |
self enableEvent:#pointerMotion |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1564 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1565 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1566 |
!DisplaySurface methodsFor:'event dispatching'! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1567 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1568 |
dispatchEvent:event |
2962 | 1569 |
"dispatch an event" |
1570 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1571 |
^ self |
8259 | 1572 |
dispatchEvent:event |
1573 |
withFocusOn:nil |
|
1574 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1575 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1576 |
"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
|
1577 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1578 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1579 |
dispatchEvent:type arguments:arguments |
8501 | 1580 |
<resource: #obsolete> |
1581 |
"dispatch an event. |
|
1582 |
Obsoleted - now we always pass around event objects." |
|
2962 | 1583 |
|
3094 | 1584 |
"/ 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
|
1585 |
^ self |
8259 | 1586 |
dispatchEvent:nil |
1587 |
type:type |
|
1588 |
arguments:arguments |
|
1589 |
withFocusOn:nil |
|
1590 |
delegate:true |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1591 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1592 |
"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
|
1593 |
! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1594 |
|
3094 | 1595 |
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
|
1596 |
"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
|
1597 |
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
|
1598 |
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
|
1599 |
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
|
1600 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1601 |
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
|
1602 |
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
|
1603 |
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
|
1604 |
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
|
1605 |
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
|
1606 |
before. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1607 |
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
|
1608 |
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
|
1609 |
forwarding." |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1610 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1611 |
|delegate selector delegateMessage delegateQuery |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1612 |
eventReceiver controller deviceMessage |
7410 | 1613 |
isKeyEvent isButtonEvent isMouseWheelEvent isPointerEvent isExposeEvent |
1614 |
||
8487 | 1615 |
rect x y w h delegatedEvent rgn |
8543 | 1616 |
|
8487 | 1617 |
eventForLastEventQuery| |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1618 |
|
8543 | 1619 |
type == #damage ifTrue:[ |
7739 | 1620 |
"/ OLDdamage scheme - this will vanish |
1621 |
self shown ifTrue:[ |
|
1622 |
rect := argArray. |
|
1623 |
x := rect left. |
|
1624 |
y := rect top. |
|
1625 |
w := rect width. |
|
1626 |
h := rect height. |
|
1627 |
gc transformation notNil ifTrue:[ |
|
1628 |
self deviceExposeX:x y:y width:w height:h |
|
1629 |
] ifFalse:[ |
|
1630 |
self exposeX:x y:y width:w height:h |
|
1631 |
] |
|
1632 |
]. |
|
1633 |
^ self |
|
4041 | 1634 |
]. |
1635 |
||
1636 |
type == #newDamage ifTrue:[ |
|
7739 | 1637 |
"/ New damage scheme |
1638 |
rgn := updateRegion. |
|
1639 |
updateRegion := nil. |
|
1640 |
self shown ifTrue:[ |
|
1641 |
rgn notNil ifTrue:[ |
|
1642 |
rgn do:[:rect | |
|
1643 |
"/ cg: I think the check for being realized may not be enough; |
|
1644 |
"/ there is a race here, if the view gets closed, while in the loop... |
|
1645 |
realized ifTrue:[ |
|
1646 |
x := rect left. |
|
1647 |
y := rect top. |
|
1648 |
w := rect width. |
|
1649 |
h := rect height. |
|
1650 |
gc transformation notNil ifTrue:[ |
|
1651 |
self deviceExposeX:x y:y width:w height:h |
|
1652 |
] ifFalse:[ |
|
1653 |
self exposeX:x y:y width:w height:h |
|
1654 |
] |
|
1655 |
] |
|
1656 |
] |
|
1657 |
] |
|
1658 |
]. |
|
1659 |
^ self |
|
2498 | 1660 |
]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1661 |
|
7410 | 1662 |
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
|
1663 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1664 |
(type == #'keyPress:x:y:') ifTrue:[ |
7739 | 1665 |
isKeyEvent := true. |
1666 |
deviceMessage := #'deviceKeyPress:x:y:'. |
|
1667 |
delegateMessage := #'keyPress:x:y:view:'. |
|
1668 |
delegateQuery := #'handlesKeyPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1669 |
] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[ |
7739 | 1670 |
isKeyEvent := true. |
1671 |
deviceMessage := #'deviceKeyRelease:x:y:'. |
|
1672 |
delegateMessage := #'keyRelease:x:y:view:'. |
|
1673 |
delegateQuery := #'handlesKeyRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1674 |
] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[ |
7739 | 1675 |
isButtonEvent := true. |
1676 |
deviceMessage := #'deviceButtonMotion:x:y:'. |
|
1677 |
delegateMessage := #'buttonMotion:x:y:view:'. |
|
1678 |
delegateQuery := #'handlesButtonMotion:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1679 |
] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[ |
7739 | 1680 |
isButtonEvent := true. |
1681 |
deviceMessage := #'deviceButtonPress:x:y:'. |
|
1682 |
delegateMessage := #'buttonPress:x:y:view:'. |
|
1683 |
delegateQuery := #'handlesButtonPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1684 |
] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[ |
7739 | 1685 |
isButtonEvent := true. |
1686 |
deviceMessage := #'deviceButtonRelease:x:y:'. |
|
1687 |
delegateMessage := #'buttonRelease:x:y:view:'. |
|
1688 |
delegateQuery := #'handlesButtonRelease:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1689 |
] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[ |
7739 | 1690 |
isButtonEvent := true. |
1691 |
deviceMessage := #'deviceButtonShiftPress:x:y:'. |
|
1692 |
delegateMessage := #'buttonShiftPress:x:y:view:'. |
|
1693 |
delegateQuery := #'handlesButtonShiftPress:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1694 |
] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[ |
7739 | 1695 |
isButtonEvent := true. |
1696 |
deviceMessage := #'deviceButtonMultiPress:x:y:'. |
|
1697 |
delegateMessage := #'buttonMultiPress:x:y:view:'. |
|
1698 |
delegateQuery := #'handlesButtonMultiPress:inView:'. |
|
4856 | 1699 |
] ifFalse:[ (type == #mouseWheelMotion:x:y:amount:deltaTime:) ifTrue:[ |
7739 | 1700 |
isMouseWheelEvent := true. |
1701 |
deviceMessage := type. |
|
1702 |
delegateMessage := #mouseWheelMotion:x:y:amount:deltaTime:view:. |
|
1703 |
delegateQuery := #handlesMouseWheelMotion:inView:. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1704 |
] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[ |
7739 | 1705 |
isPointerEvent := true. |
1706 |
deviceMessage := #'devicePointerEnter:x:y:'. |
|
1707 |
delegateMessage := #'pointerEnter:x:y:view:'. |
|
1708 |
delegateQuery := #'handlesPointerEnter:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1709 |
] ifFalse:[ (type == #'pointerLeave:') ifTrue:[ |
7739 | 1710 |
isPointerEvent := true. |
1711 |
deviceMessage := type. |
|
1712 |
delegateMessage := #'pointerLeave:view:'. |
|
1713 |
delegateQuery := #'handlesPointerLeave:inView:'. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1714 |
] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[ |
7739 | 1715 |
isExposeEvent := true. |
1716 |
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
|
1717 |
] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[ |
7739 | 1718 |
isExposeEvent := true. |
1719 |
deviceMessage := #'deviceGraphicsExposeX:y:width:height:final:'. |
|
4856 | 1720 |
]]]]]]]]]]]]. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1721 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1722 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1723 |
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
|
1724 |
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
|
1725 |
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
|
1726 |
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
|
1727 |
" |
5208 | 1728 |
((isKeyEvent "or:[isMouseWheelEvent]") |
1729 |
and:[focusView notNil and:[self ~~ focusView]]) ifTrue:[ |
|
7739 | 1730 |
delegatedEvent := ev shallowCopy. |
1731 |
delegatedEvent delegatedFrom:ev. |
|
1732 |
delegatedEvent arguments:(ev arguments shallowCopy). |
|
1733 |
delegatedEvent x:-1; y:-1. |
|
1734 |
||
1735 |
focusView |
|
1736 |
dispatchEvent:delegatedEvent |
|
8081 | 1737 |
type:delegatedEvent type |
1738 |
arguments:(delegatedEvent arguments) |
|
7739 | 1739 |
withFocusOn:nil |
1740 |
delegate:doDelegate. |
|
1741 |
^ self |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1742 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1743 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1744 |
doDelegate ifTrue:[ |
7739 | 1745 |
" |
1746 |
handle delegated messages |
|
1747 |
" |
|
1748 |
(isKeyEvent |
|
1749 |
or:[isButtonEvent |
|
1750 |
or:[isMouseWheelEvent |
|
1751 |
or:[isPointerEvent]]]) ifTrue:[ |
|
1752 |
delegate := self delegate. |
|
1753 |
||
1754 |
" |
|
1755 |
what a kludge - sending to delegate requires |
|
1756 |
another selector and an additional argument ... |
|
1757 |
" |
|
1758 |
(delegate notNil) ifTrue:[ |
|
1759 |
" |
|
1760 |
is the delegate interested in that event ? |
|
1761 |
(if it does not respond to the handlesXXX message, assume: NO) |
|
1762 |
" |
|
1763 |
(delegate askFor:delegateQuery with:(argArray at:1) with:self) ifTrue:[ |
|
1764 |
" |
|
1765 |
mhmh ... have to convert to logical coordinates |
|
1766 |
" |
|
1767 |
|currentTransformation| |
|
1768 |
||
1769 |
currentTransformation := gc transformation. |
|
1770 |
currentTransformation notNil ifTrue:[ |
|
1771 |
argArray size > 2 ifTrue:[ |
|
1772 |
argArray at:2 put:(currentTransformation applyInverseToX:(argArray at:2)). |
|
1773 |
argArray at:3 put:(currentTransformation applyInverseToY:(argArray at:3)). |
|
1774 |
]. |
|
1775 |
]. |
|
1776 |
argArray isNil ifTrue:[ |
|
1777 |
delegate perform:delegateMessage with:self |
|
1778 |
] ifFalse:[ |
|
1779 |
delegate perform:delegateMessage withArguments:(argArray copyWith:self) |
|
1780 |
]. |
|
1781 |
^ self |
|
1782 |
] |
|
1783 |
]. |
|
1784 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1785 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1786 |
|
2708 | 1787 |
" |
1788 |
if I am not shown, ignore input events |
|
1789 |
" |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1790 |
(isKeyEvent |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1791 |
or:[isButtonEvent |
5208 | 1792 |
or:[isMouseWheelEvent |
1793 |
or:[isPointerEvent]]]) ifTrue:[ |
|
7739 | 1794 |
realized ifFalse:[ |
1795 |
^ self |
|
1796 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1797 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1798 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1799 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1800 |
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
|
1801 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1802 |
eventReceiver := self. |
8081 | 1803 |
((controller := self controller) notNil and:[controller ~~ eventReceiver]) ifTrue:[ |
7739 | 1804 |
(isKeyEvent |
1805 |
or:[isButtonEvent |
|
1806 |
or:[isMouseWheelEvent |
|
1807 |
or:[isPointerEvent |
|
1808 |
or:[(type == #focusIn) |
|
1809 |
or:[(type == #focusOut)]]]]]) ifTrue:[ |
|
1810 |
eventReceiver := controller. |
|
1811 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1812 |
]. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1813 |
|
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1814 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1815 |
finally, another one: |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1816 |
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
|
1817 |
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
|
1818 |
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
|
1819 |
in DisplaySurface translates and resends). |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1820 |
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
|
1821 |
(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
|
1822 |
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
|
1823 |
" |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1824 |
selector := type. |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1825 |
|
7739 | 1826 |
(isKeyEvent |
1827 |
or:[isButtonEvent |
|
1828 |
or:[isMouseWheelEvent |
|
1829 |
or:[isPointerEvent |
|
1830 |
or:[isExposeEvent]]]]) ifTrue:[ |
|
1831 |
gc transformation notNil ifTrue:[ |
|
1832 |
selector := deviceMessage |
|
1833 |
] |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1834 |
]. |
8487 | 1835 |
|
1836 |
"sr: #ev is nil when called via #dispatchEvent:arguments: |
|
1837 |
I think we should pass the 'triggering' event at least" |
|
1838 |
eventForLastEventQuery := ev. |
|
1839 |
eventForLastEventQuery isNil ifTrue:[ |
|
1840 |
eventForLastEventQuery := WindowGroup lastEvent. |
|
1841 |
]. |
|
1842 |
||
1843 |
WindowGroup lastEventQuerySignal |
|
1844 |
answer:eventForLastEventQuery |
|
1845 |
do:[ |
|
1846 |
eventReceiver perform:selector withArguments:argArray |
|
1847 |
]. |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1848 |
|
8081 | 1849 |
"Created: / 20-05-1998 / 22:46:25 / cg" |
1850 |
"Modified: / 17-08-2017 / 09:47:01 / cg" |
|
8477 | 1851 |
"Modified: / 21-09-2018 / 11:39:47 / Claus Gittinger" |
8487 | 1852 |
"Modified: / 01-10-2018 / 14:17:18 / sr" |
2962 | 1853 |
! |
1854 |
||
1855 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
1856 |
"dispatch the event" |
|
1857 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1858 |
^ self |
8259 | 1859 |
dispatchEvent:event |
1860 |
withFocusOn:focusViewOrNil |
|
1861 |
delegate:true |
|
3094 | 1862 |
|
1863 |
"Modified: / 20.5.1998 / 23:01:15 / cg" |
|
1864 |
! |
|
1865 |
||
1866 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
1867 |
"dispatch the event" |
|
1868 |
||
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1869 |
^ self |
8259 | 1870 |
dispatchEvent:event |
1871 |
type:event type |
|
1872 |
arguments:(event arguments) |
|
1873 |
withFocusOn:focusViewOrNil |
|
1874 |
delegate:doDelegate |
|
2962 | 1875 |
|
1876 |
"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
|
1877 |
! ! |
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1878 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1879 |
!DisplaySurface methodsFor:'event handling'! |
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 |
activateMenu |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1882 |
"if there is a menu, show it." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1883 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1884 |
|menu| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1885 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1886 |
(menu := self middleButtonMenu) notNil ifTrue:[ |
8654 | 1887 |
self activateMenu:menu |
1888 |
] |
|
1889 |
||
1890 |
"Created: / 01-03-1996 / 13:24:55 / cg" |
|
1891 |
"Modified: / 15-03-2017 / 10:41:26 / cg" |
|
1892 |
"Modified: / 02-03-2019 / 11:40:45 / Claus Gittinger" |
|
1893 |
! |
|
1894 |
||
1895 |
activateMenu:aMenu |
|
1896 |
"if aMenu is a menu, show it." |
|
1897 |
||
1898 |
|menu| |
|
1899 |
||
1900 |
(menu := aMenu) notNil ifTrue:[ |
|
8349 | 1901 |
menu isBlock ifTrue:[ menu := menu value ]. |
7977 | 1902 |
menu isArray ifTrue:[ |
1903 |
"/ a spec array |
|
1904 |
menu := menu decodeAsLiteralArray. |
|
8349 | 1905 |
menu findGuiResourcesIn:(self application ? self) for:self. |
7977 | 1906 |
menu receiver:self. |
1907 |
]. |
|
1908 |
menu showAtPointer |
|
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 |
|
8654 | 1911 |
"Created: / 02-03-2019 / 11:40:29 / Claus Gittinger" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1912 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1913 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1914 |
buttonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1915 |
"mouse was moved while button is pressed - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1916 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1917 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1918 |
! |
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 |
buttonMultiPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1921 |
"button was pressed fast after previous press - default to press-again" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1922 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1923 |
^ self buttonPress:button x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1924 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1925 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1926 |
buttonPress:button x:x y:y |
7879 | 1927 |
"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
|
1928 |
|
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1929 |
(button == 2) ifTrue:[ |
7879 | 1930 |
UserPreferences current showRightButtonMenuOnRelease ifFalse:[ |
1931 |
self activateMenu. |
|
1932 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1933 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1934 |
|
7879 | 1935 |
"Modified: / 01-03-1996 / 13:25:07 / cg" |
1936 |
"Modified (comment): / 13-02-2017 / 20:01:10 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1937 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1938 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1939 |
buttonRelease:button x:x y:y |
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1940 |
(button == 2) ifTrue:[ |
8259 | 1941 |
UserPreferences current showRightButtonMenuOnRelease ifTrue:[ |
1942 |
self activateMenu. |
|
1943 |
]. |
|
5344
2c3f14c132be
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
5320
diff
changeset
|
1944 |
]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1945 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1946 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
catchExpose |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
1948 |
"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
|
1949 |
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
|
1950 |
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
|
1951 |
suspend until the expose/noExpose event arrives. |
8041 | 1952 |
This is an X speciality - for devices that do not need this kind of |
1332 | 1953 |
asynchronous bit-blt confirmation, this is a noop. |
8041 | 1954 |
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
|
1955 |
" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1956 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1957 |
|wg| |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1958 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1959 |
device scrollsAsynchronous ifFalse:[ |
7466 | 1960 |
self setGotExposeFlag. |
1961 |
^ false |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1962 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
1963 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1964 |
self setGraphicsExposures:true. |
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
1965 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
1966 |
self clearGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1967 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1968 |
wg notNil ifTrue:[ |
7466 | 1969 |
" |
8041 | 1970 |
must process any pending expose events, since |
7466 | 1971 |
usually the origin is changed soon so that previous |
1972 |
expose events coordinates are invalid |
|
1973 |
" |
|
1974 |
wg processRealExposeEventsFor:self. |
|
1975 |
wg sensor catchExposeFor:self. |
|
1976 |
^ true |
|
1977 |
]. |
|
1978 |
^ false. |
|
1245
4a4e15a3e4fd
pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents:
1236
diff
changeset
|
1979 |
|
8041 | 1980 |
"Modified: / 06-08-1997 / 19:50:15 / cg" |
1981 |
"Modified (comment): / 30-05-2017 / 18:58:45 / mawalch" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1982 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1983 |
|
3595
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1984 |
coveredBy:aView |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1985 |
"the receiver has been covered by another view; |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1986 |
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
|
1987 |
! |
fee0baf5b18e
#coveredBy: moved from SimpleView to DisplaySurface
Stefan Vogel <sv@exept.de>
parents:
3546
diff
changeset
|
1988 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1989 |
deviceButtonMotion:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1990 |
"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
|
1991 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1992 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1993 |
and send a #buttonMotion with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1994 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1995 |
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
|
1996 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
1997 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1998 |
should redefine #buttonMotion:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1999 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2000 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2001 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2002 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2004 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2005 |
currentTransformation notNil ifTrue:[ |
8259 | 2006 |
lx notNil ifTrue:[ |
2007 |
lx := currentTransformation applyInverseToX:lx. |
|
2008 |
ly := currentTransformation applyInverseToY:ly. |
|
2009 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2010 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2011 |
self buttonMotion:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2012 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2013 |
"Modified: 20.5.1996 / 17:45:25 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2014 |
"Modified: 14.10.1996 / 22:25:12 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2015 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2016 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2017 |
deviceButtonMultiPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2018 |
"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
|
2019 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2020 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2021 |
and send a buttonMultiPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2022 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2023 |
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
|
2024 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2025 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2026 |
should redefine #buttonMultiPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2027 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2028 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2029 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2030 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2031 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2032 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2033 |
currentTransformation notNil ifTrue:[ |
8259 | 2034 |
lx notNil ifTrue:[ |
2035 |
lx := currentTransformation applyInverseToX:lx. |
|
2036 |
ly := currentTransformation applyInverseToY:ly. |
|
2037 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2038 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2039 |
self buttonMultiPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2040 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2041 |
"Modified: 20.5.1996 / 17:45:22 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2042 |
"Modified: 14.10.1996 / 22:25:22 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2043 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2044 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2045 |
deviceButtonPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2046 |
"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
|
2047 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2048 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2049 |
and send a buttonPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2050 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2051 |
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
|
2052 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2053 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2054 |
should redefine #buttonPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2056 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2057 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2058 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2060 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2061 |
currentTransformation notNil ifTrue:[ |
8259 | 2062 |
lx notNil ifTrue:[ |
2063 |
lx := currentTransformation applyInverseToX:lx. |
|
2064 |
ly := currentTransformation applyInverseToY:ly. |
|
2065 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2066 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2067 |
self buttonPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2068 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
"Modified: 20.5.1996 / 17:45:18 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2070 |
"Modified: 14.10.1996 / 22:25:30 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2071 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2072 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2073 |
deviceButtonRelease:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
"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
|
2075 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2076 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2077 |
and send a buttonRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2078 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2079 |
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
|
2080 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2081 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2082 |
should redefine #buttonRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2083 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2084 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2085 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2086 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2087 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2088 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2089 |
currentTransformation notNil ifTrue:[ |
8259 | 2090 |
lx notNil ifTrue:[ |
2091 |
lx := currentTransformation applyInverseToX:lx. |
|
2092 |
ly := currentTransformation applyInverseToY:ly. |
|
2093 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2094 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2095 |
self buttonRelease:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2096 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2097 |
"Modified: 20.5.1996 / 17:45:14 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2098 |
"Modified: 14.10.1996 / 22:25:37 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2099 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2100 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2101 |
deviceButtonShiftPress:butt x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2102 |
"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
|
2103 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2104 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2105 |
and send a buttonShiftPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2106 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2107 |
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
|
2108 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2109 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2110 |
should redefine #buttonShiftPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2111 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2112 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2113 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2114 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2115 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2116 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2117 |
currentTransformation notNil ifTrue:[ |
8259 | 2118 |
lx notNil ifTrue:[ |
2119 |
lx := currentTransformation applyInverseToX:lx. |
|
2120 |
ly := currentTransformation applyInverseToY:ly. |
|
2121 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2123 |
self buttonShiftPress:butt x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2125 |
"Modified: 20.5.1996 / 17:45:09 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2126 |
"Modified: 14.10.1996 / 22:25:49 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2127 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2128 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2129 |
deviceExposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2130 |
"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
|
2131 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2132 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
and send an expose with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2135 |
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
|
2136 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2137 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2138 |
should redefine #exposeX:x:y:width:height:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2140 |
|lx ly lw lh currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2141 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2142 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2143 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2144 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2145 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2146 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2147 |
currentTransformation notNil ifTrue:[ |
8259 | 2148 |
lx := currentTransformation applyInverseToX:lx. |
2149 |
ly := currentTransformation applyInverseToY:ly. |
|
2150 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2151 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
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 |
self exposeX:lx y:ly width:lw height:lh |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2154 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2155 |
"Modified: 13.5.1996 / 11:31:44 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2156 |
"Modified: 14.10.1996 / 22:26:00 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2157 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2158 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2159 |
deviceGraphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2160 |
"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
|
2161 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
If there is a transformation, apply the inverse |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2163 |
and send a graphicsExpose with the logical coordinates. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2164 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2165 |
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
|
2166 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2167 |
those which are interested in logical coordinates |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2168 |
should redefine #graphicsExposeX:x:y:width:height:" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2170 |
|lx ly lw lh currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2172 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2173 |
ly := y. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
lw := w. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
lh := h. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2176 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2177 |
currentTransformation notNil ifTrue:[ |
8259 | 2178 |
lx := currentTransformation applyInverseToX:lx. |
2179 |
ly := currentTransformation applyInverseToY:ly. |
|
2180 |
lw := currentTransformation applyInverseScaleX:lw. |
|
2181 |
lh := currentTransformation applyInverseScaleY:lh. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
]. |
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2183 |
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
|
2184 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2185 |
"Modified: 13.5.1996 / 11:31:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2186 |
"Modified: 14.10.1996 / 22:26:08 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2187 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2188 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2189 |
deviceKeyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
"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
|
2191 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2192 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2193 |
and send a keyPress with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2194 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2195 |
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
|
2196 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2197 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2198 |
should redefine #keyPress:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2199 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2200 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2201 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2202 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2204 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2205 |
currentTransformation notNil ifTrue:[ |
8259 | 2206 |
lx notNil ifTrue:[ |
2207 |
lx := currentTransformation applyInverseToX:lx. |
|
2208 |
ly := currentTransformation applyInverseToY:ly. |
|
2209 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2211 |
self keyPress:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
"Modified: 20.5.1996 / 17:44:59 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2214 |
"Modified: 14.10.1996 / 22:26:17 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2216 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2217 |
deviceKeyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2218 |
"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
|
2219 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2220 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2221 |
and send a keyRelease with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2223 |
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
|
2224 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2225 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
should redefine #keyRelease:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2227 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2228 |
|lx ly currentTransformation| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2229 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2230 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2232 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2233 |
currentTransformation notNil ifTrue:[ |
8259 | 2234 |
lx notNil ifTrue:[ |
2235 |
lx := currentTransformation applyInverseToX:lx. |
|
2236 |
ly := currentTransformation applyInverseToY:ly. |
|
2237 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
self keyRelease:key x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
"Modified: 20.5.1996 / 17:44:42 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2242 |
"Modified: 14.10.1996 / 22:26:28 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
devicePointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
"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
|
2247 |
from the device (i.e. coordinates are in device coordinates). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2248 |
If there is a transformation, apply the inverse |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2249 |
and send a pointerEnter with the logical coordinates. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
|
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2251 |
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
|
2252 |
redefine this method - |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2253 |
those which are interested in logical coordinates |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2254 |
should redefine #pointerEnter:x:y:" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2255 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2256 |
|lx ly currentTransformation| |
727
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 |
lx := x. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2259 |
ly := y. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2260 |
currentTransformation := gc transformation. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2261 |
currentTransformation notNil ifTrue:[ |
8259 | 2262 |
lx notNil ifTrue:[ |
2263 |
lx := currentTransformation applyInverseToX:lx. |
|
2264 |
ly := currentTransformation applyInverseToY:ly. |
|
2265 |
] |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2267 |
self pointerEnter:state x:lx y:ly |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2268 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2269 |
"Modified: 20.5.1996 / 17:44:54 / cg" |
1074
da107006d4f6
Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents:
1027
diff
changeset
|
2270 |
"Modified: 14.10.1996 / 22:26:35 / stefan" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2271 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2272 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2273 |
exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2274 |
"an expose event - nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2275 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2276 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2277 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2278 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2279 |
focusIn |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2280 |
"got keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2281 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2282 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2283 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2284 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2285 |
focusOut |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2286 |
"lost keyboard focus - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2287 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2288 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2289 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2290 |
|
1295
ef93ded3c030
renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents:
1253
diff
changeset
|
2291 |
graphicsExposeX:x y:y width:w height:h final:final |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
"an expose event after a scroll - do normal redraw processing" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2294 |
self exposeX:x y:y width:w height:h |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2295 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2296 |
|
5961 | 2297 |
hotkeyWithId:aId rawKey:aKey |
2298 |
"default action is to do nothing - may be reimplemented " |
|
2299 |
^ self |
|
2300 |
! |
|
2301 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2302 |
keyPress:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2303 |
"a key was pressed in this view. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2304 |
Here only keyCommands are handled - more action has to |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2305 |
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
|
2306 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2307 |
|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
|
2308 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2309 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2310 |
action := keyCommands at:key ifAbsent:[nil]. |
2311 |
action value |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2312 |
]. |
3514 | 2313 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2314 |
key isSymbol ifTrue:[ |
8259 | 2315 |
(key startsWith:'Basic') ifTrue:[ |
2316 |
"/ an unhandled BasicFoo key; |
|
2317 |
"/ retry as Foo |
|
2318 |
rest := key withoutPrefix:'Basic'. |
|
2319 |
restKey := rest asSymbolIfInterned. |
|
2320 |
restKey notNil ifTrue:[ |
|
2321 |
self keyPress:restKey x:x y:y |
|
2322 |
] |
|
2323 |
]. |
|
8843 | 2324 |
key == #Help ifTrue:[ |
2325 |
Error ignoreIn:[ |
|
2326 |
self application openDocumentation. |
|
2327 |
]. |
|
2328 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2329 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2330 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2331 |
"Modified: 6.11.1996 / 17:51:15 / cg" |
727
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 |
keyRelease:key x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2335 |
"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
|
2336 |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2337 |
key isSymbol ifTrue:[ |
8259 | 2338 |
(key startsWith:#Basic) ifTrue:[ |
2339 |
"/ an unhandled BasicFoo key; |
|
2340 |
"/ retry as Foo |
|
2341 |
||
2342 |
self keyRelease:(key copyFrom:#Basic size) asSymbol x:x y:y |
|
2343 |
]. |
|
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2344 |
]. |
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2345 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2346 |
^ self |
1105
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2347 |
|
76a76be62263
allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2348 |
"Modified: 6.11.1996 / 17:51:20 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2349 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2350 |
|
6828 | 2351 |
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime |
2352 |
"ignored" |
|
2353 |
||
2354 |
^ self |
|
2355 |
! |
|
2356 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2357 |
noExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2358 |
"a no expose event after a scroll (event-mode only)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2359 |
|
5006
c22106d6777a
gotExpose flag eliminated (to free an instVar slot)
Claus Gittinger <cg@exept.de>
parents:
4969
diff
changeset
|
2360 |
self setGotExposeFlag. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2361 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2362 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2363 |
pointerEnter:state x:x y:y |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2364 |
"mouse cursor entered view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2365 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2366 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2367 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2368 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2369 |
pointerLeave:state |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2370 |
"mouse cursor left view - do nothing here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2371 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2372 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2373 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2374 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2375 |
resizeRequest |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2376 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2377 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2378 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2379 |
waitForExpose |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2380 |
"wait until an expose event arrives (to wait for scroll-finish)" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2381 |
|
2421 | 2382 |
|wg endPollTime pollDelay| |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2383 |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2384 |
device scrollsAsynchronous ifFalse:[ |
6372 | 2385 |
self setGotExposeFlag. |
2386 |
^ self |
|
1027
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2387 |
]. |
0ba82862ca8d
fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
1012
diff
changeset
|
2388 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2389 |
wg := self windowGroup. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2390 |
wg notNil ifTrue:[ |
6372 | 2391 |
"/ |
2392 |
"/ a normal (suspendable) view. |
|
2393 |
"/ wait by doing a real wait |
|
2394 |
"/ |
|
2395 |
wg sensor waitForExposeFor:self |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2396 |
] ifFalse:[ |
6372 | 2397 |
"/ |
2398 |
"/ a pure event driven view. |
|
2399 |
"/ wait by doing a direct dispatch loop until the event arrives. |
|
2400 |
"/ i.e. poll for the event |
|
2401 |
"/ |
|
2402 |
device isWindowsPlatform ifTrue:[ |
|
7744 | 2403 |
pollDelay := 0.5. |
6372 | 2404 |
] ifFalse:[ |
7744 | 2405 |
pollDelay := 1. |
6372 | 2406 |
]. |
2407 |
endPollTime := Timestamp now addSeconds:pollDelay. |
|
2408 |
||
2409 |
[self gotExpose] whileFalse:[ |
|
2410 |
realized ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2411 |
(device exposeEventPendingFor:gc drawableId withSync:true) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2412 |
device dispatchExposeEventFor:gc drawableId. |
6372 | 2413 |
]. |
2414 |
]. |
|
2415 |
realized ifFalse:[ |
|
2416 |
self setGotExposeFlag. |
|
2417 |
^ self |
|
2418 |
]. |
|
2419 |
||
2420 |
"/ break out of the poll after a while |
|
2421 |
||
2422 |
Timestamp now > endPollTime ifTrue:[ |
|
2423 |
'DisplaySurface [warning]: lost expose event' errorPrintCR. |
|
2424 |
self setGotExposeFlag. |
|
2425 |
^ self |
|
2426 |
]. |
|
2427 |
Processor yield. |
|
2428 |
]. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2429 |
] |
1129
2a3eaf218500
destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
2430 |
|
2421 | 2431 |
"Modified: / 9.1.1999 / 01:58:09 / cg" |
727
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 |
|
8936 | 2434 |
!DisplaySurface methodsFor:'event simulation'! |
2435 |
||
2436 |
simulateButtonMotion:buttonMask to:aPoint sendDisplayEvent:sendDisplayEvent |
|
2437 |
"simulate a button motion by determining which sub-view is affected and |
|
2438 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2439 |
Returns the view which precessed the event or nil." |
|
2440 |
||
2441 |
|ev| |
|
2442 |
||
2443 |
ev := WindowEvent buttonMotion:buttonMask x:0 y:0 view:self. |
|
2444 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2445 |
^ self simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2446 |
! |
|
2447 |
||
2448 |
simulateButtonPress:button at:aPoint |
|
2449 |
"simulate a button press by determining which sub-view is affected and |
|
2450 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2451 |
Returns the view which precessed the event or nil." |
|
2452 |
||
2453 |
^ self simulateButtonPress:button at:aPoint sendDisplayEvent:false |
|
2454 |
||
2455 |
"Created: / 12-07-2011 / 14:36:02 / cg" |
|
2456 |
! |
|
2457 |
||
2458 |
simulateButtonPress:button at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2459 |
"simulate a button press by determining which sub-view is affected and |
|
2460 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2461 |
Returns the view which precessed the event or nil." |
|
2462 |
||
2463 |
|ev| |
|
2464 |
||
2465 |
ev := WindowEvent buttonPress:button x:0 y:0 view:self. |
|
2466 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2467 |
^ self simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2468 |
||
2469 |
"Created: / 12-07-2011 / 14:36:02 / cg" |
|
2470 |
"Modified (comment): / 19-07-2019 / 13:57:45 / Claus Gittinger" |
|
2471 |
! |
|
2472 |
||
2473 |
simulateButtonRelease:button at:aPoint |
|
2474 |
"simulate a button release by determining which sub-view is affected and |
|
2475 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2476 |
Returns the view which precessed the event or nil." |
|
2477 |
||
2478 |
^ self simulateButtonRelease:button at:aPoint sendDisplayEvent:false |
|
2479 |
||
2480 |
"Created: / 12-07-2011 / 14:54:37 / cg" |
|
2481 |
! |
|
2482 |
||
2483 |
simulateButtonRelease:button at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2484 |
"simulate a button release by determining which sub-view is affected and |
|
2485 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2486 |
Returns the view which precessed the event or nil." |
|
2487 |
||
2488 |
|ev| |
|
2489 |
||
2490 |
ev := WindowEvent buttonRelease:button x:0 y:0 view:self. |
|
2491 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2492 |
^ self simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2493 |
||
2494 |
"Created: / 12-07-2011 / 14:54:37 / cg" |
|
2495 |
"Modified (comment): / 19-07-2019 / 13:57:58 / Claus Gittinger" |
|
2496 |
! |
|
2497 |
||
2498 |
simulateKey:aKeySymbolOrCharacter at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:seconds |
|
2499 |
"simulate text input by generating alternating keyPress/keyRelease events." |
|
2500 |
||
2501 |
(aKeySymbolOrCharacter isCharacter |
|
2502 |
and:[ aKeySymbolOrCharacter isLetter |
|
2503 |
and:[ aKeySymbolOrCharacter isUppercase |
|
2504 |
]]) ifTrue:[ |
|
2505 |
self simulateKeyPress:#Shift at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2506 |
self simulateKeyPress:aKeySymbolOrCharacter asLowercase at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2507 |
Delay waitForSeconds:seconds. |
|
2508 |
self simulateKeyRelease:aKeySymbolOrCharacter asLowercase at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2509 |
self simulateKeyRelease:#Shift at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2510 |
] ifFalse:[ |
|
2511 |
self simulateKeyPress:aKeySymbolOrCharacter at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2512 |
Delay waitForSeconds:seconds. |
|
2513 |
self simulateKeyRelease:aKeySymbolOrCharacter at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2514 |
]. |
|
2515 |
||
2516 |
"Created: / 19-07-2019 / 14:40:52 / Claus Gittinger" |
|
2517 |
! |
|
2518 |
||
2519 |
simulateKeyPress:keyOrStringOrSymbol at:aPoint |
|
2520 |
"simulate a key press by determining which sub-view is affected and |
|
2521 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2522 |
Returns the view which processed the event or nil." |
|
2523 |
||
2524 |
^ self simulateKeyPress:keyOrStringOrSymbol at:aPoint sendDisplayEvent:false |
|
2525 |
! |
|
2526 |
||
2527 |
simulateKeyPress:keyOrStringOrSymbol at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2528 |
"simulate a key press by determining which sub-view is affected and |
|
2529 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2530 |
Returns the view which processed the event or nil." |
|
2531 |
||
2532 |
|sequence ev lastView| |
|
2533 |
||
2534 |
(keyOrStringOrSymbol isCharacter or:[keyOrStringOrSymbol isSymbol]) |
|
2535 |
ifTrue:[ sequence := Array with:keyOrStringOrSymbol ] |
|
2536 |
ifFalse:[ sequence := keyOrStringOrSymbol ]. |
|
2537 |
||
2538 |
sequence do:[:each | |
|
2539 |
ev := WindowEvent keyPress:each x:0 y:0 view:self. |
|
2540 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2541 |
lastView := self simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2542 |
]. |
|
2543 |
^ lastView |
|
2544 |
||
2545 |
"Modified (comment): / 19-07-2019 / 13:58:06 / Claus Gittinger" |
|
2546 |
! |
|
2547 |
||
2548 |
simulateKeyPressRelease:keyOrStringOrSymbol at:aPoint |
|
2549 |
"simulate a key release by determining which sub-view is affected and |
|
2550 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2551 |
Returns the view which processed the event or nil." |
|
2552 |
||
2553 |
^ self simulateKeyPressRelease:keyOrStringOrSymbol at:aPoint sendDisplayEvent:false |
|
2554 |
! |
|
2555 |
||
2556 |
simulateKeyPressRelease:keyOrStringOrSymbol at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2557 |
"simulate a key release by determining which sub-view is affected and |
|
2558 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2559 |
Returns the view which processed the event or nil." |
|
2560 |
||
2561 |
|sequence ev1 ev2 lastView| |
|
2562 |
||
2563 |
(keyOrStringOrSymbol isCharacter or:[keyOrStringOrSymbol isSymbol]) |
|
2564 |
ifTrue:[ sequence := Array with:keyOrStringOrSymbol ] |
|
2565 |
ifFalse:[ sequence := keyOrStringOrSymbol ]. |
|
2566 |
||
2567 |
sequence do:[:each | |
|
2568 |
ev1 := WindowEvent keyPress:each x:0 y:0 view:self. |
|
2569 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2570 |
lastView := self simulateUserEvent:ev1 at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2571 |
||
2572 |
ev2 := WindowEvent keyRelease:each x:0 y:0 view:self. |
|
2573 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2574 |
lastView := self simulateUserEvent:ev2 at:aPoint sendDisplayEvent:sendDisplayEvent. |
|
2575 |
]. |
|
2576 |
^ lastView |
|
2577 |
||
2578 |
"Modified (comment): / 19-07-2019 / 13:58:14 / Claus Gittinger" |
|
2579 |
! |
|
2580 |
||
2581 |
simulateKeyRelease:keyOrStringOrSymbol at:aPoint |
|
2582 |
"simulate a key release by determining which sub-view is affected and |
|
2583 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2584 |
Returns the view which processed the event or nil." |
|
2585 |
||
2586 |
^ self simulateKeyRelease:keyOrStringOrSymbol at:aPoint sendDisplayEvent:false |
|
2587 |
! |
|
2588 |
||
2589 |
simulateKeyRelease:keyOrStringOrSymbol at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2590 |
"simulate a key release by determining which sub-view is affected and |
|
2591 |
synthetically generating a keyPressEvent for whatever view is underneath. |
|
2592 |
Returns the view which processed the event or nil." |
|
2593 |
||
2594 |
|sequence ev lastView| |
|
2595 |
||
2596 |
(keyOrStringOrSymbol isCharacter or:[keyOrStringOrSymbol isSymbol]) |
|
2597 |
ifTrue:[ sequence := Array with:keyOrStringOrSymbol ] |
|
2598 |
ifFalse:[ sequence := keyOrStringOrSymbol ]. |
|
2599 |
||
2600 |
sequence do:[:each | |
|
2601 |
ev := WindowEvent keyRelease:each x:0 y:0 view:self. |
|
2602 |
"/ x/y will be set in simulateUserEvent:at:sendDisplayEvent: |
|
2603 |
lastView := self simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2604 |
]. |
|
2605 |
^ lastView |
|
2606 |
||
2607 |
"Modified (comment): / 19-07-2019 / 13:58:18 / Claus Gittinger" |
|
2608 |
! |
|
2609 |
||
2610 |
simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2611 |
"simulate text input by generating alternating keyPress/keyRelease events." |
|
2612 |
||
2613 |
self simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:0.05 |
|
2614 |
! |
|
2615 |
||
2616 |
simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:seconds |
|
2617 |
"simulate text input by generating alternating keyPress/keyRelease events." |
|
2618 |
||
2619 |
aString do:[:eachCharacter | |
|
2620 |
self simulateKey:eachCharacter at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:seconds |
|
2621 |
]. |
|
2622 |
||
2623 |
"Created: / 19-07-2019 / 14:40:52 / Claus Gittinger" |
|
2624 |
! |
|
2625 |
||
2626 |
simulateUserEvent:ev at:aPoint |
|
2627 |
"simulate a button press by determining which sub-view is affected and |
|
2628 |
synthetically generating a buttonPressEvent for whatever view is underneath. |
|
2629 |
Cares for any active grab - i.e. if some other view has grabbed the pointer or keyboard |
|
2630 |
the event is sent to the grabView with pointer coordinate translated as required |
|
2631 |
(typically these are popup views like menus) |
|
2632 |
Returns the view which precessed the event or nil." |
|
2633 |
||
2634 |
^ self simulateUserEvent:ev at:aPoint sendDisplayEvent:false |
|
2635 |
! |
|
2636 |
||
2637 |
simulateUserEvent:ev at:aPoint sendDisplayEvent:sendDisplayEvent |
|
2638 |
"simulate a button event by determining which sub-view is affected and |
|
2639 |
synthetically generating an event for whatever view is underneath. |
|
2640 |
||
2641 |
If sendDisplayEvent is true, a real physical event is generated via sendEvent, from the Display (xserver). |
|
2642 |
Otherwise, the event is pushed into the widget's event queue, without a roundtrip through the display. |
|
2643 |
||
2644 |
Otherwise, care for any active grab - i.e. if some other view has grabbed the pointer or keyboard |
|
2645 |
the event is sent to the grabView with pointer coordinate translated as required |
|
2646 |
(typically these are popup views like menus) |
|
2647 |
||
2648 |
Returns the view which processed the event or nil. |
|
2649 |
For displayEvent sending, always return the receiver, as we do not know how the grab processing came out at the end" |
|
2650 |
||
2651 |
|targetView pointXLated sensor evArg| |
|
2652 |
||
2653 |
sendDisplayEvent ifTrue:[ |
|
2654 |
"/ translate to screen coordinates |
|
2655 |
pointXLated := device translatePoint:aPoint from:(self id) to:(device rootWindowId). |
|
2656 |
"/ and send it via the display |
|
2657 |
ev isButtonPressEvent ifTrue:[ |
|
2658 |
evArg := #buttonPress |
|
2659 |
] ifFalse:[ ev isButtonReleaseEvent ifTrue:[ |
|
2660 |
evArg := #buttonRelease |
|
2661 |
] ifFalse:[ ev isKeyPressEvent ifTrue:[ |
|
2662 |
evArg := #keyPress |
|
2663 |
] ifFalse:[ ev isKeyReleaseEvent ifTrue:[ |
|
2664 |
evArg := #keyRelease |
|
2665 |
] ifFalse:[ |
|
2666 |
evArg := ev type |
|
2667 |
]]]]. |
|
2668 |
device |
|
2669 |
sendKeyOrButtonEvent:evArg |
|
2670 |
x:pointXLated x y:pointXLated y |
|
2671 |
keyOrButton:(ev isKeyEvent ifTrue:[ev rawKey] ifFalse:[ev button]) |
|
2672 |
state:(ev modifierFlags) |
|
2673 |
toViewId:self id. |
|
2674 |
^ self. |
|
2675 |
]. |
|
2676 |
||
2677 |
(ev isButtonEvent or:[ev isPointerEnterLeaveEvent]) ifTrue:[ |
|
2678 |
"/ if there is a pointer grab, the event has to be sent to that one |
|
2679 |
targetView := device activePointerGrab. |
|
2680 |
"/ Transcript showCR:'direct to %1' with:targetView. |
|
2681 |
] ifFalse:[ |
|
2682 |
(ev isKeyEvent) ifTrue:[ |
|
2683 |
"/ if there is a keyboard grab, the event has to be sent to that one |
|
2684 |
targetView := device activeKeyboardGrab. |
|
2685 |
"/ Transcript showCR:'direct to %1' with:targetView. |
|
2686 |
]. |
|
2687 |
]. |
|
2688 |
||
2689 |
targetView isNil ifTrue:[ |
|
2690 |
((0@0 extent:self extent) containsPoint:aPoint) ifTrue:[ |
|
2691 |
self subViews do:[:each | |
|
2692 |
|whichView| |
|
2693 |
||
2694 |
whichView := each simulateUserEvent:ev |
|
2695 |
at:(device translatePoint:aPoint fromView:self toView:each) |
|
2696 |
sendDisplayEvent:false. |
|
2697 |
whichView notNil ifTrue:[^ whichView]. |
|
2698 |
]. |
|
2699 |
targetView := self. |
|
2700 |
]. |
|
2701 |
]. |
|
2702 |
||
2703 |
targetView notNil ifTrue:[ |
|
2704 |
sensor := targetView sensor. |
|
2705 |
targetView == self ifTrue:[ |
|
2706 |
pointXLated := aPoint |
|
2707 |
] ifFalse:[ |
|
2708 |
pointXLated := device translatePoint:aPoint fromView:self toView:targetView. |
|
2709 |
]. |
|
2710 |
ev x:(pointXLated x). |
|
2711 |
ev y:(pointXLated y). |
|
2712 |
ev view:targetView. |
|
2713 |
||
2714 |
ev isButtonPressEvent ifTrue:[ |
|
2715 |
sensor buttonPress:ev button x:ev x y:ev y view:targetView. |
|
2716 |
] ifFalse:[ |
|
2717 |
ev isButtonReleaseEvent ifTrue:[ |
|
2718 |
sensor buttonRelease:ev button x:(ev x) y:(ev y) view:targetView. |
|
2719 |
] ifFalse:[ |
|
2720 |
sensor pushEvent:ev. |
|
2721 |
] |
|
2722 |
]. |
|
2723 |
^ targetView |
|
2724 |
]. |
|
2725 |
||
2726 |
^ nil |
|
2727 |
||
2728 |
"Created: / 12-07-2011 / 14:53:19 / cg" |
|
2729 |
"Modified (format): / 19-07-2019 / 14:08:26 / Claus Gittinger" |
|
2730 |
! ! |
|
2731 |
||
3884 | 2732 |
!DisplaySurface methodsFor:'initialization & release'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2733 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2734 |
destroy |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2735 |
"view is about to be destroyed - |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2736 |
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
|
2737 |
then the view is physically destroyed." |
4291 | 2738 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2739 |
self |
7448 | 2740 |
middleButtonMenu:nil; |
2741 |
keyCommands:nil. |
|
7449 | 2742 |
device notNil ifTrue:[ |
2743 |
device removeKnownView:self withId:nil. |
|
2744 |
]. |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2745 |
super destroy. |
2427
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2746 |
! |
d03456c66c8c
separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
2747 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2748 |
destroyed |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2749 |
"view has been destroyed by someone else" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2750 |
|
4435 | 2751 |
|id| |
2752 |
||
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2753 |
(id := self drawableId) notNil ifTrue:[ |
7444 | 2754 |
gc setId:nil. |
2755 |
self graphicsDevice removeKnownView:self withId:id. |
|
2756 |
realized := false. |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2757 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2758 |
self destroy |
1481 | 2759 |
|
2760 |
"Modified: 22.3.1997 / 14:56:34 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2761 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2762 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2763 |
initCursor |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2764 |
"default cursor for all views" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2765 |
|
2453 | 2766 |
cursor := Cursor normal |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2767 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2768 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2769 |
initStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2770 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2771 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2772 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2773 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2774 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2775 |
initialize |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2776 |
"initialize defaults" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2777 |
|
7844 | 2778 |
<modifier: #super> "must be called if redefined" |
2779 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2780 |
super initialize. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2781 |
|
4137 | 2782 |
eventMask := 0. |
2995 | 2783 |
device notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2784 |
eventMask := device defaultEventMask. |
2995 | 2785 |
]. |
7616 | 2786 |
gc notNil ifTrue:[ viewBackground := gc background]. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2787 |
backed := false. |
3152 | 2788 |
flags := 0. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2789 |
self initCursor |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2790 |
|
7844 | 2791 |
"Modified: / 08-02-2017 / 00:26:56 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2792 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2793 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2794 |
prepareForReinit |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2795 |
gc notNil ifTrue:[ |
8259 | 2796 |
gc prepareForReinit. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2797 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2798 |
! |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2799 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2800 |
reAdjustGeometry |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2801 |
"sent late during snapin processing, nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2802 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2803 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2804 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2805 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2806 |
recreate |
3300 | 2807 |
"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
|
2808 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2809 |
viewBackground isColor ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2810 |
viewBackground := viewBackground onDevice:device. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2811 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2812 |
super recreate. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2813 |
cursor notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2814 |
cursor := cursor onDevice:device. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2815 |
]. |
1252
fccb14086649
exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
2816 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
2817 |
"Modified: 28.3.1997 / 13:48:06 / cg" |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2818 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2819 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2820 |
reinitStyle |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2821 |
"nothing done here" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2822 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2823 |
^ self |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2824 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2825 |
|
3291 | 2826 |
releaseDeviceResources |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2827 |
super destroy. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2828 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2829 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2830 |
!DisplaySurface methodsFor:'keyboard commands'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2831 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2832 |
addActionForKey:aKey action:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2833 |
"define a keyboard command function" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2834 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2835 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2836 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2837 |
(keyCommands := self keyCommands) isNil ifTrue:[ |
8259 | 2838 |
self keyCommands:(keyCommands := IdentityDictionary new). |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2839 |
]. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2840 |
keyCommands at:aKey put:aBlock |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2841 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2842 |
|
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2843 |
keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2844 |
^ self getAttribute:#keyCommands |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2845 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2846 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2847 |
keyCommands:aDictionaryOrNil |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2848 |
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
|
2849 |
! |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2850 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2851 |
removeActionForKey:aKey |
5009
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2852 |
|keyCommands| |
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2853 |
|
27278b9816f7
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5006
diff
changeset
|
2854 |
(keyCommands := self keyCommands) notNil ifTrue:[ |
8259 | 2855 |
keyCommands removeKey:aKey ifAbsent:nil |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2856 |
] |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2857 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2858 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2859 |
!DisplaySurface methodsFor:'queries'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2860 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2861 |
buttonMotionEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2862 |
"return true, if a button motion event is pending. |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2863 |
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
|
2864 |
(not even for mouse-tracking). |
5935
6093fded5ed1
comment/format in: #buttonMotionEventPending
Claus Gittinger <cg@exept.de>
parents:
5923
diff
changeset
|
2865 |
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
|
2866 |
but goes directly to the device instead. |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2867 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2868 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2869 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2870 |
^ device eventPending:#buttonMotion for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2871 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2872 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2873 |
buttonReleaseEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2874 |
"return true, if a button release event is pending. |
7655 | 2875 |
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
|
2876 |
goes directly to the device instead. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2877 |
Actually, its a historical leftover" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2878 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2879 |
device flush. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2880 |
^ device eventPending:#buttonRelease for:gc drawableId |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2881 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2882 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2883 |
exposeEventPending |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2884 |
"return true, if an expose event is pending." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2885 |
|
4221
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2886 |
|windowGroup| |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2887 |
|
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2888 |
windowGroup := self windowGroup. |
666dea8f4aa7
Do not move messages to superclass (where they are sent)
Stefan Vogel <sv@exept.de>
parents:
4210
diff
changeset
|
2889 |
windowGroup notNil ifTrue:[ |
8259 | 2890 |
(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
|
2891 |
]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7410
diff
changeset
|
2892 |
^ device eventPending:#expose for:gc drawableId |
2352 | 2893 |
|
2894 |
"Modified: / 15.9.1998 / 23:18:16 / cg" |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2895 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2896 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2897 |
redrawsFull |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2898 |
^ false |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2899 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2900 |
"Created: 4.3.1996 / 14:17:22 / cg" |
3674 | 2901 |
! |
2902 |
||
2903 |
shown |
|
2904 |
"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
|
2905 |
(I am mapped and not completely covered). |
3674 | 2906 |
Assumed that I am always visible when realized." |
2907 |
||
2908 |
^ realized |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2909 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2910 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2911 |
!DisplaySurface methodsFor:'queries-contents'! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2912 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2913 |
heightOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2914 |
"return the height of the contents in pixels. |
7691 | 2915 |
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
|
2916 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2917 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2918 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2919 |
^ self height |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2920 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2921 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2922 |
widthOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2923 |
"return the width of the contents in pixels. |
7691 | 2924 |
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
|
2925 |
This will make your scrollbars show 100%-visible. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2926 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2927 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2928 |
^ self width |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2929 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2930 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2931 |
xOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2932 |
"return the x-origin of the contents in pixels. |
7655 | 2933 |
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
|
2934 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2935 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2936 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2937 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2938 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2939 |
yOriginOfContents |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2940 |
"return the y-origin of the contents in pixels. |
7655 | 2941 |
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
|
2942 |
Must be redefined in subviews to make scrollbars really work." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2943 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2944 |
^ 0 |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2945 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2946 |
|
7734 | 2947 |
!DisplaySurface methodsFor:'testing'! |
2948 |
||
2949 |
isDebugView |
|
2950 |
^ false |
|
2951 |
! |
|
2952 |
||
2953 |
isPopUpView |
|
2954 |
"return true, if this view should be put on top (raised) automatically. |
|
2955 |
usually this is true for alertBoxes etc." |
|
2956 |
||
2957 |
^ false |
|
2958 |
||
2959 |
"Created: / 22.1.1998 / 15:01:32 / stefan" |
|
2960 |
! |
|
2961 |
||
2962 |
isRootView |
|
2963 |
"return true, if the receiver is a root view |
|
2964 |
false is returned here, this is only redefined in DisplayRootView." |
|
2965 |
||
2966 |
^ false |
|
2967 |
||
2968 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2969 |
"Created: 5.7.1996 / 14:58:55 / cg" |
|
2970 |
! |
|
2971 |
||
2972 |
isTopView |
|
2973 |
"return true, if the receiver is some kind of topview; |
|
2974 |
false is returned here; redefined in some subclasses." |
|
2975 |
||
2976 |
^ false |
|
2977 |
||
2978 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2979 |
"Created: 22.3.1997 / 14:45:29 / cg" |
|
2980 |
! |
|
2981 |
||
2982 |
isView |
|
2983 |
"return true, if the receiver is some kind of view; |
|
2984 |
true is returned here." |
|
2985 |
||
2986 |
^ true |
|
2987 |
||
2988 |
"Modified: 28.5.1996 / 19:27:34 / cg" |
|
2989 |
! ! |
|
2990 |
||
3276 | 2991 |
!DisplaySurface methodsFor:'user interaction & notifications'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2992 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2993 |
beep |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2994 |
"output an audible beep or bell on my screen device" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2995 |
|
8257 | 2996 |
device beep |
2997 |
||
2998 |
"Created: 28.5.1996 / 16:16:13 / cg" |
|
2999 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
|
3000 |
! |
|
3001 |
||
3002 |
beepInEditor |
|
8259 | 3003 |
"output an audible beep or bell on my screen device, if enabled. |
3004 |
||
3005 |
Beep to wakeup the user after some error/not found condition in an editor. |
|
3006 |
Use this ONLY to beep in response to a bad user operation (not system failure beeps). |
|
3007 |
Can be disabled via the settings if too annoying" |
|
8257 | 3008 |
|
3009 |
device beepInEditor |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3010 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3011 |
"Created: 28.5.1996 / 16:16:13 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3012 |
"Modified: 28.5.1996 / 16:58:25 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3013 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3014 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3015 |
showActivity:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3016 |
"this is sent indirectly by the activityNotification mechanism. |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3017 |
Defined here as a fallback, if ever sent to non topviews." |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3018 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3019 |
Transcript showCR:aMessage |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3020 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3021 |
"Modified: 18.5.1996 / 15:44:33 / cg" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3022 |
! ! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3023 |
|
1093 | 3024 |
!DisplaySurface class methodsFor:'documentation'! |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3025 |
|
6710 | 3026 |
version |
6937 | 3027 |
^ '$Header$' |
6710 | 3028 |
! |
3029 |
||
5458 | 3030 |
version_CVS |
6937 | 3031 |
^ '$Header$' |
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3032 |
! ! |
3791 | 3033 |
|
6063 | 3034 |
|
3211 | 3035 |
DisplaySurface initialize! |