author | Claus Gittinger <cg@exept.de> |
Mon, 30 Oct 2000 12:51:41 +0100 | |
changeset 3352 | 47697e8eb891 |
parent 3349 | ba099abb6b5c |
child 3354 | 9c5bc350dec4 |
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 |
|
3212 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
11 | 15 |
Object subclass:#WindowGroup |
2857
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
16 |
instanceVariableNames:'graphicsDevice views topViews myProcess mySensor isModal |
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
17 |
previousGroup focusView focusSequence preEventHook postEventHook |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
18 |
pointerView isForModalSubview focusByTab groupHasFocus busyHook |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
19 |
busyHookTimeout inModalLoop' |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
20 |
classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
21 |
WindowGroupQuerySignal LastEventQuerySignal BusyHookTime' |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
22 |
poolDictionaries:'' |
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
23 |
category:'Interface-Support' |
11 | 24 |
! |
25 |
||
1110 | 26 |
!WindowGroup class methodsFor:'documentation'! |
46 | 27 |
|
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 31 |
All Rights Reserved |
46 | 32 |
|
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
103 | 44 |
In Smalltalk/X, the known (ST-80) concept of a controller has been |
297 | 45 |
extended (split) into a WindowGroup which handles process related stuff, |
46 |
and the Controller, which only handles events for a view and defines the user interaction. |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
47 |
The controller functionality might be (actually: often is) included in the view components. |
297 | 48 |
All interaction is via event queues - there is no polling in controllers (not even conceptionally). |
103 | 49 |
|
50 |
WindowGroups are responsible to wait for and forward events for a group of |
|
297 | 51 |
windows. All views in a windowGroup share a single windowSensor which holds the |
1503 | 52 |
event queue (therefore subviews all share the same input event queue). |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
53 |
Actually, there are two separate event queues - one for damage and view-visibility-related events, |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
54 |
another one for user interaction (such as mouse, keyboard etc.) |
144 | 55 |
|
297 | 56 |
The event queues are filled with incoming events as arriving from the physical display. |
57 |
This is done by a separate process (so called event-dispatcher) which runs at a higher |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
58 |
priority. The event dispatcher determines the queue into which an event has to be placed, |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
59 |
by asking the view for which the event is destined (via the views sensor). |
297 | 60 |
There may be multiple event dispatchers running (to support multiple displays); |
61 |
see the documentation/examples in DeviceWorkstation/XWorkstation on how this is done. |
|
62 |
||
103 | 63 |
Except for modal boxes, a separate process is created for each windowGroup |
297 | 64 |
which waits for events to arrive and processes them, by sending corresponding |
144 | 65 |
event messages to the views controller or the view (*). |
297 | 66 |
The controller is determined by asking the view (for which the event is destined); |
67 |
if the returned controller is nil, the event is sent directly to the view. |
|
68 |
This allows for simple views to work without a controller. |
|
69 |
(all of this is actually done in a WindowEvent method) |
|
70 |
||
71 |
Therefore, multiple applications run pseudo parallel. |
|
72 |
Even if some window performs a long time computation, events are still received |
|
73 |
and entered into the corresponding event queues (because the event dispatcher process |
|
74 |
runs at a higher priority). However, the actual processing of the event is only |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
75 |
possibly if no other process is busy at the same or a higher priority (unless timeslicing is enabled). |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
76 |
If timeslicing is off, it is possible to change a windowProcesses priority in order to give |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
77 |
other windows a chance to execute (some views do this while performing longtime actions). |
297 | 78 |
|
103 | 79 |
Modal boxes create an extra window group for the components of the modal |
297 | 80 |
box, but execute the event-processing loop for this new group in the original process - |
144 | 81 |
therefore, the original windowgroup is blocked for the duration of the modal |
297 | 82 |
interaction. |
83 |
However, the modal-event processing loop peeks into the original groups event queue |
|
84 |
from time to time, and handles expose events. Thus, even while blocked for user input, |
|
85 |
the original group continues to get update/redraw events. |
|
103 | 86 |
|
87 |
Normally, one windowgroup is associated to each topview (StandardSystemView) |
|
144 | 88 |
and all of its subviews. However, this is not strictly required; |
89 |
it is possible to create extra windowgroups for subviews, which will let them |
|
90 |
run in parallel |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
91 |
(for example, the FileBrowsers kill-Button is created that |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
92 |
way, to allow a kill of an executing unix command, while the browser |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
93 |
itself reads the pipeStream for incoming text. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
94 |
Even if the fileBrowser is busy reading the pipe, the killButton is still |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
95 |
working and allows terminating the pipe-read action). |
144 | 96 |
|
97 |
On the other hand, multiple topviews can be placed into the same windowGroup; |
|
98 |
which allows for multiview applications, of which only one communicates with |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
99 |
the user at a time (for example: the GUI painters canvas and gallery are in the same group). |
297 | 100 |
Multiple topviews within a windowGropup can be configured to behave like one |
101 |
unit with respect to iconification, deiconification and termination. |
|
102 |
This is done by creating multiple topViews in one group, and setting up a master/slave |
|
103 |
or partner relation among them (see TopView>>beSlave and TopView>>bePartner). |
|
103 | 104 |
|
109 | 105 |
WindowGroups also support a focus window: this is the one that gets the |
103 | 106 |
keyboard input - even if the cursor is located in another subview. |
512 | 107 |
The sequence is defined by the topView or its model (typically an applicationModel). |
108 |
It should return an orderedCollection of subviews when asked via #focusSequence. |
|
109 |
||
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
110 |
For debugging or special event manipulations, windowGroups allow for hooks to be installed |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
111 |
around the processing of events - preEventHook is sent a #procesEvent: message before an event is processed, |
512 | 112 |
postEventHook is informed after the event has been processed. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
113 |
The preEventHook should return a boolean - if it returns true, the event is considered |
512 | 114 |
being already processed by the hook and ignored. |
115 |
This allows for event-tracing, timing or even filtering (if preEventHook returns true). |
|
116 |
(notice: there is also an eventHook facility available in the sensor class.) |
|
103 | 117 |
|
118 |
Finally, windowgroups are the perfect place for things like defining a |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
119 |
cursor for all associated views, flushing all input, waiting for expose events etc. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
120 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
121 |
Late News: |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
122 |
a busyHook and busyHookTimeout has been added; this hook-(block) gets invoked, whenever |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
123 |
the process was busy handling an event for some time. This can be used to automatically install |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
124 |
a busy cursor (hour-glass) in an application, if some processing takes some time |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
125 |
(without a need for #withCursorDo: all over the place in the application) |
103 | 126 |
|
297 | 127 |
Dont get confused: |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
128 |
You dont have to care for all those details in the normal case; |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
129 |
a windowgroup is created for you automatically, when a view is opened. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
130 |
All of the internals are not required to be known for most applications. |
297 | 131 |
|
103 | 132 |
|
597 | 133 |
[instance variables:] |
144 | 134 |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
135 |
views collection of views of this group |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
136 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
137 |
topViews collection of topviews of this group |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
138 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
139 |
myProcess the process executing the events |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
140 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
141 |
mySensor my input sensor |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
142 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
143 |
isModal true if this is for a modal box |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
144 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
145 |
previousGroup if modal, the group that started this one |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
146 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
147 |
focusView the one that has the keyboard focus (or nil) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
148 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
149 |
focusByTab if focus came via tabbing |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
150 |
(as opposed to an implicit focus change) |
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
151 |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
152 |
focusSequence defines the focus sequence |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
153 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
154 |
preEventHook if non-nil, that one gets notified of incoming |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
155 |
events BEFORE an event is dispatched. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
156 |
May eat events (i.e. suppress dispatch) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
157 |
(hook for event filters or recorders) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
158 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
159 |
postEventHook if non-nil, that one gets notified |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
160 |
AFTER an event was dispatched. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
161 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
162 |
isForModalSubView |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
163 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
164 |
groupHasFocus true, if this windowGroup has the focus |
2506 | 165 |
|
103 | 166 |
|
597 | 167 |
[class variables:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
168 |
LeaveSignal if raised, a modal box leaves (closes) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
169 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
170 |
WindowGroupQuerySignal to ask for the current windowGroup, |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
171 |
anywhere in the program, simply raise this |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
172 |
signal. The raise returns nil, for processes, |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
173 |
which are not under control of a windowGroup. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
174 |
(i.e. wg := WindowGroup windowGroupQuerySignal raise) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
175 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
176 |
LastEventQuerySignal to ask for the event which was responsible |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
177 |
for being where you are (whereever that is). |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
178 |
The raise returns nil, if you did not arrive |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
179 |
there due to an event. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
180 |
(i.e. ev := WindowGroup lastEventQuerySignal raise) |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
181 |
The event can be asked for the view, the type |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
182 |
of event, x/y position etc. |
2506 | 183 |
|
184 |
||
144 | 185 |
(*) |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
186 |
due to historic reasons, many views have the controller functionality |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
187 |
integrated, and handle events themself. The windowSensor takes care |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
188 |
of this, by checking if a view has a controller, and, if so, forwarding |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
189 |
the events to it. Otherwise, events are sent directly to the view. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
190 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
191 |
In the future, all views will be rewritten to actually use a controller. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
192 |
Currently (being in the middle of this migration), only some views |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
193 |
(buttons, toggles and subclasses) do so. |
144 | 194 |
|
103 | 195 |
For more information, read 'introduction to view programming' in the |
196 |
doc/online directory. |
|
597 | 197 |
|
612 | 198 |
[author:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
199 |
Claus Gittinger |
612 | 200 |
|
597 | 201 |
[see also:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
202 |
WindowSensor WindowEvent EventListener KeyboardForwarder |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
203 |
DeviceWorkstation |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
204 |
View StandardSystemView |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
205 |
ApplicationModel |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
206 |
Process ProcessorScheduler |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
207 |
(``Working with processes (programmers manual)'': programming/processes.html#VIEWSNPROCS) |
46 | 208 |
" |
209 |
! ! |
|
210 |
||
1110 | 211 |
!WindowGroup class methodsFor:'initialization'! |
46 | 212 |
|
213 |
initialize |
|
214 |
LeaveSignal isNil ifTrue:[ |
|
2723 | 215 |
LeaveSignal := (Signal new) mayProceed:true. |
216 |
LeaveSignal nameClass:self message:#leaveSignal. |
|
217 |
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
|
218 |
|
2723 | 219 |
WindowGroupQuerySignal := QuerySignal new. |
220 |
WindowGroupQuerySignal nameClass:self message:#windowGroupQuerySignal. |
|
221 |
WindowGroupQuerySignal notifierString:'query for windowgroup'. |
|
1111 | 222 |
|
2723 | 223 |
LastEventQuerySignal := QuerySignal new. |
224 |
LastEventQuerySignal nameClass:self message:#lastEventQuerySignal. |
|
225 |
LastEventQuerySignal notifierString:'query for last event'. |
|
54 | 226 |
]. |
46 | 227 |
|
228 |
"WindowGroup initialize" |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
229 |
|
1111 | 230 |
"Modified: 9.11.1996 / 17:00:53 / cg" |
46 | 231 |
! ! |
232 |
||
1110 | 233 |
!WindowGroup class methodsFor:'instance creation'! |
244 | 234 |
|
235 |
new |
|
236 |
"create and return a new WindowGroup object" |
|
237 |
||
238 |
^ self basicNew initialize |
|
239 |
! ! |
|
240 |
||
1110 | 241 |
!WindowGroup class methodsFor:'Signal constants'! |
242 |
||
243 |
lastEventQuerySignal |
|
244 |
"return the signal which is used to query for the last event" |
|
245 |
||
246 |
^ LastEventQuerySignal |
|
247 |
||
248 |
"Created: 17.7.1996 / 20:36:04 / cg" |
|
249 |
! |
|
72 | 250 |
|
251 |
leaveSignal |
|
109 | 252 |
"return the signal which is used to exit a modal loop. |
1752 | 253 |
This private signal, is always caught while a modalbox is active. |
144 | 254 |
Raising it will exit the modal loop and return from the views #openModal |
255 |
method." |
|
109 | 256 |
|
72 | 257 |
^ LeaveSignal |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
258 |
! |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
259 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
260 |
windowGroupQuerySignal |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
261 |
"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
|
262 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
263 |
^ WindowGroupQuerySignal |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
264 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
265 |
"Created: 17.7.1996 / 20:36:04 / cg" |
72 | 266 |
! ! |
267 |
||
1110 | 268 |
!WindowGroup class methodsFor:'accessing'! |
26 | 269 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
270 |
activeApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
271 |
"return the currently active application. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
272 |
Notice: this may be a modal dialogs application - i.e. it is not |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
273 |
always the main application." |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
274 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
275 |
|activeGroup mainView| |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
276 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
277 |
(activeGroup := self activeGroup) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
278 |
(mainView := activeGroup mainView) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
279 |
^ mainView application |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
280 |
] |
3173
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
281 |
]. |
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
282 |
^ nil |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
283 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
284 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
285 |
WindowGroup activeApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
286 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
287 |
! |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
288 |
|
26 | 289 |
activeGroup |
180 | 290 |
"return the currently active windowGroup. |
291 |
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
|
292 |
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
|
293 |
(usually) the first group is returned (prefering a modal if there is one). |
180 | 294 |
(maybe we should return a collection of windowGroups here). |
295 |
||
296 |
This method is required to simulate the historic ST-80 single display |
|
297 |
behavior for Cursor>>show / Cursor>>showWhile and some others (raising the |
|
298 |
activeGroups topView when modalBoxes appear) on multiple display screens. |
|
299 |
These methods should change the cursor for the currently |
|
300 |
active windowGroup ONLY, instead of globally affecting the display or |
|
301 |
all views |
|
302 |
(since, depending on the priority, other views could be unaffacted by this |
|
303 |
and an overall cursor change does not make sense.)" |
|
304 |
||
305 |
|activeProcess groups wg| |
|
306 |
||
307 |
Processor isNil ifTrue:[^ nil]. "/ only during very early init phase |
|
26 | 308 |
|
180 | 309 |
activeProcess := Processor activeProcess. |
310 |
" caching the last value ..." |
|
565
6867f1a9a470
oops - leftover global LastActive
Claus Gittinger <cg@exept.de>
parents:
513
diff
changeset
|
311 |
activeProcess == LastActiveProcess ifTrue:[ |
3212 | 312 |
LastActiveGroup process == LastActiveProcess ifTrue:[ |
313 |
^ LastActiveGroup |
|
314 |
] |
|
180 | 315 |
]. |
1298
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
316 |
|
3212 | 317 |
WindowGroupQuerySignal isNil ifTrue:[^ nil]. "/ only during very early init phase |
2521
fe236fa74d5b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
2519
diff
changeset
|
318 |
wg := WindowGroupQuerySignal query. |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
319 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
320 |
wg isNil ifTrue:[ |
3212 | 321 |
"/ mhmh - noone willing to answer that question ... |
322 |
"/ (how can this happen ?) |
|
323 |
groups := self scheduledWindowGroups |
|
324 |
select:[:wg | wg process == activeProcess]. |
|
325 |
groups size == 1 ifTrue:[ |
|
326 |
wg := groups anElement |
|
327 |
] ifFalse:[ |
|
328 |
wg := groups detect:[:wg | wg isModal] ifNone:nil. |
|
329 |
wg isNil ifTrue:[ |
|
330 |
wg := groups anElement |
|
331 |
] |
|
332 |
]. |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
333 |
]. |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
334 |
|
180 | 335 |
wg notNil ifTrue:[ |
3212 | 336 |
LastActiveProcess := activeProcess. |
337 |
LastActiveGroup := wg. |
|
180 | 338 |
]. |
339 |
^ wg |
|
340 |
||
341 |
" |
|
342 |
WindowGroup activeGroup |
|
343 |
" |
|
344 |
||
2089 | 345 |
"Modified: / 3.9.1995 / 14:49:53 / claus" |
346 |
"Modified: / 17.4.1998 / 11:49:28 / cg" |
|
2521
fe236fa74d5b
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
2519
diff
changeset
|
347 |
"Modified: / 18.3.1999 / 18:30:33 / stefan" |
54 | 348 |
! |
349 |
||
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
350 |
activeMainApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
351 |
"return the currently active main application. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
352 |
Notice: |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
353 |
if invoked by a modal application, this returns the main (non-modal) |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
354 |
application." |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
355 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
356 |
|activeGroup mainView| |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
357 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
358 |
(activeGroup := self activeGroup) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
359 |
(mainView := activeGroup mainGroup mainView) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
360 |
^ mainView application |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
361 |
] |
3173
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
362 |
]. |
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
363 |
^ nil |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
364 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
365 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
366 |
WindowGroup activeMainApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
367 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
368 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
369 |
! |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
370 |
|
54 | 371 |
scheduledWindowGroups |
180 | 372 |
"return a collection of all windowGroups (possibly for different |
373 |
display devices) which are scheduled (i.e. which have a process |
|
374 |
running, handling events)." |
|
375 |
||
376 |
|set screens| |
|
377 |
||
378 |
screens := Screen allScreens. |
|
1869 | 379 |
screens size == 0 ifTrue:[^ #()]. |
180 | 380 |
|
381 |
set := IdentitySet new. |
|
382 |
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
|
383 |
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
|
384 |
|wg| |
109 | 385 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
386 |
(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
|
387 |
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
|
388 |
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
|
389 |
] |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
390 |
]. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
391 |
]. |
180 | 392 |
]. |
393 |
^ set asArray |
|
394 |
||
395 |
" |
|
396 |
WindowGroup scheduledWindowGroups |
|
397 |
" |
|
398 |
||
399 |
"Modified: 1.9.1995 / 13:43:09 / claus" |
|
1869 | 400 |
"Modified: 18.8.1997 / 18:44:29 / cg" |
244 | 401 |
! |
402 |
||
403 |
setActiveGroup:aGroup |
|
404 |
"set the currently active windowGroup. |
|
405 |
Temporary; do not use this interface, it will vanish." |
|
406 |
||
407 |
LastActiveProcess := Processor activeProcess. |
|
408 |
LastActiveGroup := aGroup |
|
26 | 409 |
! ! |
410 |
||
2723 | 411 |
!WindowGroup class methodsFor:'focus control support'! |
412 |
||
413 |
takeFocusFromDevice:aDevice |
|
414 |
|prevFocusView prevFocusGroup prevFocusCameViaTab| |
|
415 |
||
416 |
"/ |
|
417 |
"/ take the focus from whichEver view had it previously |
|
418 |
"/ |
|
419 |
prevFocusView := aDevice focusView. |
|
420 |
prevFocusView notNil ifTrue:[ |
|
421 |
(prevFocusView notNil |
|
422 |
and:[(prevFocusGroup := prevFocusView windowGroup) notNil]) ifTrue:[ |
|
423 |
prevFocusCameViaTab := prevFocusGroup focusCameByTab. |
|
424 |
||
425 |
prevFocusView showNoFocus:prevFocusCameViaTab. "/ true is bad - see pullDownMenu. |
|
426 |
prevFocusView hasKeyboardFocus:false. |
|
427 |
]. |
|
428 |
]. |
|
429 |
aDevice focusView:nil. |
|
430 |
! ! |
|
431 |
||
11 | 432 |
!WindowGroup methodsFor:'accessing'! |
433 |
||
512 | 434 |
device |
435 |
"return the device, we receive our events from" |
|
436 |
||
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
437 |
self obsoleteMethodWarning:'use #graphicsDevice'. |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
438 |
^ self graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
439 |
|
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
440 |
"Modified: 5.7.1996 / 17:53:58 / cg" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
441 |
! |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
442 |
|
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
443 |
graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
444 |
"return the device, we receive our events from" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
445 |
|
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
446 |
|dev| |
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
447 |
|
2857
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
448 |
graphicsDevice notNil ifTrue:[^ graphicsDevice]. |
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
449 |
|
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
450 |
topViews notNil ifTrue:[ |
3077 | 451 |
topViews do:[:v | |
452 |
|app| |
|
1116 | 453 |
|
3077 | 454 |
v notNil ifTrue:[ |
455 |
(app := v application) notNil ifTrue:[ |
|
456 |
"/ |
|
457 |
"/ ok, it has an application; |
|
458 |
"/ ask it for preferences. |
|
459 |
"/ |
|
460 |
(dev := app graphicsDevice) notNil ifTrue:[ |
|
461 |
^ (graphicsDevice := dev) |
|
462 |
] |
|
463 |
]. |
|
464 |
(dev := v graphicsDevice) notNil ifTrue:[ |
|
465 |
^ (graphicsDevice := dev) |
|
466 |
] |
|
467 |
] |
|
468 |
] |
|
512 | 469 |
]. |
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
470 |
views notNil ifTrue:[ |
3077 | 471 |
views do:[:v | |
472 |
v notNil ifTrue:[ |
|
473 |
(dev := v graphicsDevice) notNil ifTrue:[ |
|
474 |
^ (graphicsDevice := dev) |
|
475 |
] |
|
476 |
] |
|
477 |
] |
|
2170
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
478 |
]. |
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
479 |
"/ ask the previousGroup; I could be a popUp-views group, |
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
480 |
"/ which has already closed its views (and is performing its action) |
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
481 |
previousGroup notNil ifTrue:[ |
3077 | 482 |
^ previousGroup graphicsDevice |
512 | 483 |
]. |
484 |
^ nil |
|
485 |
||
2170
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
486 |
"Modified: / 9.7.1998 / 18:18:08 / cg" |
512 | 487 |
! |
488 |
||
489 |
isModal |
|
490 |
"return true, if the receiver is in a modal mode |
|
491 |
(i.e. for a modal box)" |
|
492 |
||
493 |
^ isModal |
|
494 |
||
495 |
"Modified: 7.3.1996 / 14:29:46 / cg" |
|
496 |
! |
|
497 |
||
2168
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
498 |
isPopUp |
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
499 |
"return true, if the receiver is for a popUp view" |
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
500 |
|
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
501 |
isModal ifFalse:[^ false]. |
3348 | 502 |
topViews isNil ifTrue:[^ true]. "/ a closed popup ... |
2168
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
503 |
^ topViews first isPopUpView |
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
504 |
|
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
505 |
"Created: / 9.7.1998 / 01:13:01 / cg" |
3348 | 506 |
"Modified: / 9.7.1998 / 01:17:11 / cg"! |
2168
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
507 |
|
512 | 508 |
mainGroup |
509 |
"return the main windowgroup (for modal groups only) |
|
510 |
that is the top one, which is not modal. |
|
511 |
NonModal groups return themSelf. |
|
512 |
||
513 |
There is one exception to this: the debugger (which is sort of modal) |
|
514 |
returns itself as mainGroup (not its debuggee)." |
|
515 |
||
516 |
|g prev| |
|
517 |
||
518 |
g := self. |
|
519 |
[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
|
520 |
g := prev |
512 | 521 |
]. |
522 |
^ g |
|
523 |
||
524 |
"Modified: 3.9.1995 / 14:57:20 / claus" |
|
525 |
"Modified: 7.3.1996 / 14:29:28 / cg" |
|
526 |
! |
|
527 |
||
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
528 |
mainGroup:aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
529 |
"set the main windowgroup (for modal/autonomous groups only) |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
530 |
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
|
531 |
as well." |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
532 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
533 |
previousGroup := aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
534 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
535 |
"Created: 20.8.1997 / 17:57:35 / cg" |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
536 |
! |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
537 |
|
512 | 538 |
previousGroup |
539 |
"return the windowgroup that started this group. (for modal groups only). |
|
540 |
This may be another modalGroup (for boxes opened by boxes). |
|
541 |
NonModal groups return nil." |
|
542 |
||
543 |
^ previousGroup |
|
544 |
||
545 |
"Modified: 7.3.1996 / 14:28:46 / cg" |
|
546 |
! |
|
547 |
||
548 |
process |
|
549 |
"return the windowGroups process" |
|
550 |
||
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
551 |
myProcess isNil ifTrue:[ |
2363
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
552 |
previousGroup notNil ifTrue:[ |
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
553 |
^ previousGroup process |
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
554 |
] |
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
555 |
]. |
512 | 556 |
^ myProcess |
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
557 |
|
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
558 |
"Modified: / 17.8.1998 / 10:21:29 / cg" |
512 | 559 |
! |
560 |
||
561 |
sensor |
|
562 |
"return the windowGroups sensor. |
|
563 |
All events for any of the groups views is handled by that sensor." |
|
564 |
||
565 |
^ mySensor |
|
566 |
||
567 |
"Modified: 7.3.1996 / 14:30:21 / cg" |
|
568 |
! |
|
569 |
||
570 |
sensor:aSensor |
|
571 |
"set the windowGroups sensor" |
|
572 |
||
573 |
mySensor := aSensor |
|
574 |
! ! |
|
575 |
||
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
576 |
!WindowGroup methodsFor:'accessing-hooks'! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
577 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
578 |
busyHook |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
579 |
"return the busyHook if any" |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
580 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
581 |
^ busyHook |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
582 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
583 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
584 |
busyHook:anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
585 |
"set the busyHook - this one will be invoked when the event-handling action |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
586 |
takes some time." |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
587 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
588 |
busyHook := anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
589 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
590 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
591 |
busyHookTimeout |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
592 |
"return the busyHooks timeout if any" |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
593 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
594 |
^ busyHookTimeout |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
595 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
596 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
597 |
busyHookTimeout:anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
598 |
"set the busyHooks timeout - the busyHook will be invoked when the event-handling action |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
599 |
takes longer than this time." |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
600 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
601 |
busyHookTimeout := anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
602 |
! |
512 | 603 |
|
604 |
postEventHook |
|
605 |
"return the postEventHook if any" |
|
606 |
||
607 |
^ postEventHook |
|
608 |
||
609 |
"Created: 7.3.1996 / 14:42:46 / cg" |
|
610 |
! |
|
611 |
||
612 |
postEventHook:anObject |
|
613 |
"set the postEventHook - this one will get all events |
|
614 |
passed after being processed here (via #processEvent:)." |
|
615 |
||
616 |
postEventHook := anObject |
|
617 |
! |
|
618 |
||
619 |
preEventHook |
|
620 |
"return the preEventHook if any" |
|
621 |
||
622 |
^ preEventHook |
|
623 |
||
624 |
"Created: 7.3.1996 / 14:42:42 / cg" |
|
625 |
! |
|
626 |
||
627 |
preEventHook:anObject |
|
628 |
"set the preEventHook - this one will get all events |
|
629 |
passed before being processed here (via #processEvent:). |
|
630 |
If this returns true, the event is supposed to be already |
|
631 |
processed and ignored here. |
|
632 |
Otherwise, it is processed as usual." |
|
633 |
||
634 |
preEventHook := anObject |
|
3280 | 635 |
! |
636 |
||
637 |
showWaitCursorWhenBusyForMillis:millis |
|
638 |
"setup a busyHook, which automatically shows a waitCursor, |
|
639 |
whenever some action takes longer than millis" |
|
640 |
||
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
641 |
self busyHookTimeout:millis. |
3280 | 642 |
self |
643 |
busyHook:[:isBusy | |
|
644 |
isBusy ifTrue:[ |
|
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
645 |
self showCursor:(Cursor wait). |
3280 | 646 |
] ifFalse:[ |
647 |
self restoreCursors |
|
648 |
] |
|
649 |
]. |
|
650 |
||
512 | 651 |
! ! |
652 |
||
653 |
!WindowGroup methodsFor:'accessing-views'! |
|
654 |
||
244 | 655 |
addTopView:aView |
656 |
"add a topview to the group" |
|
26 | 657 |
|
244 | 658 |
topViews isNil ifTrue:[ |
2723 | 659 |
topViews := OrderedCollection with:aView. |
2445 | 660 |
] ifFalse:[ |
2723 | 661 |
(topViews includesIdentical:aView) ifFalse:[ |
662 |
topViews add:aView |
|
663 |
] |
|
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
664 |
] |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
665 |
|
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
666 |
"Modified: 6.3.1996 / 15:35:15 / cg" |
26 | 667 |
! |
668 |
||
11 | 669 |
addView:aView |
26 | 670 |
"add aView to the windowGroup" |
671 |
||
11 | 672 |
views isNil ifTrue:[ |
3151 | 673 |
views := OrderedCollection with:aView. |
2445 | 674 |
] ifFalse:[ |
3151 | 675 |
(views includesIdentical:aView) ifFalse:[ |
676 |
views add:aView |
|
677 |
] |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
678 |
] |
11 | 679 |
! |
680 |
||
2445 | 681 |
mainView |
682 |
"return the mainview. Thats the first topView by default" |
|
683 |
||
684 |
topViews size == 0 ifTrue:[ ^ nil]. |
|
685 |
^ topViews first |
|
686 |
! |
|
687 |
||
26 | 688 |
removeView:aView |
689 |
"remove aView from the windowGroup; |
|
690 |
if this was the last view in this group, |
|
81 | 691 |
also shut down the corresponding process |
692 |
(actually, only wake it up here - it will terminate itself |
|
693 |
when finding out that all views are gone)" |
|
11 | 694 |
|
263 | 695 |
|sema| |
696 |
||
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
697 |
focusView == aView ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
698 |
focusView := nil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
699 |
]. |
3151 | 700 |
|
11 | 701 |
views notNil ifTrue:[ |
3151 | 702 |
views removeIdentical:aView ifAbsent:nil. |
703 |
views isEmpty ifTrue:[ |
|
704 |
views := nil |
|
705 |
] |
|
11 | 706 |
]. |
707 |
topViews notNil ifTrue:[ |
|
3151 | 708 |
topViews removeIdentical:aView ifAbsent:nil. |
709 |
topViews isEmpty ifTrue:[ |
|
710 |
topViews := nil |
|
711 |
] |
|
11 | 712 |
]. |
54 | 713 |
" |
714 |
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
|
715 |
removed (modalBoxes terminate their modalLoop if so) |
54 | 716 |
" |
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
717 |
mySensor notNil ifTrue:[ |
3151 | 718 |
(sema := mySensor eventSemaphore) notNil ifTrue:[ |
719 |
sema signal |
|
720 |
] |
|
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
721 |
] |
1304 | 722 |
|
723 |
"Modified: 1.2.1997 / 12:13:26 / cg" |
|
11 | 724 |
! |
725 |
||
244 | 726 |
topViews |
2445 | 727 |
"return the topviews associated to this windowGroup" |
172 | 728 |
|
244 | 729 |
^ topViews |
172 | 730 |
! |
731 |
||
244 | 732 |
views |
2445 | 733 |
"return the views associated to this windowGroup" |
172 | 734 |
|
244 | 735 |
^ views |
54 | 736 |
! ! |
737 |
||
244 | 738 |
!WindowGroup methodsFor:'activation / deactivation'! |
739 |
||
740 |
closeDownViews |
|
741 |
"destroy all views associated to this window group" |
|
742 |
||
743 |
topViews notNil ifTrue:[ |
|
3130
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
744 |
topViews copy do:[:aTopView | |
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
745 |
aTopView notNil ifTrue:[ |
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
746 |
aTopView destroy |
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
747 |
] |
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
748 |
] |
244 | 749 |
]. |
750 |
views := nil. |
|
751 |
topViews := nil. |
|
752 |
mySensor := nil. |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
753 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
754 |
"Modified: / 6.5.1999 / 09:47:18 / cg" |
3130
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
755 |
|
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
756 |
|
244 | 757 |
! |
758 |
||
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
759 |
modalDialogFinished |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
760 |
"invoked, when a modal dialog is closed" |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
761 |
|
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
762 |
inModalLoop := false. |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
763 |
! |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
764 |
|
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
765 |
modalDialogStarts |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
766 |
"invoked, when a modal dialog is opened" |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
767 |
|
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
768 |
inModalLoop := true. |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
769 |
! |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
770 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
771 |
realizeTopViews |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
772 |
"realize all topViews associated to this windowGroup." |
244 | 773 |
|
774 |
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
|
775 |
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
|
776 |
aView realize. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
777 |
]. |
244 | 778 |
]. |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
779 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
780 |
"Created: 24.7.1997 / 12:56:09 / cg" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
781 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
782 |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
783 |
restart |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
784 |
"restart after a snapin. |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
785 |
This re-creates the windowGroup process and informs |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
786 |
my views." |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
787 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
788 |
topViews notNil ifTrue:[ |
2723 | 789 |
" |
790 |
need a new semaphore, since obsolete processes |
|
791 |
(from our previous live) may still sit on the current semaphore |
|
792 |
" |
|
793 |
mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema'). |
|
794 |
isModal ifFalse:[ |
|
795 |
self startupWith:[self restartTopViews]. |
|
796 |
] |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
797 |
] |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
798 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
799 |
"Modified: / 6.5.1999 / 09:46:08 / cg" |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
800 |
! |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
801 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
802 |
restartTopViews |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
803 |
"inform all topViews associated to this windowGroup. |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
804 |
about the restart." |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
805 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
806 |
topViews notNil ifTrue:[ |
2723 | 807 |
topViews do:[:aView | |
808 |
aView isPopUpView ifFalse:[ |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
809 |
"/ aView realize. |
2723 | 810 |
aView restarted |
811 |
]. |
|
812 |
]. |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
813 |
]. |
180 | 814 |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
815 |
"Modified: / 6.5.1999 / 09:42:37 / cg" |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
816 |
"Created: / 6.5.1999 / 09:46:33 / cg" |
244 | 817 |
! |
180 | 818 |
|
582
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
819 |
shutDown |
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
820 |
"shutdown the window group; close all views and |
1317 | 821 |
terminate the process" |
244 | 822 |
|
823 |
|p| |
|
824 |
||
825 |
self closeDownViews. |
|
826 |
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
|
827 |
p := myProcess. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
828 |
myProcess := nil. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
829 |
p terminate. |
244 | 830 |
] |
582
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
831 |
|
dbb1d19a1065
obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents:
565
diff
changeset
|
832 |
"Created: 22.4.1996 / 17:58:37 / cg" |
1317 | 833 |
"Modified: 8.2.1997 / 16:46:31 / cg" |
180 | 834 |
! |
835 |
||
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
836 |
startupModal:checkBlock |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
837 |
"startup the window-group in a modal loop |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
838 |
(i.e. under the currently running process); |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
839 |
checkBlock is evaluated and the modal loop is left, |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
840 |
whenever false is returned." |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
841 |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
842 |
^ self startupModal:checkBlock forGroup:(WindowGroup activeGroup). |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
843 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
844 |
"Created: 10.12.1995 / 14:15:11 / cg" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
845 |
"Modified: 20.8.1997 / 17:54:33 / cg" |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
846 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
847 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
848 |
startupModal:checkBlock forGroup:mainGroup |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
849 |
"startup the window-group in a modal loop |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
850 |
(i.e. under the currently running process); |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
851 |
checkBlock is evaluated and loop is left, when false is |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
852 |
returned. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
853 |
The mainGroup info is required to allow peeking into its |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
854 |
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
|
855 |
|
3348 | 856 |
|prevActiveKeyboardGrab prevActivePointerGrab prevFocus device tops prevGroup| |
857 |
||
858 |
"/ remember current grab, in case I am opened by |
|
859 |
"/ a popup (such as an extendedComboBox) ... |
|
860 |
device := self graphicsDevice. |
|
861 |
prevActiveKeyboardGrab := device activeKeyboardGrab. |
|
862 |
prevActivePointerGrab := device activePointerGrab. |
|
863 |
||
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
864 |
"set previousGroup to the main (non-modal) group" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
865 |
|
3348 | 866 |
previousGroup isNil ifTrue:[previousGroup := mainGroup]. |
867 |
prevGroup := previousGroup. |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
868 |
isModal := true. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
869 |
|
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
870 |
mainGroup notNil ifTrue:[ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
871 |
"/ tell the other group, that some modal dialog has started. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
872 |
mainGroup modalDialogStarts |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
873 |
]. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
874 |
|
3352 | 875 |
previousGroup notNil ifTrue:[ |
876 |
prevFocus := previousGroup focusView. |
|
877 |
]. |
|
3348 | 878 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
879 |
WindowGroupQuerySignal handle:[:ex | |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
880 |
ex proceedWith:self |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
881 |
] do:[ |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
882 |
self realizeTopViews. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
883 |
|
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
884 |
self |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
885 |
eventLoopWhile:checkBlock |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
886 |
onLeave:[ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
887 |
" |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
888 |
cleanup, in case of a terminate |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
889 |
" |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
890 |
previousGroup := nil. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
891 |
topViews := nil. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
892 |
views := nil. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
893 |
" |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
894 |
the following is rubbish; |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
895 |
the views could be reused .. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
896 |
" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
897 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
898 |
"/ topViews notNil ifTrue:[ |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
899 |
"/ topViews do:[:aView | |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
900 |
"/ aView destroy |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
901 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
902 |
"/ topViews := nil. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
903 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
904 |
"/ views notNil ifTrue:[ |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
905 |
"/ views do:[:aView | |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
906 |
"/ aView destroy |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
907 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
908 |
"/ views := nil. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
909 |
"/ ]. |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
910 |
|
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
911 |
] |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
912 |
]. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
913 |
|
3348 | 914 |
"/ restore current grab, in case was opened by |
915 |
"/ a popup (such as an extendedComboBox) ... |
|
916 |
||
917 |
mainGroup notNil ifTrue:[ |
|
918 |
(prevGroup isModal or:[prevGroup isPopUp]) ifTrue:[ |
|
919 |
" |
|
920 |
return input focus to previously active groups top. |
|
921 |
" |
|
922 |
tops := mainGroup topViews. |
|
923 |
(tops notNil and:[tops notEmpty]) ifTrue:[ |
|
924 |
tops first getKeyboardFocus. |
|
925 |
]. |
|
926 |
]. |
|
927 |
]. |
|
928 |
||
929 |
prevActivePointerGrab notNil ifTrue:[ device grabPointerInView:prevActivePointerGrab ]. |
|
930 |
prevActiveKeyboardGrab notNil ifTrue:[ device grabKeyboardInView:prevActiveKeyboardGrab ]. |
|
931 |
prevFocus notNil ifTrue:[ prevFocus requestFocus ]. |
|
932 |
||
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
933 |
mainGroup notNil ifTrue:[ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
934 |
"/ tell the other group, that some modal dialog has closed down. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
935 |
mainGroup modalDialogFinished |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
936 |
] |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
937 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
938 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
939 |
"Created: 10.12.1995 / 14:14:26 / cg" |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
940 |
"Modified: 20.8.1997 / 18:12:20 / cg" |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
941 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
942 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
943 |
startupWith:startupAction |
244 | 944 |
"startup the window-group; |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
945 |
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
|
946 |
The startupAction arg is evaluated by the windowGroup process, |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
947 |
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
|
948 |
[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
|
949 |
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
|
950 |
blocking operations ...]" |
244 | 951 |
|
2958
128f33a77fb1
added a hook to allow interception of new-sub-application
ca
parents:
2957
diff
changeset
|
952 |
|top nm dev devNm invokingApp| |
244 | 953 |
|
954 |
previousGroup := nil. |
|
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
955 |
|
244 | 956 |
myProcess isNil ifTrue:[ |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
957 |
isModal := false. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
958 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
959 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
960 |
"/ this is the windowGroup process; |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
961 |
"/ realize all views, then handle events forever |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
962 |
"/ (well, not really forever ... ;-) |
2878 | 963 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
964 |
myProcess := [ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
965 |
WindowGroupQuerySignal handle:[:ex | |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
966 |
ex proceedWith:self |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
967 |
] do:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
968 |
[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
969 |
startupAction value. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
970 |
self eventLoopWhile:[true] onLeave:[] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
971 |
] valueNowOrOnUnwindDo:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
972 |
|dev| |
180 | 973 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
974 |
(dev := self graphicsDevice) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
975 |
dev deviceIOErrorSignal handle:[:ex | |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
976 |
] do:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
977 |
self closeDownViews |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
978 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
979 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
980 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
981 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
982 |
] newProcess. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
983 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
984 |
(topViews size > 0) ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
985 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
986 |
"/ give the windowGroup process a user friendly name |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
987 |
"/ ask its topView for the processName, and |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
988 |
"/ optionally append the displayName (if its not the default) |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
989 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
990 |
top := topViews first. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
991 |
nm := top processName. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
992 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
993 |
(dev := top graphicsDevice) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
994 |
devNm := dev displayName. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
995 |
(devNm notNil and:[Display isNil or:[devNm ~= Display displayName]]) ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
996 |
nm := nm , ' (' , devNm , ')' |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
997 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
998 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
999 |
] ifFalse:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1000 |
nm := 'window handler'. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1001 |
]. |
3341 | 1002 |
myProcess name:nm; |
1003 |
priority:(Processor userSchedulingPriority); |
|
1004 |
beGroupLeader; |
|
1005 |
beGUIProcess. |
|
180 | 1006 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1007 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1008 |
"/ when the process gets suspended, |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1009 |
"/ there maybe still buffered draw requests. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1010 |
"/ Arrange for them to be flushed then. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1011 |
"/ (otherwise, you would not see the output of a process, |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1012 |
"/ which suspends and waits - or we had to add buffer flushes |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1013 |
"/ all over the place) |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1014 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1015 |
myProcess addSuspendAction:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1016 |
|dev| |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1017 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1018 |
dev := self graphicsDevice. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1019 |
dev notNil ifTrue:[dev flush]. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1020 |
]. |
2851 | 1021 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1022 |
"/ allow for the currently active application, |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1023 |
"/ to hook on new-application process creation. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1024 |
(invokingApp := WindowGroup activeMainApplication) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1025 |
invokingApp postApplicationProcessCreate:myProcess windowGroup:self. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1026 |
]. |
2959 | 1027 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1028 |
myProcess resume. |
244 | 1029 |
] |
313 | 1030 |
|
1965 | 1031 |
"Modified: / 13.12.1995 / 14:04:53 / stefan" |
1032 |
"Created: / 24.7.1997 / 12:52:04 / cg" |
|
3335
e30c9c047d48
WindowGroupProcesses are process group leaders
Stefan Vogel <sv@exept.de>
parents:
3308
diff
changeset
|
1033 |
"Modified: / 4.12.1997 / 14:13:35 / cg"! ! |
180 | 1034 |
|
90 | 1035 |
!WindowGroup methodsFor:'enumerating'! |
54 | 1036 |
|
1117 | 1037 |
allNonTopViewsDo:aBlock |
1038 |
"evaluate aBlock for all nonTopviews (i.e. subviews) in this group. |
|
1334 | 1039 |
This enumerates a copy of the view collection, to allow for |
1240 | 1040 |
destroy and other collection changing operations to be performed in the loop." |
1117 | 1041 |
|
1042 |
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
|
1043 |
views copy nonNilElementsDo:aBlock |
1117 | 1044 |
] |
1334 | 1045 |
|
1046 |
"Modified: 12.2.1997 / 12:20:25 / cg" |
|
1117 | 1047 |
! |
1048 |
||
1153 | 1049 |
allTopViewsDo:aBlock |
1050 |
"evaluate aBlock for all topviews in this group. |
|
1334 | 1051 |
This enumerates a copy of the view collection, to allow for |
1240 | 1052 |
destroy and other collection changing operations to be performed in the loop." |
1153 | 1053 |
|
1054 |
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
|
1055 |
topViews copy nonNilElementsDo:aBlock |
1153 | 1056 |
] |
1334 | 1057 |
|
1058 |
"Modified: 12.2.1997 / 12:20:30 / cg" |
|
1153 | 1059 |
! |
1060 |
||
54 | 1061 |
allTopViewsExcept:aView do:aBlock |
157 | 1062 |
"evaluate aBlock for all topviews except aView in this group. |
1334 | 1063 |
This enumerates a copy of the view collection, to allow for |
1240 | 1064 |
destroy and other collection changing operations to be performed in the loop." |
157 | 1065 |
|
1334 | 1066 |
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
|
1067 |
v ~~ aView ifTrue:[aBlock value:v] |
157 | 1068 |
]. |
1334 | 1069 |
|
1070 |
"Modified: 12.2.1997 / 12:22:10 / cg" |
|
157 | 1071 |
! |
1072 |
||
244 | 1073 |
allViewsDo:aBlock |
1074 |
"evaluate aBlock for all views & topviews in this group. |
|
1334 | 1075 |
This enumerates a copy of the view collection, to allow for |
1240 | 1076 |
destroy and other collection changing operations to be performed in the loop." |
244 | 1077 |
|
1117 | 1078 |
self allTopViewsDo:aBlock. |
1079 |
self allNonTopViewsDo:aBlock. |
|
1334 | 1080 |
|
1081 |
"Modified: 12.2.1997 / 12:20:20 / cg" |
|
244 | 1082 |
! |
1083 |
||
1084 |
partnersDo:aBlock |
|
1085 |
"evaluate aBlock for all partnerViews. |
|
1334 | 1086 |
This enumerates a copy of the view collection, to allow for |
1240 | 1087 |
destroy and other collection changing operations to be performed in the loop." |
244 | 1088 |
|
1334 | 1089 |
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
|
1090 |
(v type == #partner) ifTrue:[aBlock value:v]. |
244 | 1091 |
]. |
1334 | 1092 |
|
1093 |
"Modified: 12.2.1997 / 12:21:41 / cg" |
|
244 | 1094 |
! |
1095 |
||
157 | 1096 |
slavesDo:aBlock |
1097 |
"evaluate aBlock for all slaveViews. |
|
1334 | 1098 |
This enumerates a copy of the view collection, to allow for |
1240 | 1099 |
destroy and other collection changing operations to be performed in the loop." |
54 | 1100 |
|
1334 | 1101 |
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
|
1102 |
(v type == #slave) ifTrue:[aBlock value:v]. |
157 | 1103 |
]. |
1334 | 1104 |
|
1105 |
"Modified: 12.2.1997 / 12:21:46 / cg" |
|
11 | 1106 |
! ! |
1107 |
||
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1108 |
!WindowGroup methodsFor:'event debugging'! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1109 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1110 |
traceEvents:trueOrFalse |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1111 |
|hook| |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1112 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1113 |
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
|
1114 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1115 |
"/ 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
|
1116 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1117 |
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
|
1118 |
"/ Transcript showCR:'removed eventHook'. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1119 |
] ifTrue:[ |
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1120 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1121 |
"/ 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
|
1122 |
"/ |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1123 |
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
|
1124 |
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
|
1125 |
with:[:ev | ev displayString printCR. false]. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1126 |
|
1977
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1127 |
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
|
1128 |
"/ Transcript showCR:'set eventHook for tracing'. |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1129 |
] |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1130 |
|
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1131 |
"Created: 24.4.1996 / 10:25:21 / cg" |
698 | 1132 |
"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
|
1133 |
! ! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1134 |
|
19 | 1135 |
!WindowGroup methodsFor:'event handling'! |
11 | 1136 |
|
244 | 1137 |
eventLoop |
1138 |
"loop executed by windowGroup process; |
|
1139 |
wait-for and process events forever" |
|
1140 |
||
1141 |
self eventLoopWhile:[true] onLeave:[] |
|
1142 |
! |
|
1143 |
||
1144 |
eventLoopWhile:aBlock onLeave:cleanupActions |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1145 |
"wait-for and process events. |
244 | 1146 |
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
|
1147 |
and aBlock evaluates to true. |
244 | 1148 |
|
1752 | 1149 |
Some signals are caught & handled: |
3348 | 1150 |
LeaveSignal forces an exit from the eventLoop; |
1151 |
AbortSignal brings us back into the loop, processing the next event; |
|
1152 |
ActivityNotifications send a #showActivity: if nonModal, |
|
1153 |
otherwise they are ignored." |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1154 |
|
2168
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1155 |
|thisProcess sigs mainSema prevSema| |
244 | 1156 |
|
1157 |
thisProcess := Processor activeProcess. |
|
1158 |
||
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1159 |
sigs := SignalSet |
3348 | 1160 |
with:AbortSignal |
1161 |
with:LeaveSignal |
|
1162 |
with:(self class activityNotificationSignal). |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1163 |
|
244 | 1164 |
[ |
3348 | 1165 |
|p g s mainGroup mySema waitSema groupForSema| |
1166 |
||
1167 |
waitSema := mySema := mySensor eventSemaphore. |
|
1168 |
||
1169 |
isModal ifTrue:[ |
|
1170 |
mainGroup := self mainGroup. |
|
1171 |
mainGroup == self ifTrue:[ |
|
1172 |
mainGroup := nil |
|
1173 |
]. |
|
1174 |
] ifFalse:[ |
|
1175 |
mainGroup := previousGroup |
|
1176 |
]. |
|
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1177 |
|
3348 | 1178 |
mainGroup notNil ifTrue:[ |
1179 |
mainSema := mainGroup sensor eventSemaphore. |
|
1180 |
waitSema := SemaphoreSet with:mySema with:mainSema. |
|
1181 |
||
1182 |
"/ must also care for all other groups in between |
|
1183 |
"/ (in case its a modal dialog opened from a modal dialog) |
|
2168
83571b3cde37
fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1184 |
|
3348 | 1185 |
g := previousGroup. |
1186 |
g ~~ mainGroup ifTrue:[ |
|
1187 |
groupForSema := IdentityDictionary new. |
|
1188 |
[g ~~ mainGroup] whileTrue:[ |
|
1189 |
s := g sensor eventSemaphore. |
|
1190 |
waitSema add:s. |
|
1191 |
groupForSema at:s put:g. |
|
1192 |
g := g previousGroup. |
|
1193 |
] |
|
1194 |
]. |
|
1195 |
]. |
|
1196 |
||
1197 |
[aBlock value] whileTrue:[ |
|
1198 |
LastActiveGroup := self. |
|
1199 |
LastActiveProcess := thisProcess. |
|
1200 |
||
1201 |
(views isNil and:[topViews isNil]) ifTrue:[ |
|
1202 |
myProcess notNil ifTrue:[ |
|
1203 |
p := myProcess. |
|
1204 |
myProcess := nil. |
|
1205 |
p terminate. |
|
1206 |
"not reached - there is no life after death" |
|
1207 |
]. |
|
1208 |
" |
|
1209 |
this is the end of a modal loop |
|
1210 |
(not having a private process ...) |
|
1211 |
" |
|
1212 |
^ self |
|
1213 |
]. |
|
1214 |
||
1215 |
sigs handle:[:ex | |
|
1216 |
|theSig| |
|
1217 |
||
1218 |
(theSig := ex signal) == AbortSignal ifTrue:[ |
|
1219 |
"/ |
|
1220 |
"/ on abort, stay in loop |
|
1221 |
"/ |
|
1222 |
ex return |
|
1223 |
]. |
|
1224 |
theSig == LeaveSignal ifTrue:[ |
|
1225 |
"/ |
|
1226 |
"/ on leave, exit the event loop |
|
1227 |
"/ |
|
1228 |
^ self |
|
1229 |
]. |
|
1230 |
||
1231 |
"/ ActivityNotification |
|
1232 |
"/ |
|
1233 |
"/ if I am a modal-group, let it be handled |
|
1234 |
"/ by the outer main-groups handler |
|
1235 |
"/ otherwise show the activityMessage and continue. |
|
1236 |
"/ |
|
1237 |
isModal ifTrue:[ |
|
1238 |
ex reject |
|
1239 |
"never reached" |
|
1240 |
]. |
|
1241 |
self showActivity:(ex errorString). |
|
1242 |
ex proceedWith:nil. |
|
1243 |
] do:[ |
|
1244 |
|dev gotSema mainView| |
|
1245 |
||
1246 |
(mainGroup notNil or:[mySensor hasEvents not]) ifTrue:[ |
|
1247 |
"/ now, wait for an event to arrive |
|
1248 |
waitSema isNil ifTrue:[ |
|
1249 |
"/ oops - how can this happen .... |
|
1250 |
^ self. |
|
1251 |
]. |
|
1252 |
"/ Flush device output before going to sleep. |
|
1253 |
"/ This may produce more events to arrive. |
|
1254 |
"/ Q: is this still needed (see suspendAction) ? |
|
1255 |
self graphicsDevice flush. |
|
1256 |
thisProcess setStateTo:#eventWait if:#active. |
|
1257 |
gotSema := waitSema wait. |
|
1258 |
] ifFalse:[ |
|
1259 |
gotSema := mySema |
|
1260 |
]. |
|
1261 |
LastActiveGroup := self. |
|
1262 |
LastActiveProcess := thisProcess. |
|
1263 |
||
1264 |
"/ some bad guy ;-) could have closed all down |
|
1265 |
"/ in the meanwhile ... |
|
1266 |
||
1267 |
mySensor notNil ifTrue:[ |
|
1268 |
gotSema == mySema ifTrue:[ |
|
1269 |
"/ |
|
1270 |
"/ an event for me |
|
1271 |
"/ |
|
1272 |
self processEventsWithModalGroup:nil |
|
1273 |
] ifFalse:[ |
|
1274 |
groupForSema notNil ifTrue:[ |
|
1275 |
g := groupForSema at:gotSema ifAbsent:nil. |
|
1276 |
g := g ? mainGroup. |
|
1277 |
] ifFalse:[ |
|
1278 |
g := mainGroup |
|
1279 |
]. |
|
1280 |
||
1281 |
"/ |
|
1282 |
"/ an event for my mainGroup |
|
1283 |
"/ |
|
1284 |
g topViews notNil ifTrue:[ |
|
1285 |
mainView := g topViews first |
|
1286 |
]. |
|
1287 |
mainView notNil ifTrue:[ |
|
1288 |
"/ |
|
1289 |
"/ if anything happened to the mainGroup |
|
1290 |
"/ bring my own topView back to the front |
|
1291 |
"/ This keeps modalBoxes visible |
|
1292 |
"/ |
|
1293 |
(g sensor hasConfigureEventFor:mainView) ifTrue:[ |
|
1294 |
topViews size > 0 ifTrue:[ |
|
1295 |
topViews first raiseDeiconified |
|
1296 |
] |
|
1297 |
] |
|
1298 |
]. |
|
1299 |
" |
|
1300 |
if modal, also check for redraw events in my maingroup |
|
1301 |
(we arrive here after we woke up on maingroup sensor eventSemaphore) |
|
1302 |
" |
|
1303 |
g processEventsWithModalGroup:self. |
|
1304 |
] |
|
1305 |
] |
|
1306 |
]. |
|
1307 |
]. |
|
244 | 1308 |
] valueNowOrOnUnwindDo:[ |
3348 | 1309 |
"/ |
1310 |
"/ perform any cleanupActions |
|
1311 |
"/ |
|
1312 |
cleanupActions notNil ifTrue:[cleanupActions value] |
|
244 | 1313 |
] |
313 | 1314 |
|
2116 | 1315 |
"Modified: / 14.12.1995 / 11:12:24 / stefan" |
3348 | 1316 |
"Modified: / 5.2.1999 / 22:32:07 / cg"! |
244 | 1317 |
|
1318 |
leaveEventLoop |
|
1319 |
"immediately leave the event loop, returning way back. |
|
1320 |
This can be used to leave (and closedown) a modal group. |
|
1321 |
(for normal views, this does not make sense)" |
|
1322 |
||
1323 |
^ LeaveSignal raise |
|
1324 |
! |
|
1325 |
||
103 | 1326 |
processEvents |
1327 |
"process events from either the damage- or user input queues. |
|
1328 |
Abort is assumed to be handled elsewhere." |
|
19 | 1329 |
|
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1330 |
self processEventsWithModalGroup:nil |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1331 |
|
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1332 |
"Modified: 5.3.1997 / 11:33:51 / cg" |
1328 | 1333 |
! |
1334 |
||
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1335 |
processEventsWithModalGroup:modalGroup |
1328 | 1336 |
"process events from either the damage- or user input queues. |
1868 | 1337 |
Abort is assumed to be handled elsewhere." |
1328 | 1338 |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1339 |
<resource: #keyboard (#Escape )> |
496 | 1340 |
|
2493
6de86b4cc4f6
pass keyEvents to keyboardProcessor - if there is one.
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
1341 |
|event ignore focus firstTop evView evType evArgs |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1342 |
modalTops modalTop modalDelegate syntheticEvent keyboardProcessor |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1343 |
busyHookBlock busyHookCalled| |
11 | 1344 |
|
72 | 1345 |
self processExposeEvents. |
180 | 1346 |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1347 |
[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1348 |
LastEventQuerySignal handle:[:ex | |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1349 |
ex proceedWith:event |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1350 |
] do:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1351 |
[mySensor notNil |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1352 |
and:[(event := mySensor nextEvent) notNil]] whileTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1353 |
ignore := false. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1354 |
focus := focusView. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1355 |
modalDelegate := false. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1356 |
modalTop := nil. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1357 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1358 |
modalGroup notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1359 |
"/ an incoming event for a masterView, |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1360 |
"/ while being blocked by some other modalView. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1361 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1362 |
modalTops := modalGroup topViews. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1363 |
modalTops size > 0 ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1364 |
modalTop := modalTops first. |
3096 | 1365 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1366 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1367 |
event isKeyEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1368 |
"/ forward keyboard events to my modal |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1369 |
"/ groups first topView ... |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1370 |
modalTop notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1371 |
focus := modalTop. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1372 |
modalDelegate := true. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1373 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1374 |
modalGroup focusView notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1375 |
focus := modalGroup focusView |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1376 |
] |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1377 |
] ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1378 |
event isFocusEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1379 |
event isFocusInEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1380 |
"/ move focus over to modalBox |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1381 |
modalTop notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1382 |
modalTop getKeyboardFocus. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1383 |
"/ focusIn is forwarded to the modalGroup |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1384 |
"/ (since keyboard is forwarded) |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1385 |
event view:modalTop. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1386 |
focus := modalTop. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1387 |
] |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1388 |
] ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1389 |
"/ focusOut goes to both the modal and |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1390 |
"/ the blocked main-group |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1391 |
"/ (actually, only the very first focusOut |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1392 |
"/ is needed in the mainGroup (to turn off the cursor) |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1393 |
"/ all others are only needed in the modalGroup) |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1394 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1395 |
"/ syntheticEvent := event copy. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1396 |
"/ syntheticEvent view:modalTop. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1397 |
"/ LastEventQuerySignal handle:[:ex | |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1398 |
"/ ex proceedWith:syntheticEvent |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1399 |
"/ ] do:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1400 |
"/ syntheticEvent sendEventWithFocusOn:nil. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1401 |
"/ ]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1402 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1403 |
"/ event view:modalTop. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1404 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1405 |
modalDelegate := true. |
3096 | 1406 |
] ifFalse:[ |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1407 |
event isPointerLeaveEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1408 |
] ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1409 |
event isUserEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1410 |
ignore := true |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1411 |
] |
3096 | 1412 |
] |
1413 |
] |
|
1414 |
] |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1415 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1416 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1417 |
ignore ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1418 |
(views notNil or:[topViews notNil]) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1419 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1420 |
"/ give eventRecorders, catchers etc. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1421 |
"/ a chance to eat or modify that event |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1422 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1423 |
(preEventHook notNil |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1424 |
and:[preEventHook processEvent:event]) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1425 |
ignore := true. |
3096 | 1426 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1427 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1428 |
ignore ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1429 |
evView := event view. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1430 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1431 |
(event isKeyEvent |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1432 |
and:[(keyboardProcessor := (modalTop ? evView topView) keyboardProcessor) notNil]) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1433 |
ignore := keyboardProcessor processEvent:event forModalView:modalTop |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1434 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1435 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1436 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1437 |
ignore ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1438 |
"/ event handling below will vanish ... |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1439 |
"/ (keyboardProcessor will do it) |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1440 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1441 |
event isKeyPressEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1442 |
event key == #Escape ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1443 |
modalDelegate ifTrue:[ |
3349 | 1444 |
modalTop hideRequest. ignore := true. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1445 |
] ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1446 |
isModal ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1447 |
topViews size > 0 ifTrue:[ |
3349 | 1448 |
topViews first hideRequest. ignore := true. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1449 |
] |
3096 | 1450 |
] |
1451 |
] |
|
1452 |
] |
|
1453 |
] ifFalse:[ |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1454 |
"/ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1455 |
"/ keep track of which view has the pointer |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1456 |
"/ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1457 |
event isPointerEnterEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1458 |
pointerView := evView |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1459 |
] ifFalse:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1460 |
event isPointerLeaveEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1461 |
pointerView := nil |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1462 |
] |
3096 | 1463 |
] |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1464 |
]. |
3349 | 1465 |
]. |
1466 |
||
1467 |
ignore ifFalse:[ |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1468 |
"/ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1469 |
"/ buttonPress events turn off explicit focus, and reverts |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1470 |
"/ to implicit focus control |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1471 |
"/ This used to be done for every click - |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1472 |
"/ but behaved ugly if clicking in a scrollbar ... |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1473 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1474 |
"/ XXX: move to dispatchEvent |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1475 |
event isButtonPressEvent ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1476 |
(evView wantsFocusWithButtonPress) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1477 |
"/ cannot use 'evView requestFocus' here, |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1478 |
"/ since we want to enforce it without giving the |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1479 |
"/ view a chance to circumvent this. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1480 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1481 |
"/ evView requestFocus. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1482 |
self focusView:evView. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1483 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1484 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1485 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1486 |
LastActiveGroup := self. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1487 |
LastActiveProcess := Processor activeProcess. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1488 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1489 |
(busyHook notNil and:[busyHookBlock isNil]) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1490 |
(event isKeyEvent or:[event isButtonPressEvent]) ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1491 |
"/ start a timeout action - to invoke the busyHook after some time |
3298 | 1492 |
busyHookCalled := false. |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1493 |
busyHookBlock := [ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1494 |
(inModalLoop ~~ true and:[busyHookCalled not]) ifTrue:[ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1495 |
busyHook value:true. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1496 |
busyHookCalled := true |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1497 |
] |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1498 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1499 |
Processor addTimedBlock:busyHookBlock afterMilliseconds:(busyHookTimeout ? BusyHookTime ? 150). |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1500 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1501 |
]. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1502 |
" |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1503 |
if there is no view information in the event, |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1504 |
it must have been sent directly to the sensor. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1505 |
Send it to the first topView. |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1506 |
" |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1507 |
evView isNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1508 |
(firstTop := topViews first) notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1509 |
"/ XXX: fix to dispatchEvent |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1510 |
firstTop perform:event type withArguments:event arguments |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1511 |
] |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1512 |
] ifFalse:[ |
3298 | 1513 |
event isMessageSendEvent ifTrue:[ |
1514 |
event value |
|
1515 |
] ifFalse:[ |
|
1516 |
evView dispatchEvent:event withFocusOn:focus delegate:true |
|
1517 |
] |
|
3096 | 1518 |
]. |
1519 |
]. |
|
2494
792881c4d938
slight change in keyboardProcessorHandling
Claus Gittinger <cg@exept.de>
parents:
2493
diff
changeset
|
1520 |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1521 |
"/ give eventRecorders, postProcessors |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1522 |
"/ a chance to see that event |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1523 |
|
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1524 |
postEventHook notNil ifTrue:[ |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1525 |
postEventHook processEvent:event |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1526 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1527 |
] |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1528 |
]. |
3096 | 1529 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1530 |
] |
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1531 |
] valueNowOrOnUnwindDo:[ |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1532 |
busyHookBlock notNil ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1533 |
Processor removeTimedBlock:busyHookBlock. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1534 |
busyHookBlock := nil. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1535 |
busyHookCalled ifTrue:[ |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1536 |
busyHook value:false. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1537 |
busyHookCalled := false. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1538 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1539 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1540 |
]. |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
1541 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
2116
diff
changeset
|
1542 |
"Created: / 5.3.1997 / 11:33:11 / cg" |
3348 | 1543 |
"Modified: / 4.8.1998 / 18:18:55 / cg"! |
48 | 1544 |
|
1545 |
processExposeEvents |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1546 |
"process only expose events from the damage queue. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1547 |
This also handles resize, mapped and unmap events." |
48 | 1548 |
|
2407 | 1549 |
self processExposeEventsFor:nil |
1550 |
||
1551 |
"Modified: / 3.12.1998 / 14:01:57 / cg" |
|
1552 |
! |
|
1553 |
||
1554 |
processExposeEventsFor:aViewOrNil |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1555 |
"process only expose events from the damage queue. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1556 |
This also handles resize, mapped and unmap events." |
2407 | 1557 |
|
180 | 1558 |
|event view rect x y w h sensor thisProcess| |
109 | 1559 |
|
1560 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
|
2154 | 1561 |
(sensor damageCount ~~ 0) ifTrue:[ |
3096 | 1562 |
thisProcess := Processor activeProcess. |
180 | 1563 |
|
3096 | 1564 |
[(event := sensor nextDamageEventFor:aViewOrNil) notNil] whileTrue:[ |
1565 |
LastActiveGroup := self. |
|
1566 |
LastActiveProcess := thisProcess. |
|
180 | 1567 |
|
3096 | 1568 |
(views notNil or:[topViews notNil]) ifTrue:[ |
1569 |
view := event view. |
|
1570 |
(aViewOrNil isNil or:[aViewOrNil == view]) ifTrue:[ |
|
1571 |
LastEventQuerySignal handle:[:ex | |
|
1572 |
ex proceedWith:event |
|
1573 |
] do:[ |
|
1574 |
(preEventHook notNil |
|
1575 |
and:[preEventHook processEvent:event]) ifFalse:[ |
|
1576 |
"/ |
|
1577 |
"/ if the view is no longer shown (iconified or closed), |
|
1578 |
"/ this is a leftover event and ignored. |
|
1579 |
"/ |
|
1580 |
"/ could this ever be a non-damage ? |
|
1581 |
"/ |
|
1582 |
(view shown or:[event isDamage not]) ifTrue:[ |
|
1583 |
LastActiveGroup := self. |
|
1584 |
LastActiveProcess := thisProcess. |
|
2440 | 1585 |
|
3096 | 1586 |
view dispatchEvent:event withFocusOn:nil delegate:true. |
1587 |
]. |
|
1588 |
] |
|
1589 |
]. |
|
1590 |
postEventHook notNil ifTrue:[ |
|
1591 |
postEventHook processEvent:event |
|
1592 |
] |
|
1593 |
] |
|
1594 |
] |
|
1595 |
] |
|
90 | 1596 |
] |
1157 | 1597 |
|
2407 | 1598 |
"Created: / 3.12.1998 / 14:01:39 / cg" |
2440 | 1599 |
"Modified: / 5.2.1999 / 22:26:44 / cg" |
11 | 1600 |
! |
1601 |
||
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1602 |
processRealExposeEvents |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1603 |
"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
|
1604 |
(for any of my views). |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1605 |
This only handles true expose events - leaving map, unmap etc. in the queue. |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1606 |
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
|
1607 |
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
|
1608 |
|
2093 | 1609 |
self processRealExposeEventsFor:nil |
1610 |
! |
|
1611 |
||
1612 |
processRealExposeEventsFor:someViewOrNil |
|
1613 |
"process only expose events from the damage queue |
|
1614 |
(for any of my views if the arg is nil). |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1615 |
This only handles true expose events - leaving map, unmap etc. in the queue. |
2093 | 1616 |
This is required after a scroll operation, |
1617 |
to wait for either a noExpose or a real expose." |
|
1618 |
||
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1619 |
|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
|
1620 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1621 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
2086
069a179b1849
dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents:
2051
diff
changeset
|
1622 |
sensor damageCount == 0 ifTrue:[^ self]. |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1623 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1624 |
thisProcess := Processor activeProcess. |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1625 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1626 |
[true] whileTrue:[ |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1627 |
LastActiveGroup := self. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1628 |
LastActiveProcess := thisProcess. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1629 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1630 |
"/ event := aView nextDamage. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1631 |
event := sensor nextExposeEventFor:someViewOrNil. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1632 |
event isNil ifTrue:[^ self]. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1633 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1634 |
(views notNil or:[topViews notNil]) ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1635 |
LastEventQuerySignal handle:[:ex | |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1636 |
ex proceedWith:event |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1637 |
] do:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1638 |
(preEventHook notNil |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1639 |
and:[preEventHook processEvent:event]) ifFalse:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1640 |
view := event view. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1641 |
"/ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1642 |
"/ if the view is no longer shown (iconified or closed), |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1643 |
"/ this is a leftover event and ignored. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1644 |
"/ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1645 |
view shown ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1646 |
rect := event rectangle. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1647 |
x := rect left. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1648 |
y := rect top. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1649 |
w := rect width. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1650 |
h := rect height. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1651 |
LastActiveGroup := self. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1652 |
LastActiveProcess := thisProcess. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1653 |
view transformation notNil ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1654 |
view deviceExposeX:x y:y width:w height:h |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1655 |
] ifFalse:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1656 |
view exposeX:x y:y width:w height:h |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1657 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1658 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1659 |
]. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1660 |
postEventHook notNil ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1661 |
postEventHook processEvent:event |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1662 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1663 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1664 |
] |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1665 |
] |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1666 |
|
2086
069a179b1849
dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents:
2051
diff
changeset
|
1667 |
"Created: / 2.7.1997 / 14:32:19 / cg" |
069a179b1849
dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents:
2051
diff
changeset
|
1668 |
"Modified: / 5.4.1998 / 11:35:43 / cg" |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1669 |
! |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
1670 |
|
2444 | 1671 |
repairDamage |
1672 |
"repair all damaged areas for any of my views right now." |
|
1673 |
||
1674 |
self processExposeEvents |
|
1675 |
||
1676 |
! |
|
1677 |
||
28 | 1678 |
waitForExposeFor:aView |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1679 |
"wait for an expose or noExpose event for aView, then process all exposes. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1680 |
To be used after a scroll. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1681 |
This is very X-specific and not needed with other systems |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1682 |
(i.e. a synthetic noExpose may be generated there)." |
28 | 1683 |
|
1684 |
mySensor waitForExposeFor:aView. |
|
90 | 1685 |
AbortSignal catch:[ |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1686 |
self processRealExposeEventsFor:aView |
90 | 1687 |
] |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1688 |
|
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
1689 |
"Modified: 6.8.1997 / 19:50:24 / cg" |
11 | 1690 |
! ! |
19 | 1691 |
|
90 | 1692 |
!WindowGroup methodsFor:'focus control'! |
1693 |
||
2691
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1694 |
defaultKeyboardConsumer |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1695 |
^ nil |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1696 |
|
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1697 |
"Created: / 20.5.1999 / 18:17:07 / cg" |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1698 |
! |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
1699 |
|
2519 | 1700 |
explicitFocusView |
1701 |
"return the view which currently has the explicit (i.e. tabbed) focus" |
|
1702 |
||
1703 |
focusByTab == true ifFalse:[^ nil]. |
|
1704 |
^ focusView |
|
1705 |
! |
|
1706 |
||
2517 | 1707 |
focusCameByTab |
1708 |
^ focusByTab |
|
1709 |
! |
|
1710 |
||
244 | 1711 |
focusNext |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1712 |
"give focus to next view from focusView or topView |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1713 |
" |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1714 |
|curView oldView nxtView subViews index sequence size| |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1715 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1716 |
oldView := focusView. |
244 | 1717 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1718 |
(curView := focusView) isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1719 |
topViews notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1720 |
focusView := curView := topViews detect:[:aView|aView shown] ifNone:nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1721 |
]. |
244 | 1722 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1723 |
focusView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1724 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1725 |
] |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1726 |
] ifFalse:[ |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1727 |
focusView := nil |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1728 |
]. |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1729 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1730 |
"/ SUPPORT OLD STUFF |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1731 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1732 |
sequence := curView topView focusSequence. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1733 |
size := sequence size. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1734 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1735 |
size ~~ 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1736 |
oldView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1737 |
index := 0 |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1738 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1739 |
index := sequence identityIndexOf:oldView |
3151 | 1740 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1741 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1742 |
sequence from:(index + 1) do:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1743 |
(v shown and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1744 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1745 |
] |
3151 | 1746 |
]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1747 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1748 |
sequence from:1 to:(index - 1) do:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1749 |
(v shown and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1750 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1751 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1752 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1753 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1754 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1755 |
"/ NEW STUFF |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1756 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1757 |
(nxtView := curView focusNext) notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1758 |
^ self focusView:nxtView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1759 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1760 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1761 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1762 |
[true] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1763 |
oldView := curView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1764 |
curView := curView superView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1765 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1766 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1767 |
focusView notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1768 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1769 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1770 |
^ self focusNext |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1771 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1772 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1773 |
curView shown ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1774 |
subViews := curView subViews. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1775 |
index := subViews identityIndexOf:oldView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1776 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1777 |
index == 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1778 |
"/ should not happen; but who guarantees |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1779 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1780 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1781 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1782 |
subViews from:(index + 1) do:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1783 |
v shown ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1784 |
(v canTab and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1785 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1786 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1787 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1788 |
(nxtView := v focusNext) notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1789 |
^ self focusView:nxtView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1790 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1791 |
] |
3151 | 1792 |
] |
1793 |
] |
|
244 | 1794 |
]. |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1795 |
|
244 | 1796 |
! |
1797 |
||
2219 | 1798 |
focusNextFrom:aView |
1799 |
"give focus to the view after aView in the focusSequence" |
|
1800 |
||
1801 |
focusView := aView. |
|
1802 |
self focusNext |
|
1803 |
||
1804 |
"Created: / 4.8.1998 / 02:43:17 / cg" |
|
1805 |
! |
|
1806 |
||
244 | 1807 |
focusPrevious |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1808 |
"give focus to previous view from focusView or topView |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1809 |
" |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1810 |
|curView oldView nxtView subViews index done sequence size| |
244 | 1811 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1812 |
(curView := focusView) isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1813 |
topViews notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1814 |
curView := topViews detect:[:aView|aView shown] ifNone:nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1815 |
] |
2479
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
1816 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1817 |
curView isNil ifTrue:[^ self]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1818 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1819 |
"/ SUPPORT OLD STUFF |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1820 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1821 |
sequence := curView topView focusSequence. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1822 |
size := sequence size. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1823 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1824 |
size ~~ 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1825 |
focusView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1826 |
index := size + 1 |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1827 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1828 |
index := sequence identityIndexOf:focusView. |
3151 | 1829 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1830 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1831 |
sequence from:1 to:(index - 1) reverseDo:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1832 |
(v shown and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1833 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1834 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1835 |
]. |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1836 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1837 |
sequence from:size to:(index + 1) reverseDo:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1838 |
(v shown and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1839 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1840 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1841 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1842 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1843 |
sequence from:1 to:(index - 1) do:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1844 |
(v shown and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1845 |
^ self focusView:v byTab:true |
3151 | 1846 |
] |
1847 |
]. |
|
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1848 |
]. |
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1849 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1850 |
"/ NEW STUFF |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1851 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1852 |
focusView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1853 |
subViews := curView subViews. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1854 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1855 |
subViews size ~~ 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1856 |
curView := subViews detectLast:[:v|v shown] ifNone:nil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1857 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1858 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1859 |
^ self focusToView:nil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1860 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1861 |
done := false. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1862 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1863 |
[done not and:[(subViews := curView subViews) size ~~ 0]] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1864 |
nxtView := subViews detectLast:[:v|v shown] ifNone:nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1865 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1866 |
nxtView notNil ifTrue:[curView := nxtView] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1867 |
ifFalse:[done := true]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1868 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1869 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1870 |
(curView canTab and:[curView enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1871 |
^ self focusView:curView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1872 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1873 |
focusView := curView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1874 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1875 |
nxtView := focusView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1876 |
"/ check whether all superView's are shown |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1877 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1878 |
[(nxtView := nxtView superView) notNil] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1879 |
nxtView shown ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1880 |
curView := nxtView superView |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1881 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1882 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1883 |
curView ~~ focusView ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1884 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1885 |
focusView := nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1886 |
self focusPrevious. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1887 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1888 |
self focusView:curView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1889 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1890 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1891 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1892 |
focusView := nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1893 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1894 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1895 |
[true] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1896 |
oldView := curView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1897 |
curView := curView superView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1898 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1899 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1900 |
focusView notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1901 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1902 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1903 |
^ self focusPrevious |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1904 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1905 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1906 |
curView shown ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1907 |
subViews := curView subViews. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1908 |
index := subViews identityIndexOf:oldView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1909 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1910 |
index == 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1911 |
"/ should not happen; but who guarantees |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1912 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1913 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1914 |
subViews from:1 to:(index - 1) reverseDo:[:v| |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1915 |
v shown ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1916 |
nxtView := v focusPrevious. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1917 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1918 |
nxtView notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1919 |
^ self focusView:nxtView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1920 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1921 |
(v canTab and:[v enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1922 |
^ self focusView:v byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1923 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1924 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1925 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1926 |
(curView canTab and:[curView enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1927 |
^ self focusView:curView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1928 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1929 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1930 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1931 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1932 |
|
244 | 1933 |
! |
1934 |
||
2219 | 1935 |
focusPreviousFrom:aView |
1936 |
"give focus to the view before aView in the focusSequence" |
|
1937 |
||
1938 |
focusView := aView. |
|
1939 |
self focusPrevious |
|
1940 |
||
1941 |
"Created: / 4.8.1998 / 02:43:08 / cg" |
|
1942 |
! |
|
1943 |
||
2506 | 1944 |
focusRequestFrom:aView |
1945 |
"aView requests focus. I will grant it, if I have no explicit |
|
1946 |
focusView (i.e. not tabbed)" |
|
1947 |
||
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1948 |
|prevFocusView myDisplay i| |
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1949 |
|
2692 | 1950 |
"/ 'focusRequest:' print. aView print. |
1951 |
||
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1952 |
myDisplay := self graphicsDevice. |
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1953 |
(myDisplay notNil |
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1954 |
and:[myDisplay activateOnClick:nil]) ifTrue:[ |
2723 | 1955 |
prevFocusView := myDisplay focusView. |
1956 |
(prevFocusView notNil |
|
1957 |
and:[prevFocusView windowGroup ~~ aView windowGroup]) ifTrue:[ |
|
1958 |
"/ a view from another windowGroup requests the focus. |
|
1959 |
"/ Do not grant this, if in windows-activateOnClick mode. |
|
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1960 |
|
2692 | 1961 |
"/ ' not granted' printCR. |
2723 | 1962 |
myDisplay setInputFocusTo:prevFocusView. |
1963 |
^ false |
|
1964 |
]. |
|
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1965 |
]. |
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1966 |
|
2692 | 1967 |
"/ ' granted' printCR. |
1968 |
||
2506 | 1969 |
(focusView isNil or:[focusByTab not]) ifTrue:[ |
2723 | 1970 |
self focusView:aView byTab:false. |
1971 |
^ true |
|
2506 | 1972 |
]. |
1973 |
^ false |
|
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
1974 |
|
2692 | 1975 |
"Modified: / 20.5.1999 / 18:30:31 / cg" |
2506 | 1976 |
! |
1977 |
||
135 | 1978 |
focusSequence |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
1979 |
"return my focus sequence for focusNext/focusPrevious. |
135 | 1980 |
Focus is stepped in the order in which subviews occur in |
1981 |
the sequence" |
|
1982 |
||
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1983 |
^ nil |
135 | 1984 |
! |
1985 |
||
90 | 1986 |
focusSequence:aSequenceableCollection |
1987 |
"define the focus sequence for focusNext/focusPrevious. |
|
1988 |
Focus is stepped in the order in which subviews occur in |
|
1946 | 1989 |
the sequence." |
90 | 1990 |
! |
1991 |
||
2353
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1992 |
focusToView:aViewOrNil |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1993 |
"give focus to aViewOrNil" |
2353
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1994 |
|
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1995 |
focusView == aViewOrNil ifFalse:[ |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1996 |
( aViewOrNil isNil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1997 |
or:[(aViewOrNil canTab and:[aViewOrNil enabled])] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1998 |
) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
1999 |
self focusView:aViewOrNil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2000 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2001 |
]. |
2353
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2002 |
! |
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2003 |
|
90 | 2004 |
focusView |
135 | 2005 |
"return the view which currently has the focus" |
90 | 2006 |
|
2007 |
^ focusView |
|
2008 |
! |
|
2009 |
||
2010 |
focusView:aViewOrNil |
|
2011 |
"give focus to aViewOrNil" |
|
2012 |
||
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2013 |
self focusView:aViewOrNil byTab:false |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2014 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2015 |
" |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2016 |
|top v1 v2| |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2017 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2018 |
top := StandardSystemView new. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2019 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2020 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2021 |
top open. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2022 |
top windowGroup focusView:v1. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2023 |
" |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2024 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2025 |
"Modified: 31.5.1996 / 21:13:25 / cg" |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2026 |
! |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2027 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2028 |
focusView:aViewOrNil byTab:focusCameViaTab |
2507 | 2029 |
"give focus to aViewOrNil. |
2030 |
The focusCameViaTab argument specifies if the focus came via |
|
2031 |
tabbing or by pointer-movement/automatic. |
|
2032 |
If it came via tabbing, the view is notified differently, to allow |
|
2033 |
for special highlighting (i.e. drawing a focus-border around itself)" |
|
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2034 |
|
2723 | 2035 |
|i prevFocusView myDisplay| |
2506 | 2036 |
|
2692 | 2037 |
"/ 'focusToView:' print. aViewOrNil printCR. |
2038 |
||
2507 | 2039 |
myDisplay := self graphicsDevice. |
2522 | 2040 |
myDisplay notNil ifTrue:[ |
2723 | 2041 |
"/ |
2042 |
"/ take the focus from whichEver view had it previously |
|
2043 |
"/ |
|
2044 |
prevFocusView := myDisplay focusView. |
|
2045 |
prevFocusView ~~ aViewOrNil ifTrue:[ |
|
2046 |
self class takeFocusFromDevice:myDisplay. |
|
2047 |
]. |
|
2048 |
myDisplay focusView:aViewOrNil. |
|
2506 | 2049 |
]. |
2050 |
||
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2051 |
focusView == aViewOrNil ifTrue:[ |
2723 | 2052 |
focusView notNil ifTrue:[ |
2053 |
"/ this is the case when the mouse-pointer reenters |
|
2054 |
"/ into a topView which had a focusView |
|
2055 |
focusByTab := focusCameViaTab or:[focusByTab]. |
|
2056 |
focusView showFocus:focusByTab. |
|
2057 |
aViewOrNil hasKeyboardFocus:true. |
|
2058 |
myDisplay focusView:aViewOrNil. |
|
2059 |
]. |
|
2060 |
^ self |
|
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2061 |
]. |
410
9d9d03fa5d82
moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2062 |
|
90 | 2063 |
focusView notNil ifTrue:[ |
2723 | 2064 |
"/ lost explicit focus |
2065 |
focusView == aViewOrNil ifTrue:[ |
|
2066 |
aViewOrNil hasKeyboardFocus:true. |
|
2067 |
myDisplay focusView:aViewOrNil. |
|
2068 |
^ self |
|
2069 |
]. |
|
90 | 2070 |
]. |
387
aa80487842b8
compile event classes with optSpace;
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
2071 |
|
90 | 2072 |
focusView := aViewOrNil. |
2073 |
focusView notNil ifTrue:[ |
|
2723 | 2074 |
"/ got explicit focus |
2075 |
aViewOrNil showFocus:focusCameViaTab. |
|
2076 |
aViewOrNil hasKeyboardFocus:true. |
|
2077 |
focusByTab := focusCameViaTab. |
|
2078 |
myDisplay focusView:aViewOrNil. |
|
90 | 2079 |
]. |
2080 |
||
2081 |
" |
|
2082 |
|top v1 v2| |
|
2083 |
||
2084 |
top := StandardSystemView new. |
|
2085 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
2086 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
2087 |
top open. |
|
2088 |
top windowGroup focusView:v1. |
|
2089 |
" |
|
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
2090 |
|
2692 | 2091 |
"Modified: / 20.5.1999 / 18:30:16 / cg" |
2479
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
2092 |
! |
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
2093 |
|
2737 | 2094 |
pointerView |
2095 |
"return the view which currently has the pointer" |
|
2096 |
||
2097 |
^ pointerView |
|
244 | 2098 |
! ! |
2099 |
||
2100 |
!WindowGroup methodsFor:'initialization'! |
|
2101 |
||
2102 |
initialize |
|
2103 |
"setup the windowgroup, by creating a new sensor |
|
2104 |
and an event semaphore" |
|
2105 |
||
2106 |
mySensor := WindowSensor new. |
|
1273 | 2107 |
mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema'). |
244 | 2108 |
isModal := false. |
417 | 2109 |
isForModalSubview := false. |
1273 | 2110 |
|
2111 |
"Modified: 25.1.1997 / 00:20:19 / cg" |
|
90 | 2112 |
! |
2113 |
||
244 | 2114 |
reinitialize |
2115 |
"reinitialize the windowgroup after an image restart" |
|
90 | 2116 |
|
244 | 2117 |
"throw away old (zombie) process" |
2118 |
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
|
2119 |
"/ 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
|
2120 |
"/ 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
|
2121 |
"/ gets finalized ... |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
2122 |
|
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
2123 |
"/ 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
|
2124 |
myProcess removeAllSuspendActions. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
2125 |
myProcess := nil. |
244 | 2126 |
]. |
90 | 2127 |
|
244 | 2128 |
"throw away old events" |
2129 |
mySensor reinitialize |
|
313 | 2130 |
|
2131 |
"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
|
2132 |
"Modified: 12.1.1997 / 00:45:01 / cg" |
90 | 2133 |
! ! |
2134 |
||
3276 | 2135 |
!WindowGroup methodsFor:'printing & storing'! |
19 | 2136 |
|
90 | 2137 |
printOn:aStream |
19 | 2138 |
"return a printed representation; |
144 | 2139 |
just for more user friendlyness: add name of process." |
19 | 2140 |
|
90 | 2141 |
myProcess isNil ifTrue:[ |
3077 | 2142 |
(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[ |
2143 |
aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')'). |
|
2144 |
^ self. |
|
2145 |
]. |
|
2146 |
^ super printOn:aStream |
|
2870 | 2147 |
]. |
2148 |
isModal ifTrue:[ |
|
3077 | 2149 |
aStream nextPutAll:('WindowGroup(modal for ' , myProcess nameOrId , ')'). |
2150 |
^ self. |
|
90 | 2151 |
]. |
2152 |
aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')') |
|
19 | 2153 |
! ! |
244 | 2154 |
|
2155 |
!WindowGroup methodsFor:'special'! |
|
2156 |
||
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2157 |
migrateTo:anotherDisplay |
3302 | 2158 |
"migrate all of my views to some other display device" |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2159 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2160 |
|myDevice top nm dev devNm previouslyRealized| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2161 |
|
3304
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2162 |
self isModal ifTrue:[ |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2163 |
"/ cannot migrate a modal box away from its owner ... |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2164 |
"/ (need a separate process and views may not be owned) |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2165 |
self error:'Modal windogroup cannot be migrated.'. |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2166 |
^ self |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2167 |
]. |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2168 |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2169 |
previouslyRealized := IdentitySet new. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2170 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2171 |
myDevice := self graphicsDevice. |
3308 | 2172 |
DeviceWorkstation flushCachedLastScreen. |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2173 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2174 |
graphicsDevice := nil. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2175 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2176 |
"/ enumerate views - flush their device info ... |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2177 |
topViews do:[:eachTopView | |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2178 |
eachTopView realized ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2179 |
previouslyRealized add:eachTopView |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2180 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2181 |
eachTopView unmap. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2182 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2183 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2184 |
"/ destroy them - but without notifying application/views |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2185 |
self allViewsDo:[:eachView | |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2186 |
eachView releaseDeviceResources. |
3302 | 2187 |
eachView setDevice:anotherDisplay id:nil gcId:nil. |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2188 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2189 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2190 |
"/ recreate them ... |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2191 |
self allViewsDo:[:eachView | |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2192 |
eachView recreate. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2193 |
eachView fetchDeviceResources |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2194 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2195 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2196 |
"/ realize them ... |
3304
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2197 |
(topViews ? previouslyRealized) do:[:eachTopView | |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2198 |
(previouslyRealized includes:eachTopView) ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2199 |
eachTopView realize |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2200 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2201 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2202 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2203 |
graphicsDevice := anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2204 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2205 |
anotherDisplay sync. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2206 |
myDevice sync. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2207 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2208 |
"/ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2209 |
"/ change the name of my process |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2210 |
"/ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2211 |
(topViews size > 0) ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2212 |
top := topViews first. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2213 |
nm := top processName. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2214 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2215 |
(dev := top graphicsDevice) notNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2216 |
devNm := dev displayName. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2217 |
(devNm notNil and:[Display isNil or:[devNm ~= Display displayName]]) ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2218 |
nm := nm , ' (->' , devNm , ')' |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2219 |
] |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2220 |
] |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2221 |
] ifFalse:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2222 |
nm := 'window handler'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2223 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2224 |
myProcess name:nm. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2225 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2226 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2227 |
|anotherDisplay v host| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2228 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2229 |
v := StandardSystemView new. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2230 |
v extent:100@100. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2231 |
v addSubView:(Button label:'foo'). |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2232 |
v openAndWait. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2233 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2234 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2235 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2236 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2237 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2238 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2239 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2240 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2241 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2242 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2243 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2244 |
v windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2245 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2246 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2247 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2248 |
|anotherDisplay app host| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2249 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2250 |
app := NewSystemBrowser open. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2251 |
app window waitUntilVisible. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2252 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2253 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2254 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2255 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2256 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2257 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2258 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2259 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2260 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2261 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2262 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2263 |
app windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2264 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2265 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2266 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2267 |
|host anotherDisplay| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2268 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2269 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2270 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2271 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2272 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2273 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2274 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2275 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2276 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2277 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2278 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2279 |
Transcript topView windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2280 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2281 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2282 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2283 |
Transcript topView windowGroup migrateTo:Display |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2284 |
" |
3302 | 2285 |
! ! |
2286 |
||
2287 |
!WindowGroup methodsFor:'special-accessing'! |
|
2288 |
||
2289 |
isForModalSubview |
|
2290 |
"special for windowgroups for modal subviews. |
|
2291 |
These must be flagged specially to avoid the views being reassigned |
|
2292 |
to the maingroup. |
|
2293 |
This is a private interface to the SimpleView class" |
|
2294 |
||
2295 |
^ isForModalSubview |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2296 |
! |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2297 |
|
3302 | 2298 |
isForModalSubview:aBoolean |
2299 |
"special for windowgroups for modal subviews. |
|
2300 |
These must be flagged specially to avoid the views being reassigned |
|
2301 |
to the maingroup. |
|
2302 |
This is a private interface to the SimpleView class" |
|
2303 |
||
2304 |
isForModalSubview := aBoolean |
|
2305 |
! |
|
2306 |
||
2307 |
setModal:aBoolean |
|
2308 |
"special entry for debugger: set the modal flag. |
|
2309 |
Not for public use" |
|
2310 |
||
2311 |
isModal := aBoolean |
|
2312 |
||
2313 |
"Modified: 3.9.1995 / 14:51:04 / claus" |
|
2314 |
! |
|
2315 |
||
2316 |
setPreviousGroup:aGroup |
|
2317 |
"special entry for debugger: |
|
2318 |
set the windowgroup that started this group (for modal groups only). |
|
2319 |
This is not a public interface." |
|
2320 |
||
2321 |
previousGroup := aGroup |
|
2322 |
||
2323 |
"Modified: 3.9.1995 / 14:55:40 / claus" |
|
2324 |
! |
|
2325 |
||
2326 |
setProcess:aProcess |
|
2327 |
"special entry for debugger: set the windowGroups process. |
|
2328 |
Not for public use." |
|
2329 |
||
2330 |
myProcess := aProcess |
|
2331 |
||
2332 |
"Modified: 3.9.1995 / 14:25:38 / claus" |
|
2333 |
! ! |
|
2334 |
||
2335 |
!WindowGroup methodsFor:'special-user interaction'! |
|
2336 |
||
244 | 2337 |
restoreCursors |
2338 |
"restore the original cursors in all of my views" |
|
2339 |
||
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2340 |
|myDevice| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2341 |
|
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2342 |
myDevice := self graphicsDevice. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2343 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
2344 |
self allViewsDo:[:aView | |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2345 |
|c dev id cid| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2346 |
|
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2347 |
dev := aView graphicsDevice. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2348 |
dev notNil ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2349 |
(id := aView id) notNil ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2350 |
c := aView cursor. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2351 |
c notNil ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2352 |
c := c onDevice:dev. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2353 |
(c notNil and:[(cid := c id) notNil]) ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2354 |
dev setCursor:cid in:id. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2355 |
dev ~~ myDevice ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2356 |
dev flush |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2357 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2358 |
]. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2359 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2360 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2361 |
] |
244 | 2362 |
]. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2363 |
myDevice flush |
743 | 2364 |
|
2097
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2365 |
"Modified: / 22.4.1998 / 14:28:22 / cg" |
244 | 2366 |
! |
2367 |
||
328 | 2368 |
showActivity:someMessage |
597 | 2369 |
"some activityNotification shalt be communicated to |
2370 |
the user; |
|
2371 |
forward it to my first topView if there is one |
|
2372 |
(that one should know how to deal with it)" |
|
2373 |
||
328 | 2374 |
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
|
2375 |
topViews first showActivity:someMessage |
328 | 2376 |
] |
2377 |
||
2378 |
"Created: 16.12.1995 / 18:39:40 / cg" |
|
597 | 2379 |
"Modified: 23.4.1996 / 21:36:54 / cg" |
328 | 2380 |
! |
2381 |
||
244 | 2382 |
showCursor:aCursor |
3280 | 2383 |
"change the cursor to aCursor in all of my views |
2384 |
(This sets the cursor directly, without changing the state of the cursor instance variable; |
|
2385 |
the reason is to allow for #restoreCursors to be able to undo this)." |
|
244 | 2386 |
|
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2387 |
|myDevice c| |
244 | 2388 |
|
3062 | 2389 |
aCursor isNil ifTrue:[^ self]. |
2390 |
||
244 | 2391 |
c := aCursor. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2392 |
myDevice := self graphicsDevice. |
244 | 2393 |
self allViewsDo:[:aView | |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2394 |
|cId vId dev| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2395 |
|
3280 | 2396 |
dev := aView graphicsDevice. |
2397 |
dev notNil ifTrue:[ |
|
2398 |
c := c onDevice:dev. |
|
2399 |
(cId := c id) notNil ifTrue:[ |
|
2400 |
(vId := aView id) notNil ifTrue:[ |
|
2401 |
dev setCursor:cId in:vId. |
|
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2402 |
dev ~~ myDevice ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2403 |
dev flush |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2404 |
] |
3280 | 2405 |
] |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2406 |
]. |
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
2407 |
]. |
244 | 2408 |
]. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2409 |
myDevice flush |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2410 |
|
244 | 2411 |
! |
2412 |
||
2413 |
withCursor:aCursor do:aBlock |
|
2414 |
"evaluate aBlock while showing aCursor in all |
|
2415 |
my views (used to show wait-cursor while doing something). |
|
2416 |
Return the result as returned by aBlock." |
|
2417 |
||
1986 | 2418 |
|oldCursors dev deviceCursor action| |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
2419 |
|
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
2420 |
dev := self graphicsDevice. |
3062 | 2421 |
(dev isNil or:[aCursor isNil]) ifTrue:[ |
3077 | 2422 |
^ aBlock value |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
2423 |
]. |
244 | 2424 |
|
1652 | 2425 |
deviceCursor := aCursor onDevice:dev. |
2426 |
||
244 | 2427 |
" |
2428 |
get mapping of view->cursor for all of my subviews |
|
2429 |
" |
|
2430 |
oldCursors := IdentityDictionary new. |
|
2431 |
self allViewsDo:[:aView | |
|
3077 | 2432 |
|old| |
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2433 |
|
3077 | 2434 |
old := aView cursor. |
2435 |
old ~~ aCursor ifTrue:[ |
|
2436 |
oldCursors at:aView put:old. |
|
2437 |
aView cursor:deviceCursor now:false |
|
2438 |
] |
|
244 | 2439 |
]. |
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2440 |
|
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2441 |
oldCursors size == 0 ifTrue:[ |
3077 | 2442 |
action := aBlock |
1986 | 2443 |
] ifFalse:[ |
3077 | 2444 |
action := [ |
2445 |
|rslt| |
|
1986 | 2446 |
|
3077 | 2447 |
"/ |
2448 |
"/ here sync looks better; flush leads to almost invisible cursors when accepting. |
|
2449 |
"/ I dont really know why (maybe unix does not context-switch to the Xserver |
|
2450 |
"/ early enough after the requests have been sent ?) |
|
2451 |
"/ |
|
2452 |
dev sync. |
|
1986 | 2453 |
|
3077 | 2454 |
rslt := aBlock valueNowOrOnUnwindDo:[ |
2455 |
" |
|
2456 |
restore cursors from the mapping |
|
2457 |
" |
|
2458 |
oldCursors keysAndValuesDo:[:view :cursor | |
|
2459 |
view cursor:cursor now:false. |
|
2460 |
]. |
|
2461 |
dev flush |
|
2462 |
]. |
|
2463 |
rslt |
|
2464 |
] |
|
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2465 |
]. |
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2466 |
|
2097
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2467 |
"/ (self isModal and:[previousGroup notNil]) ifTrue:[ |
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2468 |
"/ "/ pass the work to my parentGroup |
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2469 |
"/ ^ previousGroup withCursor:aCursor do:action |
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2470 |
"/ ]. |
1986 | 2471 |
^ action value. |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
2472 |
|
2097
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2473 |
"Modified: / 22.4.1998 / 14:36:47 / cg" |
408 | 2474 |
! |
2475 |
||
2213
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2476 |
withExecuteCursorDo:aBlock |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2477 |
"evaluate aBlock while showing a busyCursor in all |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2478 |
my views (used to show busy-cursor while doing something time consuming). |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2479 |
Return the result as returned by aBlock." |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2480 |
|
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2481 |
^ self withCursor:(Cursor execute) do:aBlock |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2482 |
|
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2483 |
"Created: / 31.7.1998 / 20:11:52 / cg" |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2484 |
! |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2485 |
|
408 | 2486 |
withWaitCursorDo:aBlock |
2487 |
"evaluate aBlock while showing a waitCursor in all |
|
2488 |
my views (used to show wait-cursor while doing something time consuming). |
|
2489 |
Return the result as returned by aBlock." |
|
2490 |
||
2491 |
^ self withCursor:(Cursor wait) do:aBlock |
|
2492 |
||
2493 |
"Created: 6.2.1996 / 19:51:53 / cg" |
|
244 | 2494 |
! ! |
2495 |
||
1110 | 2496 |
!WindowGroup class methodsFor:'documentation'! |
251 | 2497 |
|
2498 |
version |
|
3352 | 2499 |
^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.218 2000-10-30 11:51:41 cg Exp $' |
251 | 2500 |
! ! |
244 | 2501 |
WindowGroup initialize! |