author | Claus Gittinger <cg@exept.de> |
Sat, 27 Jan 1996 16:35:09 +0100 | |
changeset 385 | 15fd1c806d2a |
parent 383 | a700611bb24b |
child 387 | aa80487842b8 |
permissions | -rw-r--r-- |
26 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 3 |
All Rights Reserved |
26 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
11 | 12 |
|
13 |
Object subclass:#WindowGroup |
|
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
14 |
instanceVariableNames:'views topViews myProcess mySensor isModal previousGroup focusView |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
15 |
focusSequence preEventHook postEventHook pointerView' |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
16 |
classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal' |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
17 |
poolDictionaries:'' |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
18 |
category:'Interface-Support' |
11 | 19 |
! |
20 |
||
46 | 21 |
!WindowGroup class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 26 |
All Rights Reserved |
46 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
103 | 39 |
In Smalltalk/X, the known (ST-80) concept of a controller has been |
297 | 40 |
extended (split) into a WindowGroup which handles process related stuff, |
41 |
and the Controller, which only handles events for a view and defines the user interaction. |
|
42 |
All interaction is via event queues - there is no polling in controllers (not even conceptionally). |
|
103 | 43 |
|
44 |
WindowGroups are responsible to wait for and forward events for a group of |
|
297 | 45 |
windows. All views in a windowGroup share a single windowSensor which holds the |
144 | 46 |
event queue (therefore views all share the same input event queue). |
47 |
||
297 | 48 |
The event queues are filled with incoming events as arriving from the physical display. |
49 |
This is done by a separate process (so called event-dispatcher) which runs at a higher |
|
50 |
priority. The event dispatcher determines the queue into which an event has to be placed |
|
51 |
by the view for which the event is destined (via the views sensor). |
|
52 |
There may be multiple event dispatchers running (to support multiple displays); |
|
53 |
see the documentation/examples in DeviceWorkstation/XWorkstation on how this is done. |
|
54 |
||
103 | 55 |
Except for modal boxes, a separate process is created for each windowGroup |
297 | 56 |
which waits for events to arrive and processes them, by sending corresponding |
144 | 57 |
event messages to the views controller or the view (*). |
297 | 58 |
The controller is determined by asking the view (for which the event is destined); |
59 |
if the returned controller is nil, the event is sent directly to the view. |
|
60 |
This allows for simple views to work without a controller. |
|
61 |
(all of this is actually done in a WindowEvent method) |
|
62 |
||
63 |
Therefore, multiple applications run pseudo parallel. |
|
64 |
Even if some window performs a long time computation, events are still received |
|
65 |
and entered into the corresponding event queues (because the event dispatcher process |
|
66 |
runs at a higher priority). However, the actual processing of the event is only |
|
67 |
possibly if no other process is busy at the same or a higher priority. |
|
68 |
It is possible to change a windowProcesses priority in order to give other windows |
|
69 |
a chance to execute (some views do this while performing longtime actions). |
|
70 |
||
103 | 71 |
Modal boxes create an extra window group for the components of the modal |
297 | 72 |
box, but execute the event-processing loop for this new group in the original process - |
144 | 73 |
therefore, the original windowgroup is blocked for the duration of the modal |
297 | 74 |
interaction. |
75 |
However, the modal-event processing loop peeks into the original groups event queue |
|
76 |
from time to time, and handles expose events. Thus, even while blocked for user input, |
|
77 |
the original group continues to get update/redraw events. |
|
103 | 78 |
|
79 |
Normally, one windowgroup is associated to each topview (StandardSystemView) |
|
144 | 80 |
and all of its subviews. However, this is not strictly required; |
81 |
it is possible to create extra windowgroups for subviews, which will let them |
|
82 |
run in parallel |
|
313 | 83 |
(for example, the FileBrowsers kill-Button is created that |
84 |
way, to allow a kill of an executing unix command, while the browser |
|
85 |
itself reads the pipeStream for incoming text. |
|
86 |
Even if the fileBrowser is busy reading the pipe, the killButton is still |
|
87 |
working and allows terminating the pipe-read action). |
|
144 | 88 |
|
89 |
On the other hand, multiple topviews can be placed into the same windowGroup; |
|
90 |
which allows for multiview applications, of which only one communicates with |
|
103 | 91 |
the user at a time. |
109 | 92 |
|
297 | 93 |
Multiple topviews within a windowGropup can be configured to behave like one |
94 |
unit with respect to iconification, deiconification and termination. |
|
95 |
This is done by creating multiple topViews in one group, and setting up a master/slave |
|
96 |
or partner relation among them (see TopView>>beSlave and TopView>>bePartner). |
|
103 | 97 |
|
109 | 98 |
WindowGroups also support a focus window: this is the one that gets the |
103 | 99 |
keyboard input - even if the cursor is located in another subview. |
297 | 100 |
(this is a brand new feature and not yet fully released for public use) |
103 | 101 |
|
102 |
Finally, windowgroups are the perfect place for things like defining a |
|
103 |
cursor for all associated views, flushing all input, waiting for expose |
|
104 |
events etc. |
|
105 |
||
297 | 106 |
Dont get confused: |
313 | 107 |
You dont have to care for details in the normal case, a windowgroup is |
108 |
created for you automatically, when a view is opened. |
|
109 |
All of the internals are not required to be known for most applications. |
|
297 | 110 |
|
103 | 111 |
|
112 |
instance variables: |
|
144 | 113 |
|
313 | 114 |
views collection of views of this group |
103 | 115 |
|
313 | 116 |
topViews collection of topviews of this group |
103 | 117 |
|
313 | 118 |
myProcess the process executing the events |
103 | 119 |
|
313 | 120 |
mySensor my input sensor |
103 | 121 |
|
313 | 122 |
isModal true if this is for a modal box |
103 | 123 |
|
313 | 124 |
previousGroup if modal, the group that started this one |
103 | 125 |
|
313 | 126 |
focusView the one that has the focus (or nil) |
103 | 127 |
|
313 | 128 |
focusSequence defines the focus sequence |
103 | 129 |
|
130 |
||
131 |
clas variables: |
|
313 | 132 |
LeaveSignal if raised, a modal box leaves (closes) |
103 | 133 |
|
134 |
||
144 | 135 |
(*) |
313 | 136 |
due to historic reasons, many views have the controller functionality |
137 |
integrated, and handle events themself. The windowSensor takes care |
|
138 |
of this, by checking if a view has a controller, and, if so, forwarding |
|
139 |
the events to it. Otherwise, events are sent directly to the view. |
|
144 | 140 |
|
313 | 141 |
In the future, all views will be rewritten to actually use a controller. |
142 |
Currently (being in the middle of this migration), only some views |
|
143 |
(buttons, toggles and subclasses) do so. |
|
144 | 144 |
|
103 | 145 |
|
302
b12e58238233
manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
146 |
|
b12e58238233
manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
147 |
|
b12e58238233
manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
148 |
|
b12e58238233
manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
149 |
|
103 | 150 |
For more information, read 'introduction to view programming' in the |
151 |
doc/online directory. |
|
46 | 152 |
" |
302
b12e58238233
manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
153 |
|
46 | 154 |
! ! |
155 |
||
54 | 156 |
!WindowGroup class methodsFor:'initialization'! |
46 | 157 |
|
158 |
initialize |
|
159 |
LeaveSignal isNil ifTrue:[ |
|
72 | 160 |
LeaveSignal := (Signal new) mayProceed:true. |
161 |
LeaveSignal nameClass:self message:#leaveSignal. |
|
162 |
LeaveSignal notifierString:'unhandled leave signal'. |
|
54 | 163 |
]. |
46 | 164 |
|
165 |
"WindowGroup initialize" |
|
166 |
! ! |
|
167 |
||
244 | 168 |
!WindowGroup class methodsFor:'instance creation'! |
169 |
||
170 |
new |
|
171 |
"create and return a new WindowGroup object" |
|
172 |
||
173 |
^ self basicNew initialize |
|
174 |
! ! |
|
175 |
||
144 | 176 |
!WindowGroup class methodsFor:'Signal constants'! |
72 | 177 |
|
178 |
leaveSignal |
|
109 | 179 |
"return the signal which is used to exit a modal loop. |
144 | 180 |
This private signal, is always cought while a modalbox is active. |
181 |
Raising it will exit the modal loop and return from the views #openModal |
|
182 |
method." |
|
109 | 183 |
|
72 | 184 |
^ LeaveSignal |
185 |
! ! |
|
186 |
||
26 | 187 |
!WindowGroup class methodsFor:'accessing'! |
188 |
||
189 |
activeGroup |
|
180 | 190 |
"return the currently active windowGroup. |
191 |
The returned value may not be fully correct, in case the current process |
|
192 |
handles multiple windowGroups simulaniously. In this case, |
|
193 |
the first group is returned (prefering a modal if there is one). |
|
194 |
(maybe we should return a collection of windowGroups here). |
|
195 |
||
196 |
This method is required to simulate the historic ST-80 single display |
|
197 |
behavior for Cursor>>show / Cursor>>showWhile and some others (raising the |
|
198 |
activeGroups topView when modalBoxes appear) on multiple display screens. |
|
199 |
These methods should change the cursor for the currently |
|
200 |
active windowGroup ONLY, instead of globally affecting the display or |
|
201 |
all views |
|
202 |
(since, depending on the priority, other views could be unaffacted by this |
|
203 |
and an overall cursor change does not make sense.)" |
|
204 |
||
205 |
|activeProcess groups wg| |
|
206 |
||
207 |
Processor isNil ifTrue:[^ nil]. "/ only during very early init phase |
|
26 | 208 |
|
180 | 209 |
activeProcess := Processor activeProcess. |
210 |
" caching the last value ..." |
|
211 |
activeProcess == LastActive ifTrue:[ |
|
212 |
LastActiveGroup process == LastActive ifTrue:[ |
|
213 |
^ LastActiveGroup |
|
214 |
] |
|
215 |
]. |
|
216 |
groups := self scheduledWindowGroups |
|
217 |
select:[:wg | wg process == activeProcess]. |
|
218 |
groups size == 1 ifTrue:[ |
|
219 |
wg := groups anElement |
|
220 |
] ifFalse:[ |
|
221 |
wg := groups detect:[:wg | wg isModal] ifNone:nil. |
|
222 |
wg isNil ifTrue:[ |
|
223 |
wg := groups anElement |
|
224 |
] |
|
225 |
]. |
|
226 |
wg notNil ifTrue:[ |
|
227 |
LastActiveProcess := activeProcess. |
|
228 |
LastActiveGroup := wg. |
|
229 |
]. |
|
230 |
^ wg |
|
231 |
||
232 |
" |
|
233 |
WindowGroup activeGroup |
|
234 |
" |
|
235 |
||
236 |
"Modified: 3.9.1995 / 14:49:53 / claus" |
|
54 | 237 |
! |
238 |
||
239 |
scheduledWindowGroups |
|
180 | 240 |
"return a collection of all windowGroups (possibly for different |
241 |
display devices) which are scheduled (i.e. which have a process |
|
242 |
running, handling events)." |
|
243 |
||
244 |
|set screens| |
|
245 |
||
246 |
screens := Screen allScreens. |
|
247 |
screens isNil ifTrue:[^ #()]. |
|
248 |
||
249 |
set := IdentitySet new. |
|
250 |
screens do:[:aDevice | |
|
251 |
aDevice allViewsDo:[:aView | |
|
252 |
|wg| |
|
109 | 253 |
|
180 | 254 |
(wg := aView windowGroup) notNil ifTrue:[ |
255 |
wg process notNil ifTrue:[ |
|
256 |
set add:wg |
|
257 |
] |
|
258 |
]. |
|
259 |
]. |
|
260 |
]. |
|
261 |
^ set asArray |
|
262 |
||
263 |
" |
|
264 |
WindowGroup scheduledWindowGroups |
|
265 |
" |
|
266 |
||
267 |
"Modified: 1.9.1995 / 13:43:09 / claus" |
|
244 | 268 |
! |
269 |
||
270 |
setActiveGroup:aGroup |
|
271 |
"set the currently active windowGroup. |
|
272 |
Temporary; do not use this interface, it will vanish." |
|
273 |
||
274 |
LastActiveProcess := Processor activeProcess. |
|
275 |
LastActiveGroup := aGroup |
|
26 | 276 |
! ! |
277 |
||
11 | 278 |
!WindowGroup methodsFor:'accessing'! |
279 |
||
244 | 280 |
addTopView:aView |
281 |
"add a topview to the group" |
|
26 | 282 |
|
244 | 283 |
topViews isNil ifTrue:[ |
284 |
topViews := OrderedCollection new. |
|
285 |
]. |
|
286 |
topViews add:aView |
|
26 | 287 |
! |
288 |
||
11 | 289 |
addView:aView |
26 | 290 |
"add aView to the windowGroup" |
291 |
||
11 | 292 |
views isNil ifTrue:[ |
72 | 293 |
views := OrderedCollection new. |
11 | 294 |
]. |
295 |
views add:aView |
|
296 |
! |
|
297 |
||
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
298 |
device |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
299 |
"return the device, we receive our events from" |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
300 |
|
383 | 301 |
(topViews notNil and:[topViews isEmpty not]) ifTrue:[ |
302 |
^ topViews first device |
|
303 |
]. |
|
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
304 |
(views notNil and:[views isEmpty not]) ifTrue:[ |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
305 |
^ views first device |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
306 |
]. |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
307 |
^ nil |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
308 |
|
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
309 |
"Created: 13.12.1995 / 14:00:45 / stefan" |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
310 |
"Modified: 13.12.1995 / 14:18:11 / stefan" |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
311 |
! |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
312 |
|
244 | 313 |
isModal |
314 |
"return true, if I am in a modal mode" |
|
315 |
||
316 |
^ isModal |
|
317 |
! |
|
318 |
||
319 |
mainGroup |
|
320 |
"return the main windowgroup |
|
321 |
(that is the top one, which is not modal). |
|
322 |
There is one exception to this: the debugger (which is sort of modal) |
|
323 |
returns itself as mainGroup (not its debuggee)." |
|
324 |
||
325 |
|g prev| |
|
326 |
||
327 |
g := self. |
|
328 |
[g notNil and:[g isModal and:[(prev := g previousGroup) notNil]]] whileTrue:[ |
|
329 |
g := prev |
|
330 |
]. |
|
331 |
^ g |
|
332 |
||
333 |
"Modified: 3.9.1995 / 14:57:20 / claus" |
|
334 |
! |
|
54 | 335 |
|
244 | 336 |
postEventHook:anObject |
337 |
"set the postEventHook - this one will get all events |
|
338 |
passed after being processed here (via #processEvent:)." |
|
339 |
||
340 |
postEventHook := anObject |
|
341 |
! |
|
342 |
||
343 |
preEventHook:anObject |
|
344 |
"set the preEventHook - this one will get all events |
|
345 |
passed before being processed here (via #processEvent:). |
|
346 |
If this returns true, the event is supposed to be already |
|
347 |
processed and ignored here. |
|
348 |
Otherwise, it is processed as usual." |
|
349 |
||
350 |
preEventHook := anObject |
|
351 |
! |
|
352 |
||
353 |
previousGroup |
|
354 |
"return the windowgroup that started this group. |
|
355 |
(for modal groups only)" |
|
356 |
||
357 |
^ previousGroup |
|
358 |
! |
|
359 |
||
360 |
process |
|
361 |
"return the windowGroups process" |
|
362 |
||
363 |
^ myProcess |
|
54 | 364 |
! |
365 |
||
26 | 366 |
removeView:aView |
367 |
"remove aView from the windowGroup; |
|
368 |
if this was the last view in this group, |
|
81 | 369 |
also shut down the corresponding process |
370 |
(actually, only wake it up here - it will terminate itself |
|
371 |
when finding out that all views are gone)" |
|
11 | 372 |
|
263 | 373 |
|sema| |
374 |
||
11 | 375 |
views notNil ifTrue:[ |
72 | 376 |
views remove:aView ifAbsent:[]. |
377 |
views isEmpty ifTrue:[ |
|
378 |
views := nil |
|
379 |
] |
|
11 | 380 |
]. |
381 |
topViews notNil ifTrue:[ |
|
72 | 382 |
topViews remove:aView ifAbsent:[]. |
383 |
topViews isEmpty ifTrue:[ |
|
384 |
topViews := nil |
|
385 |
] |
|
11 | 386 |
]. |
54 | 387 |
" |
388 |
wakeup my process to look if last view has been |
|
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
389 |
removed (modalBoxes terminate their modalLoop if so) |
54 | 390 |
" |
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
391 |
mySensor notNil ifTrue:[ |
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
392 |
(sema := mySensor eventSemaphore) notNil ifTrue:[ |
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
393 |
sema signal |
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
394 |
] |
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
395 |
] |
11 | 396 |
! |
397 |
||
244 | 398 |
sensor |
399 |
"return the windowGroups sensor" |
|
103 | 400 |
|
244 | 401 |
^ mySensor |
54 | 402 |
! |
403 |
||
11 | 404 |
sensor:aSensor |
26 | 405 |
"set the windowGroups sensor" |
406 |
||
11 | 407 |
mySensor := aSensor |
172 | 408 |
! |
409 |
||
244 | 410 |
topViews |
411 |
"return the topviews accociated to this windowGroup" |
|
172 | 412 |
|
244 | 413 |
^ topViews |
172 | 414 |
! |
415 |
||
244 | 416 |
views |
417 |
"return the views accociated to this windowGroup" |
|
172 | 418 |
|
244 | 419 |
^ views |
54 | 420 |
! ! |
421 |
||
244 | 422 |
!WindowGroup methodsFor:'activation / deactivation'! |
423 |
||
424 |
closeDownViews |
|
425 |
"destroy all views associated to this window group" |
|
426 |
||
427 |
topViews notNil ifTrue:[ |
|
428 |
topViews do:[:aTopView | aTopView destroy] |
|
429 |
]. |
|
430 |
views := nil. |
|
431 |
topViews := nil. |
|
432 |
mySensor := nil. |
|
433 |
! |
|
434 |
||
435 |
realizeTopViews:isRestart |
|
436 |
"realize all topViews associated to this windowGroup. |
|
437 |
If this is a restart, tell topViews about it." |
|
438 |
||
439 |
topViews notNil ifTrue:[ |
|
440 |
topViews do:[:aView | |
|
441 |
aView realize. |
|
442 |
isRestart ifTrue:[ |
|
443 |
aView restarted |
|
444 |
] |
|
445 |
]. |
|
446 |
]. |
|
447 |
! |
|
180 | 448 |
|
244 | 449 |
restart |
450 |
"restart after a snapin." |
|
180 | 451 |
|
244 | 452 |
topViews notNil ifTrue:[ |
453 |
" |
|
454 |
need a new semaphore, since obsolete processes |
|
455 |
(from our previous live) may still sit on the current semaphore |
|
456 |
" |
|
457 |
mySensor eventSemaphore:Semaphore new. |
|
458 |
isModal ifFalse:[ |
|
459 |
self startup:true |
|
460 |
] |
|
461 |
] |
|
462 |
! |
|
180 | 463 |
|
244 | 464 |
shutdown |
465 |
"shutdow the window group; close all views and |
|
466 |
terminate process" |
|
467 |
||
468 |
|p| |
|
469 |
||
470 |
self closeDownViews. |
|
471 |
myProcess notNil ifTrue:[ |
|
472 |
p := myProcess. |
|
473 |
myProcess := nil. |
|
474 |
p terminate. |
|
475 |
] |
|
180 | 476 |
! |
477 |
||
244 | 478 |
startup:isRestart |
479 |
"startup the window-group; |
|
480 |
this creates a new window group process, which |
|
481 |
does the event processing." |
|
482 |
||
483 |
|top nm dev devNm| |
|
484 |
||
485 |
previousGroup := nil. |
|
486 |
myProcess isNil ifTrue:[ |
|
487 |
isModal := false. |
|
488 |
myProcess := [ |
|
489 |
self realizeTopViews:isRestart. |
|
490 |
self eventLoopWhile:[true] onLeave:[] |
|
491 |
] forkAt:Processor userSchedulingPriority. |
|
180 | 492 |
|
244 | 493 |
(topViews notNil and:[topViews isEmpty not]) ifTrue:[ |
494 |
" |
|
495 |
give the handler process a user friendly name |
|
496 |
" |
|
497 |
top := topViews first. |
|
498 |
nm := top processName. |
|
499 |
(dev := top device) notNil ifTrue:[ |
|
500 |
devNm := dev displayName. |
|
501 |
(devNm notNil and:[devNm ~= Display displayName]) ifTrue:[ |
|
502 |
nm := nm , ' (' , devNm , ')' |
|
503 |
] |
|
504 |
] |
|
505 |
] ifFalse:[ |
|
506 |
nm := 'window handler'. |
|
507 |
]. |
|
508 |
myProcess name:nm. |
|
180 | 509 |
|
313 | 510 |
" |
511 |
when the process gets suspended, there maybe still buffered draw requests. |
|
512 |
Flush them. |
|
513 |
" |
|
514 |
myProcess suspendAction:[ |
|
515 |
|dev| |
|
318 | 516 |
dev := self device. |
313 | 517 |
dev notNil ifTrue:[dev flush]. |
518 |
]. |
|
519 |
||
244 | 520 |
"when the process dies, we have to close-down |
521 |
the views as well |
|
522 |
" |
|
523 |
myProcess exitAction:[self closeDownViews] |
|
524 |
] |
|
313 | 525 |
|
526 |
"Modified: 13.12.1995 / 14:04:53 / stefan" |
|
180 | 527 |
! |
528 |
||
244 | 529 |
startupModal:checkBlock |
301
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
530 |
"startup the window-group in a modal loop |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
531 |
(i.e. under the currently running process); |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
532 |
checkBlock is evaluated and the modal loop is left, whenever false is returned." |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
533 |
|
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
534 |
^ self startupModal:checkBlock forGroup:WindowGroup activeGroup. |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
535 |
|
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
536 |
"Created: 10.12.1995 / 14:15:11 / cg" |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
537 |
! |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
538 |
|
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
539 |
startupModal:checkBlock forGroup:mainGroup |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
540 |
"startup the window-group in a modal loop |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
541 |
(i.e. under the currently running process); |
244 | 542 |
checkBlock is evaluated and loop is left, when false is |
301
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
543 |
returned. |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
544 |
The mainGroup info is required to allow peeking into its |
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
545 |
event queue in order for its expose/redraws to be handled." |
244 | 546 |
|
547 |
"set previousGroup to the main (non-modal) group" |
|
180 | 548 |
|
301
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
549 |
previousGroup := mainGroup. |
244 | 550 |
isModal := true. |
551 |
self realizeTopViews:false. |
|
552 |
self |
|
313 | 553 |
eventLoopWhile:checkBlock |
554 |
onLeave:[ |
|
555 |
" |
|
556 |
cleanup, in case of a terminate |
|
557 |
" |
|
558 |
previousGroup := nil. |
|
559 |
topViews := nil. |
|
560 |
views := nil. |
|
561 |
" |
|
562 |
the following is rubbish; |
|
563 |
the views could be reused .. |
|
564 |
" |
|
244 | 565 |
" |
313 | 566 |
topViews notNil ifTrue:[ |
567 |
topViews do:[:aView | |
|
568 |
aView destroy |
|
569 |
]. |
|
570 |
topViews := nil. |
|
571 |
]. |
|
572 |
views notNil ifTrue:[ |
|
573 |
views do:[:aView | |
|
574 |
aView destroy |
|
575 |
]. |
|
576 |
views := nil. |
|
577 |
]. |
|
244 | 578 |
" |
313 | 579 |
] |
301
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
580 |
|
b57451fd8560
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
297
diff
changeset
|
581 |
"Created: 10.12.1995 / 14:14:26 / cg" |
180 | 582 |
! ! |
583 |
||
90 | 584 |
!WindowGroup methodsFor:'enumerating'! |
54 | 585 |
|
586 |
allTopViewsExcept:aView do:aBlock |
|
157 | 587 |
"evaluate aBlock for all topviews except aView in this group. |
588 |
This works on a copy of the view collection, to allow for |
|
158 | 589 |
destroy and other collection changing operations to be done." |
157 | 590 |
|
591 |
topViews notNil ifTrue:[ |
|
592 |
topViews copy do:[:v | |
|
593 |
v ~~ aView ifTrue:[aBlock value:v] |
|
594 |
] |
|
595 |
]. |
|
596 |
! |
|
597 |
||
244 | 598 |
allViewsDo:aBlock |
599 |
"evaluate aBlock for all views & topviews in this group. |
|
600 |
This works on a copy of the view collection, to allow for |
|
601 |
destroy and other collection changing operations to be done." |
|
602 |
||
603 |
topViews notNil ifTrue:[topViews copy do:aBlock]. |
|
604 |
views notNil ifTrue:[views copy do:aBlock] |
|
605 |
! |
|
606 |
||
607 |
partnersDo:aBlock |
|
608 |
"evaluate aBlock for all partnerViews. |
|
609 |
This works on a copy of the view collection, to allow for |
|
610 |
destroy and other collection changing operations to be done." |
|
611 |
||
612 |
topViews notNil ifTrue:[ |
|
613 |
topViews copy do:[:v | |
|
614 |
v notNil ifTrue:[ |
|
615 |
v type == #partner ifTrue:[aBlock value:v]. |
|
616 |
] |
|
617 |
] |
|
618 |
]. |
|
619 |
! |
|
620 |
||
157 | 621 |
slavesDo:aBlock |
622 |
"evaluate aBlock for all slaveViews. |
|
623 |
This works on a copy of the view collection, to allow for |
|
158 | 624 |
destroy and other collection changing operations to be done." |
54 | 625 |
|
626 |
topViews notNil ifTrue:[ |
|
157 | 627 |
topViews copy do:[:v | |
628 |
v notNil ifTrue:[ |
|
629 |
v type == #slave ifTrue:[aBlock value:v]. |
|
630 |
] |
|
631 |
] |
|
632 |
]. |
|
11 | 633 |
! ! |
634 |
||
19 | 635 |
!WindowGroup methodsFor:'event handling'! |
11 | 636 |
|
244 | 637 |
eventLoop |
638 |
"loop executed by windowGroup process; |
|
639 |
wait-for and process events forever" |
|
640 |
||
641 |
self eventLoopWhile:[true] onLeave:[] |
|
642 |
! |
|
643 |
||
644 |
eventLoopWhile:aBlock onLeave:cleanupActions |
|
645 |
"wait-for and process events. |
|
646 |
Stay in this loop while there are still any views to dispatch for, |
|
647 |
and aBlock evaluates to true." |
|
648 |
||
649 |
|thisProcess| |
|
650 |
||
651 |
thisProcess := Processor activeProcess. |
|
652 |
||
653 |
[ |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
654 |
"/ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
655 |
"/ on leave, exit the event loop |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
656 |
"/ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
657 |
LeaveSignal handle:[:ex | |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
658 |
ex return |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
659 |
] do:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
660 |
|p g mainGroup mySema waitSema| |
325
b24d9a1c74dc
stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents:
324
diff
changeset
|
661 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
662 |
waitSema := mySema := mySensor eventSemaphore. |
244 | 663 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
664 |
isModal ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
665 |
mainGroup := self mainGroup. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
666 |
mainGroup == self ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
667 |
mainGroup := nil |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
668 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
669 |
mainGroup notNil ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
670 |
waitSema := SemaphoreSet with:mySema |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
671 |
with:(mainGroup sensor eventSemaphore). |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
672 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
673 |
]. |
244 | 674 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
675 |
aBlock whileTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
676 |
LastActiveGroup := self. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
677 |
LastActiveProcess := thisProcess. |
244 | 678 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
679 |
(views isNil and:[topViews isNil]) ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
680 |
myProcess notNil ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
681 |
p := myProcess. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
682 |
myProcess := nil. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
683 |
p terminate. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
684 |
"not reached - there is no life after death" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
685 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
686 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
687 |
this is the end of a modal loop |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
688 |
(not having a private process ...) |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
689 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
690 |
^ self |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
691 |
]. |
323
619085d52522
be careful - device may be nil
Claus Gittinger <cg@exept.de>
parents:
319
diff
changeset
|
692 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
693 |
"/ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
694 |
"/ on abort, stay in the event loop |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
695 |
"/ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
696 |
AbortSignal handle:[:ex | |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
697 |
ex return |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
698 |
] do:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
699 |
ActivityNotificationSignal handle:[:ex | |
375
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
700 |
"/ |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
701 |
"/ if I am a modal-group, let it be handled |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
702 |
"/ by the outer main-groups handler |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
703 |
"/ |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
704 |
isModal ifTrue:[ |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
705 |
ex reject |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
706 |
"never reached" |
44d1d4006cdd
modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents:
357
diff
changeset
|
707 |
]. |
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
708 |
self showActivity:(ex errorString). |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
709 |
ex proceed. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
710 |
] do:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
711 |
|dev gotSema| |
328 | 712 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
713 |
"/ no more events. Flush device output. This may produce more events. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
714 |
dev := self device. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
715 |
dev notNil ifTrue:[dev flush]. |
313 | 716 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
717 |
thisProcess setStateTo:#eventWait if:#active. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
718 |
gotSema := waitSema wait. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
719 |
LastActiveGroup := self. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
720 |
LastActiveProcess := thisProcess. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
721 |
gotSema == mySema ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
722 |
self processEvents |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
723 |
] ifFalse:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
724 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
725 |
if modal, also check for redraw events in my maingroup |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
726 |
(we arrive here after we woke up on maingroup sensor eventSemaphore) |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
727 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
728 |
mainGroup processExposeEvents |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
729 |
] |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
730 |
] |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
731 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
732 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
733 |
]. |
244 | 734 |
] valueNowOrOnUnwindDo:[ |
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
735 |
cleanupActions notNil ifTrue:[cleanupActions value] |
244 | 736 |
] |
313 | 737 |
|
325
b24d9a1c74dc
stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents:
324
diff
changeset
|
738 |
"Modified: 14.12.1995 / 11:12:24 / stefan" |
328 | 739 |
"Modified: 16.12.1995 / 18:39:03 / cg" |
244 | 740 |
! |
741 |
||
742 |
leaveEventLoop |
|
743 |
"immediately leave the event loop, returning way back. |
|
744 |
This can be used to leave (and closedown) a modal group. |
|
745 |
(for normal views, this does not make sense)" |
|
746 |
||
747 |
^ LeaveSignal raise |
|
748 |
! |
|
749 |
||
103 | 750 |
processEvents |
751 |
"process events from either the damage- or user input queues. |
|
752 |
Abort is assumed to be handled elsewhere." |
|
19 | 753 |
|
90 | 754 |
|event ignore| |
11 | 755 |
|
72 | 756 |
self processExposeEvents. |
180 | 757 |
|
72 | 758 |
[mySensor hasEvents] whileTrue:[ |
383 | 759 |
event := mySensor nextEvent. |
760 |
event notNil ifTrue:[ |
|
761 |
(views notNil or:[topViews notNil]) ifTrue:[ |
|
762 |
ignore := false. |
|
172 | 763 |
|
383 | 764 |
(preEventHook notNil |
765 |
and:[preEventHook processEvent:event]) ifTrue:[ |
|
766 |
ignore := true. |
|
767 |
]. |
|
768 |
ignore ifFalse:[ |
|
769 |
"/ |
|
770 |
"/ FocusStepping is done right here |
|
771 |
"/ |
|
772 |
event isKeyPressEvent ifTrue:[ |
|
773 |
event key == #FocusNext ifTrue:[ |
|
774 |
self focusNext. |
|
775 |
ignore := true |
|
776 |
]. |
|
777 |
event key == #FocusPrevious ifTrue:[ |
|
778 |
self focusPrevious. |
|
779 |
ignore := true |
|
780 |
]. |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
781 |
event key == #Tab ifTrue:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
782 |
focusView notNil ifTrue:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
783 |
focusView canTab ifTrue:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
784 |
self focusNext. |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
785 |
ignore := true |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
786 |
] |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
787 |
] ifFalse:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
788 |
pointerView notNil ifTrue:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
789 |
pointerView canTab ifTrue:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
790 |
self focusNext. |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
791 |
ignore := true. |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
792 |
] |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
793 |
] ifFalse:[ |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
794 |
self focusNext. |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
795 |
ignore := true. |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
796 |
] |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
797 |
] |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
798 |
]. |
383 | 799 |
]. |
800 |
event isPointerEnterEvent ifTrue:[ |
|
801 |
pointerView := event view |
|
802 |
]. |
|
803 |
event isPointerLeaveEvent ifTrue:[ |
|
804 |
pointerView := nil |
|
805 |
]. |
|
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
806 |
|
383 | 807 |
ignore ifFalse:[ |
808 |
"/ |
|
809 |
"/ button events turn off explicit focus, and revert |
|
810 |
"/ to implicit focus control |
|
811 |
"/ |
|
812 |
(focusView notNil |
|
813 |
and:[event isButtonEvent]) ifTrue:[ |
|
814 |
self focusView:nil |
|
815 |
]. |
|
816 |
"/ |
|
817 |
"/ let the event forward itself |
|
818 |
"/ |
|
819 |
LastActiveGroup := self. |
|
820 |
LastActiveProcess := Processor activeProcess. |
|
821 |
event sendEventWithFocusOn:focusView. |
|
822 |
] |
|
823 |
]. |
|
824 |
postEventHook notNil ifTrue:[ |
|
825 |
postEventHook processEvent:event |
|
826 |
] |
|
827 |
] |
|
828 |
]. |
|
72 | 829 |
] |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
830 |
|
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
831 |
"Modified: 9.1.1996 / 15:52:30 / cg" |
48 | 832 |
! |
833 |
||
834 |
processExposeEvents |
|
103 | 835 |
"process only expose events from the damage queue" |
48 | 836 |
|
180 | 837 |
|event view rect x y w h sensor thisProcess| |
109 | 838 |
|
839 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
|
48 | 840 |
|
180 | 841 |
thisProcess := Processor activeProcess. |
842 |
||
843 |
[sensor hasDamage] whileTrue:[ |
|
844 |
LastActiveGroup := self. |
|
845 |
LastActiveProcess := thisProcess. |
|
846 |
||
847 |
event := sensor nextDamage. |
|
848 |
event notNil ifTrue:[ |
|
849 |
(views notNil or:[topViews notNil]) ifTrue:[ |
|
850 |
(preEventHook notNil |
|
851 |
and:[preEventHook processEvent:event]) ifFalse:[ |
|
852 |
event isDamage ifTrue:[ |
|
853 |
view := event view. |
|
854 |
"/ |
|
855 |
"/ if the view is no longer shown (iconified or closed), |
|
856 |
"/ this is a leftover event and ignored. |
|
857 |
"/ |
|
858 |
view shown ifTrue:[ |
|
859 |
rect := event rectangle. |
|
860 |
x := rect left. |
|
861 |
y := rect top. |
|
862 |
w := rect width. |
|
863 |
h := rect height. |
|
864 |
LastActiveGroup := self. |
|
865 |
LastActiveProcess := thisProcess. |
|
866 |
view transformation notNil ifTrue:[ |
|
867 |
view deviceExposeX:x y:y width:w height:h |
|
868 |
] ifFalse:[ |
|
869 |
view exposeX:x y:y width:w height:h |
|
172 | 870 |
] |
81 | 871 |
] |
180 | 872 |
] ifFalse:[ |
873 |
" |
|
874 |
mhmh - could we possibly arrive here ? |
|
875 |
" |
|
876 |
LastActiveGroup := self. |
|
877 |
LastActiveProcess := thisProcess. |
|
878 |
event sendEvent. |
|
78 | 879 |
] |
180 | 880 |
]. |
881 |
postEventHook notNil ifTrue:[ |
|
882 |
postEventHook processEvent:event |
|
72 | 883 |
] |
884 |
] |
|
885 |
] |
|
90 | 886 |
] |
11 | 887 |
! |
888 |
||
28 | 889 |
waitForExposeFor:aView |
890 |
"wait for a noExpose on aView, then process all exposes. |
|
891 |
To be used after a scroll" |
|
892 |
||
893 |
mySensor waitForExposeFor:aView. |
|
90 | 894 |
AbortSignal catch:[ |
895 |
self processExposeEvents |
|
896 |
] |
|
11 | 897 |
! ! |
19 | 898 |
|
90 | 899 |
!WindowGroup methodsFor:'focus control'! |
900 |
||
244 | 901 |
focusNext |
902 |
"give focus to next view in focusSequence" |
|
903 |
||
904 |
|index| |
|
905 |
||
906 |
focusSequence size == 0 ifTrue:[^ self]. |
|
907 |
focusView notNil ifTrue:[ |
|
908 |
index := (focusSequence indexOf:focusView) + 1. |
|
909 |
index > focusSequence size ifTrue:[index := 1]. |
|
910 |
] ifFalse:[ |
|
911 |
index := 1. |
|
912 |
]. |
|
913 |
self focusView:(focusSequence at:index) |
|
914 |
||
915 |
" |
|
916 |
|top v1 v2| |
|
917 |
||
918 |
top := StandardSystemView new. |
|
919 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
920 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
921 |
top open. |
|
922 |
top windowGroup focusSequence:(Array with:v1 with:v2). |
|
923 |
top windowGroup focusOn:v1. |
|
924 |
(Delay forSeconds:10) wait. |
|
925 |
top windowGroup focusNext. |
|
926 |
" |
|
927 |
! |
|
928 |
||
929 |
focusPrevious |
|
930 |
"give focus to previous view in focusSequence" |
|
931 |
||
932 |
|index| |
|
933 |
||
934 |
focusSequence size == 0 ifTrue:[^ self]. |
|
935 |
focusView notNil ifTrue:[ |
|
936 |
index := (focusSequence indexOf:focusView) - 1. |
|
937 |
index < 1 ifTrue:[index := focusSequence size]. |
|
938 |
] ifFalse:[ |
|
939 |
index := focusSequence size. |
|
940 |
]. |
|
941 |
self focusView:(focusSequence at:index) |
|
942 |
! |
|
943 |
||
135 | 944 |
focusSequence |
945 |
"return the focus sequence for focusNext/focusPrevious. |
|
946 |
Focus is stepped in the order in which subviews occur in |
|
947 |
the sequence" |
|
948 |
||
949 |
^ focusSequence |
|
950 |
! |
|
951 |
||
90 | 952 |
focusSequence:aSequenceableCollection |
953 |
"define the focus sequence for focusNext/focusPrevious. |
|
954 |
Focus is stepped in the order in which subviews occur in |
|
955 |
the sequence" |
|
956 |
||
957 |
focusSequence := aSequenceableCollection |
|
958 |
! |
|
959 |
||
960 |
focusView |
|
135 | 961 |
"return the view which currently has the focus" |
90 | 962 |
|
963 |
^ focusView |
|
964 |
! |
|
965 |
||
966 |
focusView:aViewOrNil |
|
967 |
"give focus to aViewOrNil" |
|
968 |
||
969 |
focusView notNil ifTrue:[ |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
970 |
focusView showNoFocus:true. "/ focusOut. |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
971 |
] ifFalse:[ |
383 | 972 |
pointerView notNil ifTrue:[ |
973 |
pointerView ~~ aViewOrNil ifTrue:[ |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
974 |
pointerView showNoFocus:false "/ focusOut |
383 | 975 |
] |
976 |
]. |
|
90 | 977 |
]. |
978 |
focusView := aViewOrNil. |
|
979 |
focusView notNil ifTrue:[ |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
980 |
focusView showFocus:true. "/ focusIn |
90 | 981 |
]. |
982 |
||
983 |
" |
|
984 |
|top v1 v2| |
|
985 |
||
986 |
top := StandardSystemView new. |
|
987 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
988 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
989 |
top open. |
|
990 |
top windowGroup focusView:v1. |
|
991 |
" |
|
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
992 |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
993 |
"Modified: 27.1.1996 / 13:11:16 / cg" |
244 | 994 |
! ! |
995 |
||
996 |
!WindowGroup methodsFor:'initialization'! |
|
997 |
||
998 |
initialize |
|
999 |
"setup the windowgroup, by creating a new sensor |
|
1000 |
and an event semaphore" |
|
1001 |
||
1002 |
mySensor := WindowSensor new. |
|
1003 |
mySensor eventSemaphore:Semaphore new. |
|
1004 |
isModal := false. |
|
90 | 1005 |
! |
1006 |
||
244 | 1007 |
reinitialize |
1008 |
"reinitialize the windowgroup after an image restart" |
|
90 | 1009 |
|
244 | 1010 |
"throw away old (zombie) process" |
1011 |
myProcess notNil ifTrue:[ |
|
1012 |
"careful: the old processes exitaction must be cleared |
|
1013 |
otherwise, it might do destroy or other actions when it |
|
1014 |
gets finalized ... |
|
1015 |
" |
|
1016 |
myProcess exitAction:nil. |
|
313 | 1017 |
myProcess suspendAction:nil. |
244 | 1018 |
myProcess := nil. |
1019 |
]. |
|
90 | 1020 |
|
244 | 1021 |
"throw away old events" |
1022 |
mySensor reinitialize |
|
313 | 1023 |
|
1024 |
"Modified: 13.12.1995 / 13:45:35 / stefan" |
|
90 | 1025 |
! ! |
1026 |
||
19 | 1027 |
!WindowGroup methodsFor:'printing'! |
1028 |
||
90 | 1029 |
printOn:aStream |
19 | 1030 |
"return a printed representation; |
144 | 1031 |
just for more user friendlyness: add name of process." |
19 | 1032 |
|
90 | 1033 |
myProcess isNil ifTrue:[ |
1034 |
(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[ |
|
1035 |
aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')'). |
|
1036 |
^ self. |
|
1037 |
]. |
|
1038 |
^ super printOn:aStream |
|
1039 |
]. |
|
1040 |
aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')') |
|
19 | 1041 |
! ! |
244 | 1042 |
|
1043 |
!WindowGroup methodsFor:'special'! |
|
1044 |
||
1045 |
restoreCursors |
|
1046 |
"restore the original cursors in all of my views" |
|
1047 |
||
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1048 |
self allViewsDo:[:aView | |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1049 |
|c dev id| |
244 | 1050 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1051 |
dev := aView device. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1052 |
dev notNil ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1053 |
c := aView cursor on:dev. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1054 |
(id := aView id) notNil ifTrue:[ |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1055 |
dev setCursor:(c id) in:id. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1056 |
] |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1057 |
] |
244 | 1058 |
]. |
1059 |
! |
|
1060 |
||
328 | 1061 |
showActivity:someMessage |
1062 |
topViews notNil ifTrue:[ |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1063 |
topViews first showActivity:someMessage |
328 | 1064 |
] |
1065 |
||
1066 |
"Created: 16.12.1995 / 18:39:40 / cg" |
|
1067 |
! |
|
1068 |
||
244 | 1069 |
showCursor:aCursor |
1070 |
"change the cursor to aCursor in all of my views." |
|
1071 |
||
1072 |
|c| |
|
1073 |
||
1074 |
c := aCursor. |
|
1075 |
self allViewsDo:[:aView | |
|
1076 |
c := c on:(aView device). |
|
1077 |
aView device setCursor:c id in:aView id. |
|
1078 |
]. |
|
1079 |
! |
|
1080 |
||
1081 |
withCursor:aCursor do:aBlock |
|
1082 |
"evaluate aBlock while showing aCursor in all |
|
1083 |
my views (used to show wait-cursor while doing something). |
|
1084 |
Return the result as returned by aBlock." |
|
1085 |
||
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1086 |
|oldCursors dev| |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1087 |
|
383 | 1088 |
dev := self device. |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1089 |
dev isNil ifTrue:[ |
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1090 |
^ aBlock value |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1091 |
]. |
244 | 1092 |
|
1093 |
" |
|
1094 |
get mapping of view->cursor for all of my subviews |
|
1095 |
" |
|
1096 |
oldCursors := IdentityDictionary new. |
|
1097 |
self allViewsDo:[:aView | |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1098 |
oldCursors at:aView put:(aView cursor). |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1099 |
aView cursor:aCursor now:false |
244 | 1100 |
]. |
329
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1101 |
"/ |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1102 |
"/ here sync looks better; flush leads to almost invisible cursors when accepting. |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1103 |
"/ I dont really know why (maybe unix does not context-switch to the Xserver |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1104 |
"/ early enough after the requests have been sent ?) |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1105 |
"/ |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1106 |
"/ dev flush. |
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1107 |
dev sync. |
244 | 1108 |
|
1109 |
^ aBlock valueNowOrOnUnwindDo:[ |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1110 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1111 |
restore cursors from the mapping |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1112 |
" |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1113 |
oldCursors keysAndValuesDo:[:view :cursor | |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1114 |
view cursor:cursor now:false. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1115 |
]. |
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1116 |
dev flush "/ sync. |
244 | 1117 |
] |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1118 |
|
329
8a34deadc4ff
sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
1119 |
"Modified: 17.12.1995 / 15:45:49 / cg" |
244 | 1120 |
! ! |
1121 |
||
1122 |
!WindowGroup methodsFor:'special accessing'! |
|
1123 |
||
1124 |
setModal:aBoolean |
|
1125 |
"special entry for debugger: set the modal flag. |
|
1126 |
Not for public use" |
|
1127 |
||
1128 |
isModal := aBoolean |
|
1129 |
||
1130 |
"Modified: 3.9.1995 / 14:51:04 / claus" |
|
1131 |
! |
|
1132 |
||
1133 |
setPreviousGroup:aGroup |
|
1134 |
"special entry for debugger: |
|
1135 |
set the windowgroup that started this group (for modal groups only). |
|
1136 |
This is not a public interface." |
|
1137 |
||
1138 |
previousGroup := aGroup |
|
1139 |
||
1140 |
"Modified: 3.9.1995 / 14:55:40 / claus" |
|
1141 |
! |
|
1142 |
||
1143 |
setProcess:aProcess |
|
1144 |
"special entry for debugger: set the windowGroups process. |
|
1145 |
Not for public use." |
|
1146 |
||
1147 |
myProcess := aProcess |
|
1148 |
||
1149 |
"Modified: 3.9.1995 / 14:25:38 / claus" |
|
1150 |
! ! |
|
1151 |
||
251 | 1152 |
!WindowGroup class methodsFor:'documentation'! |
1153 |
||
1154 |
version |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
383
diff
changeset
|
1155 |
^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.57 1996-01-27 15:35:09 cg Exp $' |
251 | 1156 |
! ! |
244 | 1157 |
WindowGroup initialize! |