author | Claus Gittinger <cg@exept.de> |
Sat, 07 Feb 1998 16:14:23 +0100 | |
changeset 2051 | 323362098e21 |
parent 2046 | abd56d83bac5 |
child 2086 | 069a179b1849 |
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 |
417 | 15 |
focusSequence preEventHook postEventHook pointerView |
16 |
isForModalSubview' |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
17 |
classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal |
1110 | 18 |
WindowGroupQuerySignal LastEventQuerySignal' |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
19 |
poolDictionaries:'' |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
20 |
category:'Interface-Support' |
11 | 21 |
! |
22 |
||
1110 | 23 |
!WindowGroup class methodsFor:'documentation'! |
46 | 24 |
|
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 28 |
All Rights Reserved |
46 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
103 | 41 |
In Smalltalk/X, the known (ST-80) concept of a controller has been |
297 | 42 |
extended (split) into a WindowGroup which handles process related stuff, |
43 |
and the Controller, which only handles events for a view and defines the user interaction. |
|
44 |
All interaction is via event queues - there is no polling in controllers (not even conceptionally). |
|
103 | 45 |
|
46 |
WindowGroups are responsible to wait for and forward events for a group of |
|
297 | 47 |
windows. All views in a windowGroup share a single windowSensor which holds the |
1503 | 48 |
event queue (therefore subviews all share the same input event queue). |
144 | 49 |
|
297 | 50 |
The event queues are filled with incoming events as arriving from the physical display. |
51 |
This is done by a separate process (so called event-dispatcher) which runs at a higher |
|
52 |
priority. The event dispatcher determines the queue into which an event has to be placed |
|
53 |
by the view for which the event is destined (via the views sensor). |
|
54 |
There may be multiple event dispatchers running (to support multiple displays); |
|
55 |
see the documentation/examples in DeviceWorkstation/XWorkstation on how this is done. |
|
56 |
||
103 | 57 |
Except for modal boxes, a separate process is created for each windowGroup |
297 | 58 |
which waits for events to arrive and processes them, by sending corresponding |
144 | 59 |
event messages to the views controller or the view (*). |
297 | 60 |
The controller is determined by asking the view (for which the event is destined); |
61 |
if the returned controller is nil, the event is sent directly to the view. |
|
62 |
This allows for simple views to work without a controller. |
|
63 |
(all of this is actually done in a WindowEvent method) |
|
64 |
||
65 |
Therefore, multiple applications run pseudo parallel. |
|
66 |
Even if some window performs a long time computation, events are still received |
|
67 |
and entered into the corresponding event queues (because the event dispatcher process |
|
68 |
runs at a higher priority). However, the actual processing of the event is only |
|
69 |
possibly if no other process is busy at the same or a higher priority. |
|
70 |
It is possible to change a windowProcesses priority in order to give other windows |
|
71 |
a chance to execute (some views do this while performing longtime actions). |
|
72 |
||
103 | 73 |
Modal boxes create an extra window group for the components of the modal |
297 | 74 |
box, but execute the event-processing loop for this new group in the original process - |
144 | 75 |
therefore, the original windowgroup is blocked for the duration of the modal |
297 | 76 |
interaction. |
77 |
However, the modal-event processing loop peeks into the original groups event queue |
|
78 |
from time to time, and handles expose events. Thus, even while blocked for user input, |
|
79 |
the original group continues to get update/redraw events. |
|
103 | 80 |
|
81 |
Normally, one windowgroup is associated to each topview (StandardSystemView) |
|
144 | 82 |
and all of its subviews. However, this is not strictly required; |
83 |
it is possible to create extra windowgroups for subviews, which will let them |
|
84 |
run in parallel |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
85 |
(for example, the FileBrowsers kill-Button is created that |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
86 |
way, to allow a kill of an executing unix command, while the browser |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
87 |
itself reads the pipeStream for incoming text. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
88 |
Even if the fileBrowser is busy reading the pipe, the killButton is still |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
89 |
working and allows terminating the pipe-read action). |
144 | 90 |
|
91 |
On the other hand, multiple topviews can be placed into the same windowGroup; |
|
92 |
which allows for multiview applications, of which only one communicates with |
|
103 | 93 |
the user at a time. |
297 | 94 |
Multiple topviews within a windowGropup can be configured to behave like one |
95 |
unit with respect to iconification, deiconification and termination. |
|
96 |
This is done by creating multiple topViews in one group, and setting up a master/slave |
|
97 |
or partner relation among them (see TopView>>beSlave and TopView>>bePartner). |
|
103 | 98 |
|
109 | 99 |
WindowGroups also support a focus window: this is the one that gets the |
103 | 100 |
keyboard input - even if the cursor is located in another subview. |
512 | 101 |
The sequence is defined by the topView or its model (typically an applicationModel). |
102 |
It should return an orderedCollection of subviews when asked via #focusSequence. |
|
103 |
||
104 |
For debugging, windowGroups allow hooks to be installed around the processing of |
|
105 |
events - preEventHook is sent a #procesEvent: message before an event is processed, |
|
106 |
postEventHook is informed after the event has been processed. |
|
107 |
The preEventHook should return true - if it returns true, the event is considered |
|
108 |
being already processed by the hook and ignored. |
|
109 |
This allows for event-tracing, timing or even filtering (if preEventHook returns true). |
|
110 |
(notice: there is also an eventHook facility available in the sensor class.) |
|
103 | 111 |
|
112 |
Finally, windowgroups are the perfect place for things like defining a |
|
113 |
cursor for all associated views, flushing all input, waiting for expose |
|
114 |
events etc. |
|
115 |
||
297 | 116 |
Dont get confused: |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
117 |
You dont have to care for details in the normal case, a windowgroup is |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
118 |
created for you automatically, when a view is opened. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
119 |
All of the internals are not required to be known for most applications. |
297 | 120 |
|
103 | 121 |
|
597 | 122 |
[instance variables:] |
144 | 123 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
124 |
views collection of views of this group |
103 | 125 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
126 |
topViews collection of topviews of this group |
103 | 127 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
128 |
myProcess the process executing the events |
103 | 129 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
130 |
mySensor my input sensor |
103 | 131 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
132 |
isModal true if this is for a modal box |
103 | 133 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
134 |
previousGroup if modal, the group that started this one |
103 | 135 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
136 |
focusView the one that has the focus (or nil) |
103 | 137 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
138 |
focusSequence defines the focus sequence |
103 | 139 |
|
140 |
||
597 | 141 |
[class variables:] |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
142 |
LeaveSignal if raised, a modal box leaves (closes) |
103 | 143 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
144 |
WindowGroupQuerySignal to ask for the current windowGroup, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
145 |
anywhere in the program, simply raise this |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
146 |
signal. The raise returns nil, for processes, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
147 |
which are not under control of a windowGroup. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
148 |
(i.e. wg := WindowGroup windowGroupQuerySignal raise) |
1111 | 149 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
150 |
LastEventQuerySignal to ask for the event which was responsible |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
151 |
for being where you are (whereever that is). |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
152 |
The raise returns nil, if you did not arrive |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
153 |
there due to an event. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
154 |
(i.e. ev := WindowGroup lastEventQuerySignal raise) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
155 |
The event can be asked for the view, the type |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
156 |
of event, x/y position etc. |
103 | 157 |
|
144 | 158 |
(*) |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
159 |
due to historic reasons, many views have the controller functionality |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
160 |
integrated, and handle events themself. The windowSensor takes care |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
161 |
of this, by checking if a view has a controller, and, if so, forwarding |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
162 |
the events to it. Otherwise, events are sent directly to the view. |
144 | 163 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
164 |
In the future, all views will be rewritten to actually use a controller. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
165 |
Currently (being in the middle of this migration), only some views |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
166 |
(buttons, toggles and subclasses) do so. |
144 | 167 |
|
103 | 168 |
For more information, read 'introduction to view programming' in the |
169 |
doc/online directory. |
|
597 | 170 |
|
612 | 171 |
[author:] |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
172 |
Claus Gittinger |
612 | 173 |
|
597 | 174 |
[see also:] |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
175 |
WindowSensor WindowEvent EventListener KeyboardForwarder |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
176 |
DeviceWorkstation |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
177 |
View StandardSystemView |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
178 |
ApplicationModel |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
179 |
Process ProcessorScheduler |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
180 |
(``Working with processes (programmers manual)'': programming/processes.html#VIEWSNPROCS) |
46 | 181 |
" |
182 |
! ! |
|
183 |
||
1110 | 184 |
!WindowGroup class methodsFor:'initialization'! |
46 | 185 |
|
186 |
initialize |
|
187 |
LeaveSignal isNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
188 |
LeaveSignal := (Signal new) mayProceed:true. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
189 |
LeaveSignal nameClass:self message:#leaveSignal. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
190 |
LeaveSignal notifierString:'unhandled leave signal'. |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
191 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
192 |
WindowGroupQuerySignal := QuerySignal new. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
193 |
WindowGroupQuerySignal nameClass:self message:#windowGroupQuerySignal. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
194 |
WindowGroupQuerySignal notifierString:'query for windowgroup'. |
1111 | 195 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
196 |
LastEventQuerySignal := QuerySignal new. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
197 |
LastEventQuerySignal nameClass:self message:#lastEventQuerySignal. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
198 |
LastEventQuerySignal notifierString:'query for last event'. |
54 | 199 |
]. |
46 | 200 |
|
201 |
"WindowGroup initialize" |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
202 |
|
1111 | 203 |
"Modified: 9.11.1996 / 17:00:53 / cg" |
46 | 204 |
! ! |
205 |
||
1110 | 206 |
!WindowGroup class methodsFor:'instance creation'! |
244 | 207 |
|
208 |
new |
|
209 |
"create and return a new WindowGroup object" |
|
210 |
||
211 |
^ self basicNew initialize |
|
212 |
! ! |
|
213 |
||
1110 | 214 |
!WindowGroup class methodsFor:'Signal constants'! |
215 |
||
216 |
lastEventQuerySignal |
|
217 |
"return the signal which is used to query for the last event" |
|
218 |
||
219 |
^ LastEventQuerySignal |
|
220 |
||
221 |
"Created: 17.7.1996 / 20:36:04 / cg" |
|
222 |
! |
|
72 | 223 |
|
224 |
leaveSignal |
|
109 | 225 |
"return the signal which is used to exit a modal loop. |
1752 | 226 |
This private signal, is always caught while a modalbox is active. |
144 | 227 |
Raising it will exit the modal loop and return from the views #openModal |
228 |
method." |
|
109 | 229 |
|
72 | 230 |
^ LeaveSignal |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
231 |
! |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
232 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
233 |
windowGroupQuerySignal |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
234 |
"return the signal which is used to query for the windowGroup" |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
235 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
236 |
^ WindowGroupQuerySignal |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
237 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
238 |
"Created: 17.7.1996 / 20:36:04 / cg" |
72 | 239 |
! ! |
240 |
||
1110 | 241 |
!WindowGroup class methodsFor:'accessing'! |
26 | 242 |
|
243 |
activeGroup |
|
180 | 244 |
"return the currently active windowGroup. |
245 |
The returned value may not be fully correct, in case the current process |
|
1298
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
246 |
handles multiple windowGroups simultaneously. In this case, |
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
247 |
(usually) the first group is returned (prefering a modal if there is one). |
180 | 248 |
(maybe we should return a collection of windowGroups here). |
249 |
||
250 |
This method is required to simulate the historic ST-80 single display |
|
251 |
behavior for Cursor>>show / Cursor>>showWhile and some others (raising the |
|
252 |
activeGroups topView when modalBoxes appear) on multiple display screens. |
|
253 |
These methods should change the cursor for the currently |
|
254 |
active windowGroup ONLY, instead of globally affecting the display or |
|
255 |
all views |
|
256 |
(since, depending on the priority, other views could be unaffacted by this |
|
257 |
and an overall cursor change does not make sense.)" |
|
258 |
||
259 |
|activeProcess groups wg| |
|
260 |
||
261 |
Processor isNil ifTrue:[^ nil]. "/ only during very early init phase |
|
26 | 262 |
|
180 | 263 |
activeProcess := Processor activeProcess. |
264 |
" caching the last value ..." |
|
565
6867f1a9a470
oops - leftover global LastActive
Claus Gittinger <cg@exept.de>
parents:
513
diff
changeset
|
265 |
activeProcess == LastActiveProcess ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
266 |
LastActiveGroup process == LastActiveProcess ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
267 |
^ LastActiveGroup |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
268 |
] |
180 | 269 |
]. |
1298
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
270 |
|
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
271 |
wg := WindowGroupQuerySignal raise. |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
272 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
273 |
wg isNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
274 |
"/ mhmh - noone willing to answer that question ... |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
275 |
"/ (how can ths happen ?) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
276 |
groups := self scheduledWindowGroups |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
277 |
select:[:wg | wg process == activeProcess]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
278 |
groups size == 1 ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
279 |
wg := groups anElement |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
280 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
281 |
wg := groups detect:[:wg | wg isModal] ifNone:nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
282 |
wg isNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
283 |
wg := groups anElement |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
284 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
285 |
]. |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
286 |
]. |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
287 |
|
180 | 288 |
wg notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
289 |
LastActiveProcess := activeProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
290 |
LastActiveGroup := wg. |
180 | 291 |
]. |
292 |
^ wg |
|
293 |
||
294 |
" |
|
295 |
WindowGroup activeGroup |
|
296 |
" |
|
297 |
||
298 |
"Modified: 3.9.1995 / 14:49:53 / claus" |
|
1298
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
299 |
"Modified: 29.1.1997 / 19:46:25 / cg" |
54 | 300 |
! |
301 |
||
302 |
scheduledWindowGroups |
|
180 | 303 |
"return a collection of all windowGroups (possibly for different |
304 |
display devices) which are scheduled (i.e. which have a process |
|
305 |
running, handling events)." |
|
306 |
||
307 |
|set screens| |
|
308 |
||
309 |
screens := Screen allScreens. |
|
1869 | 310 |
screens size == 0 ifTrue:[^ #()]. |
180 | 311 |
|
312 |
set := IdentitySet new. |
|
313 |
screens do:[:aDevice | |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
314 |
aDevice allViewsDo:[:aView | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
315 |
|wg| |
109 | 316 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
317 |
(wg := aView windowGroup) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
318 |
wg process notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
319 |
set add:wg |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
320 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
321 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
322 |
]. |
180 | 323 |
]. |
324 |
^ set asArray |
|
325 |
||
326 |
" |
|
327 |
WindowGroup scheduledWindowGroups |
|
328 |
" |
|
329 |
||
330 |
"Modified: 1.9.1995 / 13:43:09 / claus" |
|
1869 | 331 |
"Modified: 18.8.1997 / 18:44:29 / cg" |
244 | 332 |
! |
333 |
||
334 |
setActiveGroup:aGroup |
|
335 |
"set the currently active windowGroup. |
|
336 |
Temporary; do not use this interface, it will vanish." |
|
337 |
||
338 |
LastActiveProcess := Processor activeProcess. |
|
339 |
LastActiveGroup := aGroup |
|
26 | 340 |
! ! |
341 |
||
11 | 342 |
!WindowGroup methodsFor:'accessing'! |
343 |
||
512 | 344 |
device |
345 |
"return the device, we receive our events from" |
|
346 |
||
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
347 |
self obsoleteMethodWarning:'use #graphicsDevice'. |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
348 |
^ self graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
349 |
|
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
350 |
"Modified: 5.7.1996 / 17:53:58 / cg" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
351 |
! |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
352 |
|
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
353 |
graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
354 |
"return the device, we receive our events from" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
355 |
|
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
356 |
|dev| |
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
357 |
|
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
358 |
topViews notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
359 |
topViews do:[:v | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
360 |
|app| |
1116 | 361 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
362 |
(app := v application) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
363 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
364 |
"/ ok, it has an application; |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
365 |
"/ ask it for preferences. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
366 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
367 |
(dev := app graphicsDevice) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
368 |
^ dev |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
369 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
370 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
371 |
(dev := v graphicsDevice) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
372 |
^ dev |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
373 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
374 |
] |
512 | 375 |
]. |
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
376 |
views notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
377 |
views do:[:v | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
378 |
(dev := v graphicsDevice) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
379 |
^ dev |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
380 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
381 |
] |
512 | 382 |
]. |
383 |
^ nil |
|
384 |
||
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
385 |
"Modified: 7.2.1997 / 16:14:24 / cg" |
512 | 386 |
! |
387 |
||
388 |
isModal |
|
389 |
"return true, if the receiver is in a modal mode |
|
390 |
(i.e. for a modal box)" |
|
391 |
||
392 |
^ isModal |
|
393 |
||
394 |
"Modified: 7.3.1996 / 14:29:46 / cg" |
|
395 |
! |
|
396 |
||
397 |
mainGroup |
|
398 |
"return the main windowgroup (for modal groups only) |
|
399 |
that is the top one, which is not modal. |
|
400 |
NonModal groups return themSelf. |
|
401 |
||
402 |
There is one exception to this: the debugger (which is sort of modal) |
|
403 |
returns itself as mainGroup (not its debuggee)." |
|
404 |
||
405 |
|g prev| |
|
406 |
||
407 |
g := self. |
|
408 |
[g notNil and:[g isModal and:[(prev := g previousGroup) notNil]]] whileTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
409 |
g := prev |
512 | 410 |
]. |
411 |
^ g |
|
412 |
||
413 |
"Modified: 3.9.1995 / 14:57:20 / claus" |
|
414 |
"Modified: 7.3.1996 / 14:29:28 / cg" |
|
415 |
! |
|
416 |
||
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
417 |
mainGroup:aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
418 |
"set the main windowgroup (for modal/autonomous groups only) |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
419 |
Exposeevents for that windowGroup will be handled by this group |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
420 |
as well." |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
421 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
422 |
previousGroup := aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
423 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
424 |
"Created: 20.8.1997 / 17:57:35 / cg" |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
425 |
! |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
426 |
|
512 | 427 |
previousGroup |
428 |
"return the windowgroup that started this group. (for modal groups only). |
|
429 |
This may be another modalGroup (for boxes opened by boxes). |
|
430 |
NonModal groups return nil." |
|
431 |
||
432 |
^ previousGroup |
|
433 |
||
434 |
"Modified: 7.3.1996 / 14:28:46 / cg" |
|
435 |
! |
|
436 |
||
437 |
process |
|
438 |
"return the windowGroups process" |
|
439 |
||
440 |
^ myProcess |
|
441 |
! |
|
442 |
||
443 |
sensor |
|
444 |
"return the windowGroups sensor. |
|
445 |
All events for any of the groups views is handled by that sensor." |
|
446 |
||
447 |
^ mySensor |
|
448 |
||
449 |
"Modified: 7.3.1996 / 14:30:21 / cg" |
|
450 |
! |
|
451 |
||
452 |
sensor:aSensor |
|
453 |
"set the windowGroups sensor" |
|
454 |
||
455 |
mySensor := aSensor |
|
456 |
! ! |
|
457 |
||
458 |
!WindowGroup methodsFor:'accessing-hook'! |
|
459 |
||
460 |
postEventHook |
|
461 |
"return the postEventHook if any" |
|
462 |
||
463 |
^ postEventHook |
|
464 |
||
465 |
"Created: 7.3.1996 / 14:42:46 / cg" |
|
466 |
! |
|
467 |
||
468 |
postEventHook:anObject |
|
469 |
"set the postEventHook - this one will get all events |
|
470 |
passed after being processed here (via #processEvent:)." |
|
471 |
||
472 |
postEventHook := anObject |
|
473 |
! |
|
474 |
||
475 |
preEventHook |
|
476 |
"return the preEventHook if any" |
|
477 |
||
478 |
^ preEventHook |
|
479 |
||
480 |
"Created: 7.3.1996 / 14:42:42 / cg" |
|
481 |
! |
|
482 |
||
483 |
preEventHook:anObject |
|
484 |
"set the preEventHook - this one will get all events |
|
485 |
passed before being processed here (via #processEvent:). |
|
486 |
If this returns true, the event is supposed to be already |
|
487 |
processed and ignored here. |
|
488 |
Otherwise, it is processed as usual." |
|
489 |
||
490 |
preEventHook := anObject |
|
491 |
! ! |
|
492 |
||
493 |
!WindowGroup methodsFor:'accessing-views'! |
|
494 |
||
244 | 495 |
addTopView:aView |
496 |
"add a topview to the group" |
|
26 | 497 |
|
244 | 498 |
topViews isNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
499 |
topViews := OrderedCollection new. |
244 | 500 |
]. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
501 |
(topViews includesIdentical:aView) ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
502 |
topViews add:aView |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
503 |
] |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
504 |
|
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
505 |
"Modified: 6.3.1996 / 15:35:15 / cg" |
26 | 506 |
! |
507 |
||
11 | 508 |
addView:aView |
26 | 509 |
"add aView to the windowGroup" |
510 |
||
11 | 511 |
views isNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
512 |
views := OrderedCollection new. |
11 | 513 |
]. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
514 |
(views includesIdentical:aView) ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
515 |
views add:aView |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
516 |
] |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
517 |
|
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
518 |
"Modified: 6.3.1996 / 15:35:41 / cg" |
11 | 519 |
! |
520 |
||
26 | 521 |
removeView:aView |
522 |
"remove aView from the windowGroup; |
|
523 |
if this was the last view in this group, |
|
81 | 524 |
also shut down the corresponding process |
525 |
(actually, only wake it up here - it will terminate itself |
|
526 |
when finding out that all views are gone)" |
|
11 | 527 |
|
263 | 528 |
|sema| |
529 |
||
11 | 530 |
views notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
531 |
views removeIdentical:aView ifAbsent:[]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
532 |
views isEmpty ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
533 |
views := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
534 |
] |
11 | 535 |
]. |
536 |
topViews notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
537 |
topViews removeIdentical:aView ifAbsent:[]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
538 |
topViews isEmpty ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
539 |
topViews := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
540 |
] |
11 | 541 |
]. |
54 | 542 |
" |
543 |
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
|
544 |
removed (modalBoxes terminate their modalLoop if so) |
54 | 545 |
" |
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
546 |
mySensor notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
547 |
(sema := mySensor eventSemaphore) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
548 |
sema signal |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
549 |
] |
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
550 |
] |
1304 | 551 |
|
552 |
"Modified: 1.2.1997 / 12:13:26 / cg" |
|
11 | 553 |
! |
554 |
||
244 | 555 |
topViews |
556 |
"return the topviews accociated to this windowGroup" |
|
172 | 557 |
|
244 | 558 |
^ topViews |
172 | 559 |
! |
560 |
||
244 | 561 |
views |
562 |
"return the views accociated to this windowGroup" |
|
172 | 563 |
|
244 | 564 |
^ views |
54 | 565 |
! ! |
566 |
||
244 | 567 |
!WindowGroup methodsFor:'activation / deactivation'! |
568 |
||
569 |
closeDownViews |
|
570 |
"destroy all views associated to this window group" |
|
571 |
||
572 |
topViews notNil ifTrue:[ |
|
403 | 573 |
topViews do:[:aTopView | aTopView notNil ifTrue:[aTopView destroy]] |
244 | 574 |
]. |
575 |
views := nil. |
|
576 |
topViews := nil. |
|
577 |
mySensor := nil. |
|
578 |
! |
|
579 |
||
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
580 |
realizeTopViews |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
581 |
"realize all topViews associated to this windowGroup." |
244 | 582 |
|
583 |
topViews notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
584 |
topViews do:[:aView | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
585 |
aView realize. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
586 |
]. |
244 | 587 |
]. |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
588 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
589 |
"Created: 24.7.1997 / 12:56:09 / cg" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
590 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
591 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
592 |
rerealizeTopViews |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
593 |
"rerealize all topViews associated to this windowGroup. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
594 |
and tell topViews about it." |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
595 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
596 |
topViews notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
597 |
topViews do:[:aView | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
598 |
aView isPopUpView |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
599 |
ifFalse: |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
600 |
[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
601 |
aView realize. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
602 |
aView restarted |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
603 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
604 |
]. |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
605 |
]. |
244 | 606 |
! |
180 | 607 |
|
244 | 608 |
restart |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
609 |
"restart after a snapin. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
610 |
This reopens all views in this group." |
180 | 611 |
|
244 | 612 |
topViews notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
613 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
614 |
need a new semaphore, since obsolete processes |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
615 |
(from our previous live) may still sit on the current semaphore |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
616 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
617 |
mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema'). |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
618 |
isModal ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
619 |
self startupWith:[self rerealizeTopViews]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
620 |
] |
244 | 621 |
] |
1273 | 622 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
623 |
"Modified: 24.7.1997 / 13:00:12 / cg" |
244 | 624 |
! |
180 | 625 |
|
582
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
626 |
shutDown |
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
627 |
"shutdown the window group; close all views and |
1317 | 628 |
terminate the process" |
244 | 629 |
|
630 |
|p| |
|
631 |
||
632 |
self closeDownViews. |
|
633 |
myProcess notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
634 |
p := myProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
635 |
myProcess := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
636 |
p terminate. |
244 | 637 |
] |
582
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
638 |
|
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
639 |
"Created: 22.4.1996 / 17:58:37 / cg" |
1317 | 640 |
"Modified: 8.2.1997 / 16:46:31 / cg" |
180 | 641 |
! |
642 |
||
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
643 |
startupModal:checkBlock |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
644 |
"startup the window-group in a modal loop |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
645 |
(i.e. under the currently running process); |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
646 |
checkBlock is evaluated and the modal loop is left, |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
647 |
whenever false is returned." |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
648 |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
649 |
^ self startupModal:checkBlock forGroup:(WindowGroup activeGroup). |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
650 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
651 |
"Created: 10.12.1995 / 14:15:11 / cg" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
652 |
"Modified: 20.8.1997 / 17:54:33 / cg" |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
653 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
654 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
655 |
startupModal:checkBlock forGroup:mainGroup |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
656 |
"startup the window-group in a modal loop |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
657 |
(i.e. under the currently running process); |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
658 |
checkBlock is evaluated and loop is left, when false is |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
659 |
returned. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
660 |
The mainGroup info is required to allow peeking into its |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
661 |
event queue in order for its expose/redraws to be handled." |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
662 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
663 |
"set previousGroup to the main (non-modal) group" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
664 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
665 |
previousGroup := mainGroup. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
666 |
isModal := true. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
667 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
668 |
WindowGroupQuerySignal handle:[:ex | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
669 |
ex proceedWith:self |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
670 |
] do:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
671 |
self realizeTopViews. |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
672 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
673 |
self |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
674 |
eventLoopWhile:checkBlock |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
675 |
onLeave:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
676 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
677 |
cleanup, in case of a terminate |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
678 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
679 |
previousGroup := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
680 |
topViews := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
681 |
views := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
682 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
683 |
the following is rubbish; |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
684 |
the views could be reused .. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
685 |
" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
686 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
687 |
"/ topViews notNil ifTrue:[ |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
688 |
"/ topViews do:[:aView | |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
689 |
"/ aView destroy |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
690 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
691 |
"/ topViews := nil. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
692 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
693 |
"/ views notNil ifTrue:[ |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
694 |
"/ views do:[:aView | |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
695 |
"/ aView destroy |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
696 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
697 |
"/ views := nil. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
698 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
699 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
700 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
701 |
] |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
702 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
703 |
"Created: 10.12.1995 / 14:14:26 / cg" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
704 |
"Modified: 20.8.1997 / 18:12:20 / cg" |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
705 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
706 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
707 |
startupWith:startupAction |
244 | 708 |
"startup the window-group; |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
709 |
this creates a new window group process, which does the event processing. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
710 |
The startupAction arg is evaluated by the windowGroup process, |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
711 |
before the eventLoop is entered, and is used to realize any views. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
712 |
[this is done to have the new process realize its views, instead of |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
713 |
the caller - which may make a difference in case of errors and/or |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
714 |
blocking operations ...]" |
244 | 715 |
|
716 |
|top nm dev devNm| |
|
717 |
||
718 |
previousGroup := nil. |
|
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
719 |
|
244 | 720 |
myProcess isNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
721 |
isModal := false. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
722 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
723 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
724 |
"/ this is the windowGroup process; |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
725 |
"/ realize all views, then handle events forever |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
726 |
"/ (well, not really forever ... ;-) |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
727 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
728 |
myProcess := [ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
729 |
WindowGroupQuerySignal handle:[:ex | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
730 |
ex proceedWith:self |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
731 |
] do:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
732 |
[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
733 |
startupAction value. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
734 |
self eventLoopWhile:[true] onLeave:[] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
735 |
] valueNowOrOnUnwindDo:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
736 |
self closeDownViews |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
737 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
738 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
739 |
] forkAt:(Processor userSchedulingPriority). |
180 | 740 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
741 |
(topViews size > 0) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
742 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
743 |
"/ give the windowGroup process a user friendly name |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
744 |
"/ ask its topView for the processName, and |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
745 |
"/ optionally append the displayName (if its not the default) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
746 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
747 |
top := topViews first. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
748 |
nm := top processName. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
749 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
750 |
(dev := top graphicsDevice) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
751 |
devNm := dev displayName. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
752 |
(devNm notNil and:[devNm ~= Display displayName]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
753 |
nm := nm , ' (' , devNm , ')' |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
754 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
755 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
756 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
757 |
nm := 'window handler'. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
758 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
759 |
myProcess name:nm. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
760 |
myProcess beGroupLeader. |
180 | 761 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
762 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
763 |
"/ when the process gets suspended, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
764 |
"/ there maybe still buffered draw requests. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
765 |
"/ Arrange for them to be flushed then. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
766 |
"/ (otherwise, you would not see the output of a process, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
767 |
"/ which suspends and waits - or we had to add buffer flushes |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
768 |
"/ all over the place) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
769 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
770 |
myProcess addSuspendAction:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
771 |
|dev| |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
772 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
773 |
dev := self graphicsDevice. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
774 |
dev notNil ifTrue:[dev flush]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
775 |
]. |
244 | 776 |
] |
313 | 777 |
|
1965 | 778 |
"Modified: / 13.12.1995 / 14:04:53 / stefan" |
779 |
"Created: / 24.7.1997 / 12:52:04 / cg" |
|
780 |
"Modified: / 4.12.1997 / 14:13:35 / cg" |
|
180 | 781 |
! ! |
782 |
||
90 | 783 |
!WindowGroup methodsFor:'enumerating'! |
54 | 784 |
|
1117 | 785 |
allNonTopViewsDo:aBlock |
786 |
"evaluate aBlock for all nonTopviews (i.e. subviews) in this group. |
|
1334 | 787 |
This enumerates a copy of the view collection, to allow for |
1240 | 788 |
destroy and other collection changing operations to be performed in the loop." |
1117 | 789 |
|
790 |
views notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
791 |
views copy nonNilElementsDo:aBlock |
1117 | 792 |
] |
1334 | 793 |
|
794 |
"Modified: 12.2.1997 / 12:20:25 / cg" |
|
1117 | 795 |
! |
796 |
||
1153 | 797 |
allTopViewsDo:aBlock |
798 |
"evaluate aBlock for all topviews in this group. |
|
1334 | 799 |
This enumerates a copy of the view collection, to allow for |
1240 | 800 |
destroy and other collection changing operations to be performed in the loop." |
1153 | 801 |
|
802 |
topViews notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
803 |
topViews copy nonNilElementsDo:aBlock |
1153 | 804 |
] |
1334 | 805 |
|
806 |
"Modified: 12.2.1997 / 12:20:30 / cg" |
|
1153 | 807 |
! |
808 |
||
54 | 809 |
allTopViewsExcept:aView do:aBlock |
157 | 810 |
"evaluate aBlock for all topviews except aView in this group. |
1334 | 811 |
This enumerates a copy of the view collection, to allow for |
1240 | 812 |
destroy and other collection changing operations to be performed in the loop." |
157 | 813 |
|
1334 | 814 |
self allTopViewsDo:[:v | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
815 |
v ~~ aView ifTrue:[aBlock value:v] |
157 | 816 |
]. |
1334 | 817 |
|
818 |
"Modified: 12.2.1997 / 12:22:10 / cg" |
|
157 | 819 |
! |
820 |
||
244 | 821 |
allViewsDo:aBlock |
822 |
"evaluate aBlock for all views & topviews in this group. |
|
1334 | 823 |
This enumerates a copy of the view collection, to allow for |
1240 | 824 |
destroy and other collection changing operations to be performed in the loop." |
244 | 825 |
|
1117 | 826 |
self allTopViewsDo:aBlock. |
827 |
self allNonTopViewsDo:aBlock. |
|
1334 | 828 |
|
829 |
"Modified: 12.2.1997 / 12:20:20 / cg" |
|
244 | 830 |
! |
831 |
||
832 |
partnersDo:aBlock |
|
833 |
"evaluate aBlock for all partnerViews. |
|
1334 | 834 |
This enumerates a copy of the view collection, to allow for |
1240 | 835 |
destroy and other collection changing operations to be performed in the loop." |
244 | 836 |
|
1334 | 837 |
self allTopViewsDo:[:v | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
838 |
(v type == #partner) ifTrue:[aBlock value:v]. |
244 | 839 |
]. |
1334 | 840 |
|
841 |
"Modified: 12.2.1997 / 12:21:41 / cg" |
|
244 | 842 |
! |
843 |
||
157 | 844 |
slavesDo:aBlock |
845 |
"evaluate aBlock for all slaveViews. |
|
1334 | 846 |
This enumerates a copy of the view collection, to allow for |
1240 | 847 |
destroy and other collection changing operations to be performed in the loop." |
54 | 848 |
|
1334 | 849 |
self allTopViewsDo:[:v | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
850 |
(v type == #slave) ifTrue:[aBlock value:v]. |
157 | 851 |
]. |
1334 | 852 |
|
853 |
"Modified: 12.2.1997 / 12:21:46 / cg" |
|
11 | 854 |
! ! |
855 |
||
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
856 |
!WindowGroup methodsFor:'event debugging'! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
857 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
858 |
traceEvents:trueOrFalse |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
859 |
|hook| |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
860 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
861 |
trueOrFalse ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
862 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
863 |
"/ remove any eventHook on the receiver |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
864 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
865 |
self preEventHook:nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
866 |
"/ Transcript showCR:'removed eventHook'. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
867 |
] ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
868 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
869 |
"/ set an eventHook on its windowGroup |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
870 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
871 |
hook := Plug new. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
872 |
hook respondTo:#processEvent: |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
873 |
with:[:ev | ev displayString printCR. false]. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
874 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
875 |
self preEventHook:hook. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
876 |
"/ Transcript showCR:'set eventHook for tracing'. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
877 |
] |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
878 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
879 |
"Created: 24.4.1996 / 10:25:21 / cg" |
698 | 880 |
"Modified: 20.5.1996 / 10:30:00 / cg" |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
881 |
! ! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
882 |
|
19 | 883 |
!WindowGroup methodsFor:'event handling'! |
11 | 884 |
|
244 | 885 |
eventLoop |
886 |
"loop executed by windowGroup process; |
|
887 |
wait-for and process events forever" |
|
888 |
||
889 |
self eventLoopWhile:[true] onLeave:[] |
|
890 |
! |
|
891 |
||
892 |
eventLoopWhile:aBlock onLeave:cleanupActions |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
893 |
"wait-for and process events. |
244 | 894 |
Stay in this loop while there are still any views to dispatch for, |
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
895 |
and aBlock evaluates to true. |
244 | 896 |
|
1752 | 897 |
Some signals are caught & handled: |
2046 | 898 |
LeaveSignal forces an exit from the eventLoop; |
899 |
AbortSignal brings us back into the loop, processing the next event; |
|
900 |
ActivityNotifications send a #showActivity: if nonModal, |
|
901 |
otherwise they are ignored." |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
902 |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
903 |
|thisProcess sigs otherSema| |
244 | 904 |
|
905 |
thisProcess := Processor activeProcess. |
|
906 |
||
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
907 |
sigs := SignalSet |
2046 | 908 |
with:AbortSignal |
909 |
with:LeaveSignal |
|
910 |
with:(self class activityNotificationSignal). |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
911 |
|
244 | 912 |
[ |
2046 | 913 |
|p g mainGroup mySema waitSema| |
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
914 |
|
2046 | 915 |
waitSema := mySema := mySensor eventSemaphore. |
325
b24d9a1c74dc
stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents:
324
diff
changeset
|
916 |
|
2046 | 917 |
isModal ifTrue:[ |
918 |
mainGroup := self mainGroup. |
|
919 |
mainGroup == self ifTrue:[ |
|
920 |
mainGroup := nil |
|
921 |
]. |
|
922 |
] ifFalse:[ |
|
923 |
mainGroup := previousGroup |
|
924 |
]. |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
925 |
|
2046 | 926 |
mainGroup notNil ifTrue:[ |
927 |
otherSema := mainGroup sensor eventSemaphore. |
|
928 |
waitSema := SemaphoreSet with:mySema with:otherSema. |
|
929 |
]. |
|
244 | 930 |
|
2046 | 931 |
[aBlock value] whileTrue:[ |
932 |
LastActiveGroup := self. |
|
933 |
LastActiveProcess := thisProcess. |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
934 |
|
2046 | 935 |
(views isNil and:[topViews isNil]) ifTrue:[ |
936 |
myProcess notNil ifTrue:[ |
|
937 |
p := myProcess. |
|
938 |
myProcess := nil. |
|
939 |
p terminate. |
|
940 |
"not reached - there is no life after death" |
|
941 |
]. |
|
942 |
" |
|
943 |
this is the end of a modal loop |
|
944 |
(not having a private process ...) |
|
945 |
" |
|
946 |
^ self |
|
947 |
]. |
|
244 | 948 |
|
2046 | 949 |
sigs handle:[:ex | |
950 |
|theSig| |
|
244 | 951 |
|
2046 | 952 |
(theSig := ex signal) == AbortSignal ifTrue:[ |
953 |
"/ |
|
954 |
"/ on abort, stay in loop |
|
955 |
"/ |
|
956 |
ex return |
|
957 |
]. |
|
958 |
theSig == LeaveSignal ifTrue:[ |
|
959 |
"/ |
|
960 |
"/ on leave, exit the event loop |
|
961 |
"/ |
|
962 |
^ self |
|
963 |
]. |
|
323
619085d52522
be careful - device may be nil
Claus Gittinger <cg@exept.de>
parents:
319
diff
changeset
|
964 |
|
2046 | 965 |
"/ ActivityNotification |
966 |
"/ |
|
967 |
"/ if I am a modal-group, let it be handled |
|
968 |
"/ by the outer main-groups handler |
|
969 |
"/ otherwise show the activityMessage and continue. |
|
970 |
"/ |
|
971 |
isModal ifTrue:[ |
|
972 |
ex reject |
|
973 |
"never reached" |
|
974 |
]. |
|
975 |
self showActivity:(ex errorString). |
|
976 |
ex proceed. |
|
977 |
] do:[ |
|
978 |
|dev gotSema mainView| |
|
429 | 979 |
|
2046 | 980 |
"/ Flush device output before going to sleep. |
981 |
"/ This may produce more events to arrive. |
|
982 |
"/ Q: is this still needed (see suspendAction) ? |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
983 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
984 |
"/ dev := self graphicsDevice. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
985 |
"/ dev notNil ifTrue:[dev flush]. |
328 | 986 |
|
2046 | 987 |
"/ now, wait for an event to arrive |
988 |
thisProcess setStateTo:#eventWait if:#active. |
|
989 |
gotSema := waitSema wait. |
|
990 |
LastActiveGroup := self. |
|
991 |
LastActiveProcess := thisProcess. |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
992 |
|
2046 | 993 |
gotSema == mySema ifTrue:[ |
994 |
"/ |
|
995 |
"/ an event for me |
|
996 |
"/ |
|
997 |
self processEventsWithModalGroup:nil |
|
998 |
] ifFalse:[ |
|
999 |
"/ |
|
1000 |
"/ an event for my mainGroup |
|
1001 |
"/ |
|
1002 |
mainGroup topViews notNil ifTrue:[ |
|
1003 |
mainView := mainGroup topViews first |
|
1004 |
]. |
|
1005 |
mainView notNil ifTrue:[ |
|
1006 |
"/ |
|
1007 |
"/ if anything happened to the mainGroup |
|
1008 |
"/ bring my own topView back to the front |
|
1009 |
"/ This keeps modalBoxes visible |
|
1010 |
"/ |
|
1011 |
(mainGroup sensor hasConfigureEventFor:mainView) ifTrue:[ |
|
1012 |
topViews size > 0 ifTrue:[ |
|
1013 |
topViews first raiseDeiconified |
|
1014 |
] |
|
1015 |
] |
|
1016 |
]. |
|
1017 |
" |
|
1018 |
if modal, also check for redraw events in my maingroup |
|
1019 |
(we arrive here after we woke up on maingroup sensor eventSemaphore) |
|
1020 |
" |
|
1021 |
mainGroup processEventsWithModalGroup:self. |
|
1022 |
] |
|
1023 |
]. |
|
1024 |
]. |
|
244 | 1025 |
] valueNowOrOnUnwindDo:[ |
2046 | 1026 |
"/ |
1027 |
"/ perform any cleanupActions |
|
1028 |
"/ |
|
1029 |
cleanupActions notNil ifTrue:[cleanupActions value] |
|
244 | 1030 |
] |
313 | 1031 |
|
325
b24d9a1c74dc
stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents:
324
diff
changeset
|
1032 |
"Modified: 14.12.1995 / 11:12:24 / stefan" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1033 |
"Modified: 20.8.1997 / 19:10:23 / cg" |
244 | 1034 |
! |
1035 |
||
1036 |
leaveEventLoop |
|
1037 |
"immediately leave the event loop, returning way back. |
|
1038 |
This can be used to leave (and closedown) a modal group. |
|
1039 |
(for normal views, this does not make sense)" |
|
1040 |
||
1041 |
^ LeaveSignal raise |
|
1042 |
! |
|
1043 |
||
103 | 1044 |
processEvents |
1045 |
"process events from either the damage- or user input queues. |
|
1046 |
Abort is assumed to be handled elsewhere." |
|
19 | 1047 |
|
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1048 |
self processEventsWithModalGroup:nil |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1049 |
|
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1050 |
"Modified: 5.3.1997 / 11:33:51 / cg" |
1328 | 1051 |
! |
1052 |
||
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1053 |
processEventsWithModalGroup:modalGroup |
1328 | 1054 |
"process events from either the damage- or user input queues. |
1868 | 1055 |
Abort is assumed to be handled elsewhere." |
1328 | 1056 |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1057 |
<resource: #keyboard (#Escape )> |
496 | 1058 |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1059 |
|event ignore key focus modalTops modalTop modalDelegate syntheticEvent| |
11 | 1060 |
|
72 | 1061 |
self processExposeEvents. |
180 | 1062 |
|
72 | 1063 |
[mySensor hasEvents] whileTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1064 |
event := mySensor nextEvent. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1065 |
event notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1066 |
ignore := false. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1067 |
focus := focusView. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1068 |
modalDelegate := false. |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1069 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1070 |
modalGroup notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1071 |
"/ an incoming event for a masterView, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1072 |
"/ while being blocked by some other modalView. |
1328 | 1073 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1074 |
modalTops := modalGroup topViews. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1075 |
modalTops size > 0 ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1076 |
modalTop := modalTops first. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1077 |
]. |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1078 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1079 |
event isKeyEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1080 |
"/ forward keyboard events to my modal |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1081 |
"/ groups first topView ... |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1082 |
modalTop notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1083 |
focus := modalTop. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1084 |
modalDelegate := true. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1085 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1086 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1087 |
event isFocusEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1088 |
event isFocusInEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1089 |
"/ focusIn is forwarded to the modalGroup |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1090 |
"/ (since keyboard is forwarded) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1091 |
event view:modalTop. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1092 |
focus := modalTop. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1093 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1094 |
"/ focusOut goes to both the modal and |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1095 |
"/ the blocked main-group |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1096 |
"/ (actually, only the very first focusOut |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1097 |
"/ is needed in the mainGroup (to turn off the cursor) |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1098 |
"/ all others are only needed in the modalGroup) |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1099 |
"/ syntheticEvent := event copy. |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1100 |
"/ syntheticEvent view:modalTop. |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1101 |
"/ LastEventQuerySignal handle:[:ex | |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1102 |
"/ ex proceedWith:syntheticEvent |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1103 |
"/ ] do:[ |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1104 |
"/ syntheticEvent sendEventWithFocusOn:nil. |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1105 |
"/ ]. |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1106 |
event view:modalTop. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1107 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1108 |
modalDelegate := true. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1109 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1110 |
event isPointerLeaveEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1111 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1112 |
event isUserEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1113 |
ignore := true |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1114 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1115 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1116 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1117 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1118 |
]. |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1119 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1120 |
ignore ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1121 |
(views notNil or:[topViews notNil]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1122 |
LastEventQuerySignal handle:[:ex | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1123 |
ex proceedWith:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1124 |
] do:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1125 |
(preEventHook notNil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1126 |
and:[preEventHook processEvent:event]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1127 |
ignore := true. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1128 |
]. |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1129 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1130 |
ignore ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1131 |
event isKeyPressEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1132 |
key := event key. |
1110 | 1133 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1134 |
key == #Escape ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1135 |
modalDelegate ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1136 |
modalTop hideRequest |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1137 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1138 |
isModal ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1139 |
topViews first hideRequest |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1140 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1141 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1142 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1143 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1144 |
event isPointerEnterEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1145 |
pointerView := event view |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1146 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1147 |
event isPointerLeaveEvent ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1148 |
pointerView := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1149 |
]. |
172 | 1150 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1151 |
ignore ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1152 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1153 |
"/ buttonPress events turn off explicit focus, and revert |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1154 |
"/ to implicit focus control |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1155 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1156 |
(focusView notNil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1157 |
and:[event isButtonPressEvent]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1158 |
self focusView:nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1159 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1160 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1161 |
"/ let the event forward itself |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1162 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1163 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1164 |
LastActiveProcess := Processor activeProcess. |
1411
86559faec840
handle non-view events (ST-80 support)
Claus Gittinger <cg@exept.de>
parents:
1387
diff
changeset
|
1165 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1166 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1167 |
if there is no view information in the event, |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1168 |
it must have been sent directly to the sensor. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1169 |
Send it to the first topView. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1170 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1171 |
event view isNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1172 |
topViews first notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1173 |
topViews first perform:event type withArguments:event arguments |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1174 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1175 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1176 |
event sendEventWithFocusOn:focus. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1177 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1178 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1179 |
]. |
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1180 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1181 |
postEventHook notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1182 |
postEventHook processEvent:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1183 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1184 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1185 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1186 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1187 |
event := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1188 |
]. |
72 | 1189 |
] |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
1190 |
|
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1191 |
"Created: 5.3.1997 / 11:33:11 / cg" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1192 |
"Modified: 20.8.1997 / 15:23:31 / cg" |
48 | 1193 |
! |
1194 |
||
1195 |
processExposeEvents |
|
103 | 1196 |
"process only expose events from the damage queue" |
48 | 1197 |
|
180 | 1198 |
|event view rect x y w h sensor thisProcess| |
109 | 1199 |
|
1200 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
|
48 | 1201 |
|
180 | 1202 |
thisProcess := Processor activeProcess. |
1203 |
||
1204 |
[sensor hasDamage] whileTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1205 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1206 |
LastActiveProcess := thisProcess. |
180 | 1207 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1208 |
event := sensor nextDamage. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1209 |
event notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1210 |
(views notNil or:[topViews notNil]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1211 |
LastEventQuerySignal handle:[:ex | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1212 |
ex proceedWith:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1213 |
] do:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1214 |
(preEventHook notNil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1215 |
and:[preEventHook processEvent:event]) ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1216 |
event isDamage ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1217 |
view := event view. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1218 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1219 |
"/ if the view is no longer shown (iconified or closed), |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1220 |
"/ this is a leftover event and ignored. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1221 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1222 |
view shown ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1223 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1224 |
LastActiveProcess := thisProcess. |
1868 | 1225 |
|
1226 |
"/ rect := event rectangle. |
|
1227 |
"/ x := rect left. |
|
1228 |
"/ y := rect top. |
|
1229 |
"/ w := rect width. |
|
1230 |
"/ h := rect height. |
|
1231 |
"/ |
|
1232 |
"/ view transformation notNil ifTrue:[ |
|
1233 |
"/ view deviceExposeX:x y:y width:w height:h |
|
1234 |
"/ ] ifFalse:[ |
|
1235 |
"/ view exposeX:x y:y width:w height:h |
|
1236 |
"/ ] |
|
1237 |
||
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1238 |
event sendEventWithFocusOn:nil. |
1868 | 1239 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1240 |
] ifFalse:[ |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1241 |
"/ ('WGROUP: damage for ' , view displayString , ' ignored') infoPrintCR. |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1242 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1243 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1244 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1245 |
mhmh - could we possibly arrive here ? |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1246 |
" |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1247 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1248 |
LastActiveProcess := thisProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1249 |
event sendEventWithFocusOn:nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1250 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1251 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1252 |
postEventHook notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1253 |
postEventHook processEvent:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1254 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1255 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1256 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1257 |
] |
90 | 1258 |
] |
1157 | 1259 |
|
1868 | 1260 |
"Modified: 18.8.1997 / 15:53:08 / cg" |
11 | 1261 |
! |
1262 |
||
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1263 |
processRealExposeEvents |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1264 |
"process only expose events from the damage queue |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1265 |
(for any of my views). |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1266 |
This is required after a scroll operation, |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1267 |
to wait for either a noExpose or a real expose." |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1268 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1269 |
|event view rect x y w h sensor thisProcess| |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1270 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1271 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1272 |
sensor hasDamage ifFalse:[^ self]. |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1273 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1274 |
thisProcess := Processor activeProcess. |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1275 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1276 |
[true] whileTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1277 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1278 |
LastActiveProcess := thisProcess. |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1279 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1280 |
"/ event := aView nextDamage. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1281 |
event := sensor nextExposeEventFor:nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1282 |
event isNil ifTrue:[^ self]. |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1283 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1284 |
(views notNil or:[topViews notNil]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1285 |
LastEventQuerySignal handle:[:ex | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1286 |
ex proceedWith:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1287 |
] do:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1288 |
(preEventHook notNil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1289 |
and:[preEventHook processEvent:event]) ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1290 |
view := event view. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1291 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1292 |
"/ if the view is no longer shown (iconified or closed), |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1293 |
"/ this is a leftover event and ignored. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1294 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1295 |
view shown ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1296 |
rect := event rectangle. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1297 |
x := rect left. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1298 |
y := rect top. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1299 |
w := rect width. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1300 |
h := rect height. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1301 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1302 |
LastActiveProcess := thisProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1303 |
view transformation notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1304 |
view deviceExposeX:x y:y width:w height:h |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1305 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1306 |
view exposeX:x y:y width:w height:h |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1307 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1308 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1309 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1310 |
postEventHook notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1311 |
postEventHook processEvent:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1312 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1313 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1314 |
] |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1315 |
] |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1316 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1317 |
"Created: 2.7.1997 / 14:32:19 / cg" |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1318 |
"Modified: 2.7.1997 / 14:33:48 / cg" |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1319 |
! |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1320 |
|
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1321 |
processRealExposeEventsFor:aViewOrNil |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1322 |
"process only expose events from the damage queue |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1323 |
(for any of my views). |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1324 |
This is required after a scroll operation, |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1325 |
to wait for either a noExpose or a real expose." |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1326 |
|
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1327 |
|event view rect x y w h sensor thisProcess| |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1328 |
|
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1329 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1330 |
sensor hasDamage ifFalse:[^ self]. |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1331 |
|
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1332 |
thisProcess := Processor activeProcess. |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1333 |
|
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1334 |
[true] whileTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1335 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1336 |
LastActiveProcess := thisProcess. |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1337 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1338 |
"/ event := aView nextDamage. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1339 |
event := sensor nextExposeEventFor:aViewOrNil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1340 |
event isNil ifTrue:[^ self]. |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1341 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1342 |
(views notNil or:[topViews notNil]) ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1343 |
LastEventQuerySignal handle:[:ex | |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1344 |
ex proceedWith:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1345 |
] do:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1346 |
(preEventHook notNil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1347 |
and:[preEventHook processEvent:event]) ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1348 |
view := event view. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1349 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1350 |
"/ if the view is no longer shown (iconified or closed), |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1351 |
"/ this is a leftover event and ignored. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1352 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1353 |
event isDamage ifFalse:[ |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1354 |
'OOPS2 - noDamage' printCR. |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1355 |
]. |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1356 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1357 |
view shown ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1358 |
rect := event rectangle. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1359 |
x := rect left. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1360 |
y := rect top. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1361 |
w := rect width. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1362 |
h := rect height. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1363 |
LastActiveGroup := self. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1364 |
LastActiveProcess := thisProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1365 |
view transformation notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1366 |
view deviceExposeX:x y:y width:w height:h |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1367 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1368 |
view exposeX:x y:y width:w height:h |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1369 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1370 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1371 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1372 |
postEventHook notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1373 |
postEventHook processEvent:event |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1374 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1375 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1376 |
] |
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1377 |
] |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1378 |
|
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1379 |
"Created: 2.7.1997 / 14:32:19 / cg" |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1380 |
"Modified: 6.8.1997 / 19:49:59 / cg" |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1381 |
! |
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1382 |
|
28 | 1383 |
waitForExposeFor:aView |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1384 |
"wait for a noExpose event for aView, then process all exposes. |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1385 |
To be used after a scroll. |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1386 |
This is very Xspecific and not needed with other systems |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1387 |
(i.e. a synthetic noExpose may be generated there)." |
28 | 1388 |
|
1389 |
mySensor waitForExposeFor:aView. |
|
90 | 1390 |
AbortSignal catch:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1391 |
self processRealExposeEventsFor:aView |
90 | 1392 |
] |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1393 |
|
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1394 |
"Modified: 6.8.1997 / 19:50:24 / cg" |
11 | 1395 |
! ! |
19 | 1396 |
|
90 | 1397 |
!WindowGroup methodsFor:'focus control'! |
1398 |
||
244 | 1399 |
focusNext |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1400 |
"give focus to the next view in the focusSequence. |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1401 |
Skip invisible views." |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1402 |
|
1946 | 1403 |
|index "{ Class: SmallInteger }" |
1404 |
lastIndex "{ Class: SmallInteger }" |
|
1405 |
index0 next sequence| |
|
244 | 1406 |
|
1946 | 1407 |
sequence := self focusSequence. |
1408 |
(lastIndex := sequence size) == 0 ifTrue:[^ self]. |
|
244 | 1409 |
|
1410 |
focusView notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1411 |
index := index0 := (sequence identityIndexOf:focusView). |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1412 |
] ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1413 |
index := 0. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1414 |
]. |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1415 |
|
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1416 |
[next isNil] whileTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1417 |
index := index + 1. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1418 |
index > lastIndex ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1419 |
index := 1. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1420 |
index0 isNil ifTrue:[^ self]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1421 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1422 |
index == index0 ifTrue:[^ self]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1423 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1424 |
next := (sequence at:index). |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1425 |
next realized not ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1426 |
next := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1427 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1428 |
next enabled ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1429 |
next := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1430 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1431 |
] |
244 | 1432 |
]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1433 |
|
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1434 |
self focusView:next |
244 | 1435 |
|
1436 |
" |
|
1437 |
|top v1 v2| |
|
1438 |
||
1439 |
top := StandardSystemView new. |
|
1440 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
1441 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
1442 |
top open. |
|
1443 |
top windowGroup focusSequence:(Array with:v1 with:v2). |
|
1444 |
top windowGroup focusOn:v1. |
|
1445 |
(Delay forSeconds:10) wait. |
|
1446 |
top windowGroup focusNext. |
|
1447 |
" |
|
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1448 |
|
1946 | 1449 |
"Modified: / 31.10.1997 / 19:22:34 / cg" |
244 | 1450 |
! |
1451 |
||
1452 |
focusPrevious |
|
1453 |
"give focus to previous view in focusSequence" |
|
1454 |
||
1946 | 1455 |
|index "{ Class: SmallInteger }" |
1456 |
lastIndex "{ Class: SmallInteger }" |
|
1457 |
prev index0 sequence| |
|
244 | 1458 |
|
1946 | 1459 |
sequence := self focusSequence. |
1460 |
(lastIndex := sequence size) == 0 ifTrue:[^ self]. |
|
507
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1461 |
|
244 | 1462 |
focusView notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1463 |
index := index0 := (sequence identityIndexOf:focusView). |
244 | 1464 |
] ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1465 |
index := lastIndex + 1. |
244 | 1466 |
]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1467 |
|
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1468 |
[prev isNil] whileTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1469 |
index := index - 1. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1470 |
index < 1 ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1471 |
index := lastIndex. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1472 |
index0 isNil ifTrue:[^ self]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1473 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1474 |
index == index0 ifTrue:[^ self]. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1475 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1476 |
prev := (sequence at:index). |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1477 |
prev realized not ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1478 |
prev := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1479 |
] ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1480 |
prev enabled ifFalse:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1481 |
prev := nil |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1482 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1483 |
]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1484 |
]. |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1485 |
|
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1486 |
self focusView:prev |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1487 |
|
1946 | 1488 |
"Modified: / 31.10.1997 / 19:21:50 / cg" |
244 | 1489 |
! |
1490 |
||
135 | 1491 |
focusSequence |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1492 |
"return my focus sequence for focusNext/focusPrevious. |
135 | 1493 |
Focus is stepped in the order in which subviews occur in |
1494 |
the sequence" |
|
1495 |
||
1946 | 1496 |
|sequence| |
1497 |
||
1498 |
"/ a fix focusSequence ... |
|
507
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1499 |
focusSequence notNil ifTrue:[^ focusSequence]. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1500 |
|
507
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1501 |
topViews do:[:top | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1502 |
sequence := top focusSequence. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1503 |
sequence notNil ifTrue:[^ sequence]. |
507
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1504 |
]. |
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1505 |
|
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1506 |
^ nil |
5098d8e9be3c
oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1507 |
|
1946 | 1508 |
"Modified: / 31.10.1997 / 20:37:54 / cg" |
135 | 1509 |
! |
1510 |
||
90 | 1511 |
focusSequence:aSequenceableCollection |
1512 |
"define the focus sequence for focusNext/focusPrevious. |
|
1513 |
Focus is stepped in the order in which subviews occur in |
|
1946 | 1514 |
the sequence." |
90 | 1515 |
|
1516 |
focusSequence := aSequenceableCollection |
|
1946 | 1517 |
|
1518 |
"Modified: / 31.10.1997 / 20:40:04 / cg" |
|
90 | 1519 |
! |
1520 |
||
1521 |
focusView |
|
135 | 1522 |
"return the view which currently has the focus" |
90 | 1523 |
|
1524 |
^ focusView |
|
1525 |
! |
|
1526 |
||
1527 |
focusView:aViewOrNil |
|
1528 |
"give focus to aViewOrNil" |
|
1529 |
||
410
9d9d03fa5d82
moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1530 |
focusView == aViewOrNil ifTrue:[^ self]. |
9d9d03fa5d82
moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1531 |
|
90 | 1532 |
focusView notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1533 |
"/ lost explicit focus |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1534 |
focusView == aViewOrNil ifTrue:[^ self]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1535 |
focusView showNoFocus:true. |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
1536 |
] ifFalse:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1537 |
pointerView notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1538 |
pointerView ~~ aViewOrNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1539 |
"/ lost implicit focus |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1540 |
pointerView showNoFocus:false |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1541 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1542 |
]. |
90 | 1543 |
]. |
387
aa80487842b8
compile event classes with optSpace;
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1544 |
|
90 | 1545 |
focusView := aViewOrNil. |
1546 |
focusView notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1547 |
"/ got explicit focus |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1548 |
focusView showFocus:true. |
90 | 1549 |
]. |
1550 |
||
1551 |
" |
|
1552 |
|top v1 v2| |
|
1553 |
||
1554 |
top := StandardSystemView new. |
|
1555 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
1556 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
1557 |
top open. |
|
1558 |
top windowGroup focusView:v1. |
|
1559 |
" |
|
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
1560 |
|
777
4d0b66f65346
search in focusSequence for identical view - who knows
Claus Gittinger <cg@exept.de>
parents:
743
diff
changeset
|
1561 |
"Modified: 31.5.1996 / 21:13:25 / cg" |
244 | 1562 |
! ! |
1563 |
||
1564 |
!WindowGroup methodsFor:'initialization'! |
|
1565 |
||
1566 |
initialize |
|
1567 |
"setup the windowgroup, by creating a new sensor |
|
1568 |
and an event semaphore" |
|
1569 |
||
1570 |
mySensor := WindowSensor new. |
|
1273 | 1571 |
mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema'). |
244 | 1572 |
isModal := false. |
417 | 1573 |
isForModalSubview := false. |
1273 | 1574 |
|
1575 |
"Modified: 25.1.1997 / 00:20:19 / cg" |
|
90 | 1576 |
! |
1577 |
||
244 | 1578 |
reinitialize |
1579 |
"reinitialize the windowgroup after an image restart" |
|
90 | 1580 |
|
244 | 1581 |
"throw away old (zombie) process" |
1582 |
myProcess notNil ifTrue:[ |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1583 |
"/ careful: the old processes exit-actions must be cleared. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1584 |
"/ otherwise, it might do destroy or other actions when it |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1585 |
"/ gets finalized ... |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1586 |
|
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1587 |
"/ myProcess removeAllExitActions. |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1588 |
myProcess removeAllSuspendActions. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1589 |
myProcess := nil. |
244 | 1590 |
]. |
90 | 1591 |
|
244 | 1592 |
"throw away old events" |
1593 |
mySensor reinitialize |
|
313 | 1594 |
|
1595 |
"Modified: 13.12.1995 / 13:45:35 / stefan" |
|
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1596 |
"Modified: 12.1.1997 / 00:45:01 / cg" |
90 | 1597 |
! ! |
1598 |
||
19 | 1599 |
!WindowGroup methodsFor:'printing'! |
1600 |
||
90 | 1601 |
printOn:aStream |
19 | 1602 |
"return a printed representation; |
144 | 1603 |
just for more user friendlyness: add name of process." |
19 | 1604 |
|
90 | 1605 |
myProcess isNil ifTrue:[ |
1606 |
(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[ |
|
1607 |
aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')'). |
|
1608 |
^ self. |
|
1609 |
]. |
|
1610 |
^ super printOn:aStream |
|
1611 |
]. |
|
1612 |
aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')') |
|
19 | 1613 |
! ! |
244 | 1614 |
|
1615 |
!WindowGroup methodsFor:'special'! |
|
1616 |
||
1617 |
restoreCursors |
|
1618 |
"restore the original cursors in all of my views" |
|
1619 |
||
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
1620 |
self allViewsDo:[:aView | |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1621 |
|c dev id cid| |
244 | 1622 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1623 |
dev := aView graphicsDevice. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1624 |
dev notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1625 |
(id := aView id) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1626 |
c := aView cursor onDevice:dev. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1627 |
(cid := c id) notNil ifTrue:[ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1628 |
dev setCursor:cid in:id. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1629 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1630 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1631 |
] |
244 | 1632 |
]. |
743 | 1633 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1472
diff
changeset
|
1634 |
"Modified: 28.3.1997 / 13:48:51 / cg" |
244 | 1635 |
! |
1636 |
||
328 | 1637 |
showActivity:someMessage |
597 | 1638 |
"some activityNotification shalt be communicated to |
1639 |
the user; |
|
1640 |
forward it to my first topView if there is one |
|
1641 |
(that one should know how to deal with it)" |
|
1642 |
||
328 | 1643 |
topViews notNil ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1644 |
topViews first showActivity:someMessage |
328 | 1645 |
] |
1646 |
||
1647 |
"Created: 16.12.1995 / 18:39:40 / cg" |
|
597 | 1648 |
"Modified: 23.4.1996 / 21:36:54 / cg" |
328 | 1649 |
! |
1650 |
||
244 | 1651 |
showCursor:aCursor |
1652 |
"change the cursor to aCursor in all of my views." |
|
1653 |
||
2051
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1654 |
|c cId vId dev| |
244 | 1655 |
|
1656 |
c := aCursor. |
|
1657 |
self allViewsDo:[:aView | |
|
2051
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1658 |
dev := aView graphicsDevice. |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1659 |
dev notNil ifTrue:[ |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1660 |
c := c onDevice:dev. |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1661 |
(cId := c id) notNil ifTrue:[ |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1662 |
(vId := aView id) notNil ifTrue:[ |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1663 |
dev setCursor:cId in:vId. |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1664 |
] |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1665 |
] |
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1666 |
] |
244 | 1667 |
]. |
743 | 1668 |
|
2051
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1669 |
"Modified: / 7.2.1998 / 13:49:36 / cg" |
244 | 1670 |
! |
1671 |
||
1672 |
withCursor:aCursor do:aBlock |
|
1673 |
"evaluate aBlock while showing aCursor in all |
|
1674 |
my views (used to show wait-cursor while doing something). |
|
1675 |
Return the result as returned by aBlock." |
|
1676 |
||
1986 | 1677 |
|oldCursors dev deviceCursor action| |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1678 |
|
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
1679 |
dev := self graphicsDevice. |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1680 |
dev isNil ifTrue:[ |
1986 | 1681 |
^ aBlock value |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1682 |
]. |
244 | 1683 |
|
1652 | 1684 |
deviceCursor := aCursor onDevice:dev. |
1685 |
||
244 | 1686 |
" |
1687 |
get mapping of view->cursor for all of my subviews |
|
1688 |
" |
|
1689 |
oldCursors := IdentityDictionary new. |
|
1690 |
self allViewsDo:[:aView | |
|
1986 | 1691 |
|old| |
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
1692 |
|
1986 | 1693 |
old := aView cursor. |
1694 |
old ~~ aCursor ifTrue:[ |
|
1695 |
oldCursors at:aView put:old. |
|
1696 |
aView cursor:deviceCursor now:false |
|
1697 |
] |
|
244 | 1698 |
]. |
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
1699 |
|
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
1700 |
oldCursors size == 0 ifTrue:[ |
1986 | 1701 |
action := aBlock |
1702 |
] ifFalse:[ |
|
1703 |
action := [ |
|
1704 |
|rslt| |
|
1705 |
||
1706 |
"/ |
|
1707 |
"/ here sync looks better; flush leads to almost invisible cursors when accepting. |
|
1708 |
"/ I dont really know why (maybe unix does not context-switch to the Xserver |
|
1709 |
"/ early enough after the requests have been sent ?) |
|
1710 |
"/ |
|
1711 |
dev sync. |
|
1712 |
||
1713 |
rslt := aBlock valueNowOrOnUnwindDo:[ |
|
1714 |
" |
|
1715 |
restore cursors from the mapping |
|
1716 |
" |
|
1717 |
oldCursors keysAndValuesDo:[:view :cursor | |
|
1718 |
view cursor:cursor now:false. |
|
1719 |
]. |
|
1720 |
dev flush |
|
1721 |
]. |
|
1722 |
rslt |
|
1723 |
] |
|
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
1724 |
]. |
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
1725 |
|
1987
49cdfda40715
oops - a modal group could have a nil-mainGroup
Claus Gittinger <cg@exept.de>
parents:
1986
diff
changeset
|
1726 |
(self isModal and:[previousGroup notNil]) ifTrue:[ |
1986 | 1727 |
"/ pass the work to my parentGroup |
1987
49cdfda40715
oops - a modal group could have a nil-mainGroup
Claus Gittinger <cg@exept.de>
parents:
1986
diff
changeset
|
1728 |
^ previousGroup withCursor:aCursor do:action |
1986 | 1729 |
]. |
1730 |
^ action value. |
|
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
1731 |
|
1987
49cdfda40715
oops - a modal group could have a nil-mainGroup
Claus Gittinger <cg@exept.de>
parents:
1986
diff
changeset
|
1732 |
"Modified: / 19.1.1998 / 17:32:03 / cg" |
408 | 1733 |
! |
1734 |
||
1735 |
withWaitCursorDo:aBlock |
|
1736 |
"evaluate aBlock while showing a waitCursor in all |
|
1737 |
my views (used to show wait-cursor while doing something time consuming). |
|
1738 |
Return the result as returned by aBlock." |
|
1739 |
||
1740 |
^ self withCursor:(Cursor wait) do:aBlock |
|
1741 |
||
1742 |
"Created: 6.2.1996 / 19:51:53 / cg" |
|
244 | 1743 |
! ! |
1744 |
||
1745 |
!WindowGroup methodsFor:'special accessing'! |
|
1746 |
||
429 | 1747 |
isForModalSubview |
1748 |
"special for windowgroups for modal subviews. |
|
1749 |
These must be flagged specially to avoid the views being reassigned |
|
1750 |
to the maingroup. |
|
1751 |
This is a private interface to the SimpleView class" |
|
1752 |
||
1753 |
^ isForModalSubview |
|
1754 |
! |
|
1755 |
||
1756 |
isForModalSubview:aBoolean |
|
1757 |
"special for windowgroups for modal subviews. |
|
1758 |
These must be flagged specially to avoid the views being reassigned |
|
1759 |
to the maingroup. |
|
1760 |
This is a private interface to the SimpleView class" |
|
1761 |
||
1762 |
isForModalSubview := aBoolean |
|
1763 |
! |
|
1764 |
||
244 | 1765 |
setModal:aBoolean |
1766 |
"special entry for debugger: set the modal flag. |
|
1767 |
Not for public use" |
|
1768 |
||
1769 |
isModal := aBoolean |
|
1770 |
||
1771 |
"Modified: 3.9.1995 / 14:51:04 / claus" |
|
1772 |
! |
|
1773 |
||
1774 |
setPreviousGroup:aGroup |
|
1775 |
"special entry for debugger: |
|
1776 |
set the windowgroup that started this group (for modal groups only). |
|
1777 |
This is not a public interface." |
|
1778 |
||
1779 |
previousGroup := aGroup |
|
1780 |
||
1781 |
"Modified: 3.9.1995 / 14:55:40 / claus" |
|
1782 |
! |
|
1783 |
||
1784 |
setProcess:aProcess |
|
1785 |
"special entry for debugger: set the windowGroups process. |
|
1786 |
Not for public use." |
|
1787 |
||
1788 |
myProcess := aProcess |
|
1789 |
||
1790 |
"Modified: 3.9.1995 / 14:25:38 / claus" |
|
1791 |
! ! |
|
1792 |
||
1110 | 1793 |
!WindowGroup class methodsFor:'documentation'! |
251 | 1794 |
|
1795 |
version |
|
2051
323362098e21
care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
1796 |
^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.129 1998-02-07 15:14:23 cg Exp $' |
251 | 1797 |
! ! |
244 | 1798 |
WindowGroup initialize! |