author | Stefan Vogel <sv@exept.de> |
Tue, 28 Apr 2020 15:28:14 +0200 | |
changeset 9038 | dd177fea6408 |
parent 9004 | a9067f6b4e80 |
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 |
" |
|
3212 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
6742 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
11 | 16 |
Object subclass:#WindowGroup |
2857
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
17 |
instanceVariableNames:'graphicsDevice views topViews myProcess mySensor isModal |
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
18 |
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
|
19 |
pointerView isForModalSubview focusByTab groupHasFocus busyHook |
6120 | 20 |
busyHookTimeout inModalLoop isDebugged preEventHooks |
21 |
postEventHooks creatingProcess traceEvents processPriority |
|
7676 | 22 |
inWithCursorDoBlock doNotCloseOnAbortSignal previousFocusView |
8421 | 23 |
modalGroup controlInterruptHandler haltInterruptHandler' |
8330 | 24 |
classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal BusyHookTime' |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
25 |
poolDictionaries:'' |
5276 | 26 |
category:'Interface-Support-UI' |
11 | 27 |
! |
28 |
||
5691 | 29 |
Query subclass:#LastEventQuery |
30 |
instanceVariableNames:'' |
|
31 |
classVariableNames:'' |
|
32 |
poolDictionaries:'' |
|
33 |
privateIn:WindowGroup |
|
34 |
! |
|
35 |
||
36 |
Query subclass:#WindowGroupQuery |
|
37 |
instanceVariableNames:'' |
|
38 |
classVariableNames:'' |
|
39 |
poolDictionaries:'' |
|
40 |
privateIn:WindowGroup |
|
41 |
! |
|
42 |
||
1110 | 43 |
!WindowGroup class methodsFor:'documentation'! |
46 | 44 |
|
45 |
copyright |
|
46 |
" |
|
47 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 48 |
All Rights Reserved |
46 | 49 |
|
50 |
This software is furnished under a license and may be used |
|
51 |
only in accordance with the terms of that license and with the |
|
52 |
inclusion of the above copyright notice. This software may not |
|
53 |
be provided or otherwise made available to, or used by, any |
|
54 |
other person. No title to or ownership of the software is |
|
55 |
hereby transferred. |
|
56 |
" |
|
57 |
! |
|
58 |
||
59 |
documentation |
|
60 |
" |
|
103 | 61 |
In Smalltalk/X, the known (ST-80) concept of a controller has been |
297 | 62 |
extended (split) into a WindowGroup which handles process related stuff, |
63 |
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
|
64 |
The controller functionality might be (actually: often is) included in the view components. |
297 | 65 |
All interaction is via event queues - there is no polling in controllers (not even conceptionally). |
103 | 66 |
|
67 |
WindowGroups are responsible to wait for and forward events for a group of |
|
297 | 68 |
windows. All views in a windowGroup share a single windowSensor which holds the |
1503 | 69 |
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
|
70 |
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
|
71 |
another one for user interaction (such as mouse, keyboard etc.) |
144 | 72 |
|
297 | 73 |
The event queues are filled with incoming events as arriving from the physical display. |
74 |
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
|
75 |
priority. The event dispatcher determines the queue into which an event has to be placed, |
7709 | 76 |
by asking the view for which the event is destined (via the view's sensor). |
77 |
There may be multiple event dispatchers running (to support multiple displays simultaneously), |
|
78 |
there may also be multiple input device readers running |
|
79 |
(to suppert tablet/pen input, or other input devices). |
|
80 |
See the documentation/examples in DeviceWorkstation/XWorkstation on how this is done. |
|
297 | 81 |
|
103 | 82 |
Except for modal boxes, a separate process is created for each windowGroup |
297 | 83 |
which waits for events to arrive and processes them, by sending corresponding |
7709 | 84 |
event messages to the view's controller or the view (*). |
297 | 85 |
The controller is determined by asking the view (for which the event is destined); |
86 |
if the returned controller is nil, the event is sent directly to the view. |
|
87 |
This allows for simple views to work without a controller. |
|
88 |
(all of this is actually done in a WindowEvent method) |
|
89 |
||
90 |
Therefore, multiple applications run pseudo parallel. |
|
91 |
Even if some window performs a long time computation, events are still received |
|
92 |
and entered into the corresponding event queues (because the event dispatcher process |
|
93 |
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
|
94 |
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
|
95 |
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
|
96 |
other windows a chance to execute (some views do this while performing longtime actions). |
297 | 97 |
|
103 | 98 |
Modal boxes create an extra window group for the components of the modal |
297 | 99 |
box, but execute the event-processing loop for this new group in the original process - |
144 | 100 |
therefore, the original windowgroup is blocked for the duration of the modal |
297 | 101 |
interaction. |
102 |
However, the modal-event processing loop peeks into the original groups event queue |
|
103 |
from time to time, and handles expose events. Thus, even while blocked for user input, |
|
104 |
the original group continues to get update/redraw events. |
|
103 | 105 |
|
106 |
Normally, one windowgroup is associated to each topview (StandardSystemView) |
|
144 | 107 |
and all of its subviews. However, this is not strictly required; |
108 |
it is possible to create extra windowgroups for subviews, which will let them |
|
109 |
run in parallel |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
110 |
(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
|
111 |
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
|
112 |
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
|
113 |
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
|
114 |
working and allows terminating the pipe-read action). |
144 | 115 |
|
116 |
On the other hand, multiple topviews can be placed into the same windowGroup; |
|
117 |
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
|
118 |
the user at a time (for example: the GUI painters canvas and gallery are in the same group). |
7914 | 119 |
Multiple topviews within a windowGroup can be configured to behave like one |
297 | 120 |
unit with respect to iconification, deiconification and termination. |
121 |
This is done by creating multiple topViews in one group, and setting up a master/slave |
|
122 |
or partner relation among them (see TopView>>beSlave and TopView>>bePartner). |
|
103 | 123 |
|
109 | 124 |
WindowGroups also support a focus window: this is the one that gets the |
103 | 125 |
keyboard input - even if the cursor is located in another subview. |
512 | 126 |
The sequence is defined by the topView or its model (typically an applicationModel). |
127 |
It should return an orderedCollection of subviews when asked via #focusSequence. |
|
128 |
||
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
129 |
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
|
130 |
around the processing of events - preEventHook is sent a #procesEvent: message before an event is processed, |
512 | 131 |
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
|
132 |
The preEventHook should return a boolean - if it returns true, the event is considered |
512 | 133 |
being already processed by the hook and ignored. |
134 |
This allows for event-tracing, timing or even filtering (if preEventHook returns true). |
|
135 |
(notice: there is also an eventHook facility available in the sensor class.) |
|
103 | 136 |
|
137 |
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
|
138 |
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
|
139 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
140 |
Late News: |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
141 |
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
|
142 |
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
|
143 |
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
|
144 |
(without a need for #withCursorDo: all over the place in the application) |
103 | 145 |
|
7665 | 146 |
Don't get confused: |
147 |
You don't have to care for all those details in the normal case; |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
148 |
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
|
149 |
All of the internals are not required to be known for most applications. |
297 | 150 |
|
103 | 151 |
|
597 | 152 |
[instance variables:] |
144 | 153 |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
154 |
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
|
155 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
156 |
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
|
157 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
158 |
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
|
159 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
160 |
mySensor my input sensor |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
161 |
|
6120 | 162 |
isModal true if this is for a modal box; i.e. running a separate |
163 |
modal event loop on top of another window group. |
|
7676 | 164 |
Those modal groups execute in the same process as the underlying group |
6120 | 165 |
|
166 |
inModalLoop true if this group's event processing is currently suspended |
|
167 |
because I have opened a modal window (with its own 'isModal' |
|
168 |
group) which handles events for a while. |
|
169 |
||
7676 | 170 |
modalGroup non-nil windowGroup which is my modal windowGroup, if I am |
171 |
in a modal loop. I.e. the group which has been started by me and |
|
172 |
which has taken control. |
|
173 |
||
174 |
previousGroup if modal, the group that started this one (might be another modal one) |
|
175 |
||
6120 | 176 |
isDebugged true if a debugger sits on top of me |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
177 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
178 |
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
|
179 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
180 |
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
|
181 |
(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
|
182 |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
183 |
focusSequence defines the focus sequence |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
184 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
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
|
188 |
(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
|
189 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
190 |
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
|
191 |
AFTER an event was dispatched. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
192 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
193 |
isForModalSubView |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
194 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
195 |
groupHasFocus true, if this windowGroup has the focus |
2506 | 196 |
|
103 | 197 |
|
597 | 198 |
[class variables:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
199 |
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
|
200 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
201 |
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
|
202 |
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
|
203 |
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
|
204 |
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
|
205 |
(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
|
206 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
207 |
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
|
208 |
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
|
209 |
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
|
210 |
there due to an event. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
211 |
(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
|
212 |
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
|
213 |
of event, x/y position etc. |
2506 | 214 |
|
215 |
||
144 | 216 |
(*) |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
217 |
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
|
218 |
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
|
219 |
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
|
220 |
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
|
221 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
222 |
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
|
223 |
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
|
224 |
(buttons, toggles and subclasses) do so. |
144 | 225 |
|
103 | 226 |
For more information, read 'introduction to view programming' in the |
227 |
doc/online directory. |
|
597 | 228 |
|
612 | 229 |
[author:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
230 |
Claus Gittinger |
612 | 231 |
|
597 | 232 |
[see also:] |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
233 |
WindowSensor WindowEvent EventListener KeyboardForwarder |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
234 |
DeviceWorkstation |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
235 |
View StandardSystemView |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
236 |
ApplicationModel |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
237 |
Process ProcessorScheduler |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
238 |
(``Working with processes (programmers manual)'': programming/processes.html#VIEWSNPROCS) |
46 | 239 |
" |
240 |
! ! |
|
241 |
||
1110 | 242 |
!WindowGroup class methodsFor:'initialization'! |
46 | 243 |
|
244 |
initialize |
|
245 |
LeaveSignal isNil ifTrue:[ |
|
5691 | 246 |
LeaveSignal := (Signal new) mayProceed:true. |
247 |
LeaveSignal nameClass:self message:#leaveSignal. |
|
248 |
LeaveSignal notifierString:'unhandled leave signal'. |
|
249 |
||
8309 | 250 |
BusyHookTime := 150. "ms" |
54 | 251 |
]. |
46 | 252 |
|
253 |
"WindowGroup initialize" |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
254 |
|
5691 | 255 |
"Modified: / 27-01-2011 / 18:14:34 / cg" |
8330 | 256 |
"Modified: / 11-04-2018 / 11:24:31 / stefan" |
46 | 257 |
! ! |
258 |
||
1110 | 259 |
!WindowGroup class methodsFor:'instance creation'! |
244 | 260 |
|
261 |
new |
|
262 |
"create and return a new WindowGroup object" |
|
263 |
||
264 |
^ self basicNew initialize |
|
265 |
! ! |
|
266 |
||
1110 | 267 |
!WindowGroup class methodsFor:'Signal constants'! |
268 |
||
269 |
lastEventQuerySignal |
|
270 |
"return the signal which is used to query for the last event" |
|
271 |
||
8330 | 272 |
^ LastEventQuery |
273 |
||
274 |
"Created: / 17-07-1996 / 20:36:04 / cg" |
|
275 |
"Modified: / 11-04-2018 / 11:20:49 / stefan" |
|
1110 | 276 |
! |
72 | 277 |
|
278 |
leaveSignal |
|
109 | 279 |
"return the signal which is used to exit a modal loop. |
1752 | 280 |
This private signal, is always caught while a modalbox is active. |
7709 | 281 |
Raising it will exit the modal loop and return from the view's #openModal |
144 | 282 |
method." |
109 | 283 |
|
72 | 284 |
^ LeaveSignal |
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
285 |
! |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
286 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
287 |
windowGroupQuerySignal |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
288 |
"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
|
289 |
|
8330 | 290 |
^ WindowGroupQuery |
291 |
||
292 |
"Created: / 17-07-1996 / 20:36:04 / cg" |
|
293 |
"Modified: / 11-04-2018 / 11:23:31 / stefan" |
|
72 | 294 |
! ! |
295 |
||
1110 | 296 |
!WindowGroup class methodsFor:'accessing'! |
26 | 297 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
298 |
activeApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
299 |
"return the currently active application. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
300 |
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
|
301 |
always the main application." |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
302 |
|
3751 | 303 |
|activeGroup| |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
304 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
305 |
(activeGroup := self activeGroup) notNil ifTrue:[ |
3751 | 306 |
^ activeGroup application |
3173
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
307 |
]. |
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
308 |
^ nil |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
309 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
310 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
311 |
WindowGroup activeApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
312 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
313 |
! |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
314 |
|
26 | 315 |
activeGroup |
180 | 316 |
"return the currently active windowGroup. |
317 |
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
|
318 |
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
|
319 |
(usually) the first group is returned (prefering a modal if there is one). |
180 | 320 |
(maybe we should return a collection of windowGroups here). |
321 |
||
322 |
This method is required to simulate the historic ST-80 single display |
|
323 |
behavior for Cursor>>show / Cursor>>showWhile and some others (raising the |
|
324 |
activeGroups topView when modalBoxes appear) on multiple display screens. |
|
325 |
These methods should change the cursor for the currently |
|
326 |
active windowGroup ONLY, instead of globally affecting the display or |
|
327 |
all views |
|
328 |
(since, depending on the priority, other views could be unaffacted by this |
|
329 |
and an overall cursor change does not make sense.)" |
|
330 |
||
331 |
|activeProcess groups wg| |
|
332 |
||
333 |
Processor isNil ifTrue:[^ nil]. "/ only during very early init phase |
|
26 | 334 |
|
180 | 335 |
activeProcess := Processor activeProcess. |
336 |
" caching the last value ..." |
|
565
6867f1a9a470
oops - leftover global LastActive
Claus Gittinger <cg@exept.de>
parents:
513
diff
changeset
|
337 |
activeProcess == LastActiveProcess ifTrue:[ |
3541
7909bbc0bf42
oops (care for nil LastGroup)
Claus Gittinger <cg@exept.de>
parents:
3538
diff
changeset
|
338 |
(LastActiveGroup notNil |
5260
8ce66f3e7141
care to ignore cached last activeGroup, if it has already closed its views.
Claus Gittinger <cg@exept.de>
parents:
5215
diff
changeset
|
339 |
and:[LastActiveGroup process == LastActiveProcess |
8ce66f3e7141
care to ignore cached last activeGroup, if it has already closed its views.
Claus Gittinger <cg@exept.de>
parents:
5215
diff
changeset
|
340 |
and:[LastActiveGroup views notEmptyOrNil ]]) ifTrue:[ |
3212 | 341 |
^ LastActiveGroup |
342 |
] |
|
180 | 343 |
]. |
1298
d070db2e4530
always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents:
1273
diff
changeset
|
344 |
|
8330 | 345 |
WindowGroupQuery isNil ifTrue:[^ nil]. "/ only during very early init phase |
346 |
wg := WindowGroupQuery query. |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
347 |
|
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
348 |
wg isNil ifTrue:[ |
3212 | 349 |
"/ mhmh - noone willing to answer that question ... |
350 |
"/ (how can this happen ?) |
|
351 |
groups := self scheduledWindowGroups |
|
352 |
select:[:wg | wg process == activeProcess]. |
|
3619 | 353 |
groups notEmpty ifTrue:[ |
354 |
wg := groups detect:[:wg | wg isModal] ifNone:nil. |
|
355 |
wg isNil ifTrue:[ |
|
356 |
wg := groups anElement |
|
3212 | 357 |
] |
358 |
]. |
|
956
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
359 |
]. |
32a642b5dcd3
when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents:
949
diff
changeset
|
360 |
|
180 | 361 |
wg notNil ifTrue:[ |
3212 | 362 |
LastActiveProcess := activeProcess. |
363 |
LastActiveGroup := wg. |
|
180 | 364 |
]. |
365 |
^ wg |
|
366 |
||
367 |
" |
|
368 |
WindowGroup activeGroup |
|
369 |
" |
|
370 |
||
8330 | 371 |
"Modified: / 03-09-1995 / 14:49:53 / claus" |
372 |
"Modified: / 17-04-1998 / 11:49:28 / cg" |
|
373 |
"Modified: / 11-04-2018 / 11:23:20 / stefan" |
|
54 | 374 |
! |
375 |
||
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
376 |
activeMainApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
377 |
"return the currently active main application. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
378 |
Notice: |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
379 |
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
|
380 |
application." |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
381 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
382 |
|activeGroup mainView| |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
383 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
384 |
(activeGroup := self activeGroup) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
385 |
(mainView := activeGroup mainGroup mainView) notNil ifTrue:[ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
386 |
^ mainView application |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
387 |
] |
3173
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
388 |
]. |
1947c87324d5
oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
389 |
^ nil |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
390 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
391 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
392 |
WindowGroup activeMainApplication |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
393 |
" |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
394 |
|
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
395 |
! |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
396 |
|
8481 | 397 |
allTopViews |
398 |
|allWindowGroups allTopViews| |
|
399 |
||
400 |
allTopViews := OrderedCollection new. |
|
401 |
||
402 |
allWindowGroups := WindowGroup scheduledWindowGroups. |
|
403 |
allWindowGroups do:[:wg | |
|
404 |
wg notNil ifTrue:[ |
|
405 |
(wg process notNil |
|
406 |
or:[wg isModal and:[wg previousGroup notNil]]) ifTrue:[ |
|
407 |
(wg topViews ? #()) do:[:eachTopView | |
|
408 |
|element icon| |
|
409 |
||
410 |
(eachTopView id notNil) ifTrue:[ |
|
411 |
allTopViews add:eachTopView |
|
412 |
] |
|
413 |
] |
|
414 |
] |
|
415 |
] |
|
416 |
]. |
|
417 |
^ allTopViews |
|
418 |
||
419 |
"Created: / 23-09-2018 / 23:30:44 / Claus Gittinger" |
|
420 |
! |
|
421 |
||
7619 | 422 |
flushCachedActiveGroup |
423 |
self setActiveGroup:nil |
|
424 |
! |
|
425 |
||
8444 | 426 |
lastEvent |
427 |
"notice: this returns the thread-specific (i.e. windowGroup-specific) |
|
428 |
last event, by issuing a query signal. |
|
429 |
Every windowGroup-process will have its own last event returned here" |
|
430 |
||
431 |
^ (self lastEventQuerySignal query). |
|
432 |
||
433 |
"Created: / 09-08-2018 / 09:27:21 / Claus Gittinger" |
|
434 |
! |
|
435 |
||
54 | 436 |
scheduledWindowGroups |
8739 | 437 |
"return a collection of all windowGroups |
438 |
(possibly for different display devices) which are scheduled |
|
6850 | 439 |
(i.e. which have a process running, handling events)." |
440 |
||
441 |
|set screens coll| |
|
180 | 442 |
|
443 |
screens := Screen allScreens. |
|
1869 | 444 |
screens size == 0 ifTrue:[^ #()]. |
180 | 445 |
|
446 |
set := IdentitySet new. |
|
6850 | 447 |
coll := OrderedCollection new. |
448 |
||
180 | 449 |
screens do:[:aDevice | |
6850 | 450 |
aDevice allViewsDo:[:aView | |
451 |
|wg| |
|
452 |
||
453 |
(wg := aView windowGroup) notNil ifTrue:[ |
|
7672 | 454 |
(wg process notNil and:[wg process isDead not]) ifTrue:[ |
6850 | 455 |
(set includes:wg) ifFalse:[ |
456 |
set add:wg. |
|
457 |
coll add:wg. |
|
458 |
]. |
|
459 |
] |
|
460 |
]. |
|
461 |
]. |
|
180 | 462 |
]. |
6850 | 463 |
^ coll asArray |
180 | 464 |
|
465 |
" |
|
466 |
WindowGroup scheduledWindowGroups |
|
467 |
" |
|
468 |
||
8739 | 469 |
"Modified: / 01-09-1995 / 13:43:09 / claus" |
470 |
"Modified: / 18-08-1997 / 18:44:29 / cg" |
|
471 |
"Modified (comment): / 19-07-2019 / 11:38:12 / Claus Gittinger" |
|
244 | 472 |
! |
473 |
||
474 |
setActiveGroup:aGroup |
|
475 |
"set the currently active windowGroup. |
|
476 |
Temporary; do not use this interface, it will vanish." |
|
477 |
||
6123 | 478 |
aGroup isNil ifTrue:[ |
479 |
LastActiveProcess := LastActiveGroup := nil. |
|
480 |
] ifFalse:[ |
|
481 |
LastActiveProcess := Processor activeProcess. |
|
482 |
LastActiveGroup := aGroup |
|
483 |
]. |
|
484 |
||
485 |
"Modified: / 29-08-2013 / 14:49:11 / cg" |
|
26 | 486 |
! ! |
487 |
||
2723 | 488 |
!WindowGroup class methodsFor:'focus control support'! |
489 |
||
490 |
takeFocusFromDevice:aDevice |
|
4341 | 491 |
|prevFocusView prevFocusGroup prevFocusCameViaTab| |
2723 | 492 |
|
493 |
"/ |
|
494 |
"/ take the focus from whichEver view had it previously |
|
495 |
"/ |
|
496 |
prevFocusView := aDevice focusView. |
|
497 |
prevFocusView notNil ifTrue:[ |
|
4676 | 498 |
aDevice focusView:nil. |
499 |
(prevFocusGroup := prevFocusView windowGroup) notNil ifTrue:[ |
|
3376 | 500 |
prevFocusCameViaTab := prevFocusGroup focusCameByTab. |
501 |
||
502 |
prevFocusView showNoFocus:prevFocusCameViaTab. "/ true is bad - see pullDownMenu. |
|
503 |
self sendKeyboardFocusEventTo:prevFocusView withArgument:false. |
|
504 |
]. |
|
2723 | 505 |
]. |
4676 | 506 |
|
507 |
"Modified: / 08-11-2006 / 12:05:22 / cg" |
|
2723 | 508 |
! ! |
509 |
||
3376 | 510 |
!WindowGroup class methodsFor:'others'! |
511 |
||
512 |
sendKeyboardFocusEventTo:aView withArgument:arg |
|
8331 | 513 |
|sensor| |
514 |
||
515 |
aView isNil ifTrue:[ |
|
516 |
^ self |
|
517 |
]. |
|
3376 | 518 |
|
519 |
(sensor := aView sensor) notNil ifTrue:[ |
|
8331 | 520 |
sensor pushEvent:(WindowEvent keyboardFocus:arg view:aView). |
3376 | 521 |
] ifFalse:[ |
522 |
aView hasKeyboardFocus:arg |
|
523 |
]. |
|
8331 | 524 |
|
525 |
"Modified (format): / 11-04-2018 / 14:27:50 / stefan" |
|
3376 | 526 |
! ! |
527 |
||
11 | 528 |
!WindowGroup methodsFor:'accessing'! |
529 |
||
3780
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
530 |
creatingProcess |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
531 |
"return the process which created this group or nil. |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
532 |
Only returns non-nil for modal groups." |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
533 |
|
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
534 |
^ creatingProcess |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
535 |
|
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
536 |
"Modified: / 17.8.1998 / 10:21:29 / cg" |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
537 |
! |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
538 |
|
512 | 539 |
device |
540 |
"return the device, we receive our events from" |
|
541 |
||
3436 | 542 |
<resource:#obsolete> |
543 |
||
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
544 |
self obsoleteMethodWarning:'use #graphicsDevice'. |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
545 |
^ self graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
546 |
|
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
547 |
"Modified: 5.7.1996 / 17:53:58 / cg" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
548 |
! |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
549 |
|
5288 | 550 |
doNotCloseOnAbortSignal:something |
551 |
"normally, an abortSignal closes a modal dialog, which is different from a non-modal |
|
552 |
one, where only the current action (event handling) is aborted. |
|
553 |
||
554 |
This can be disabled, if you want to avoid closing a modal application, |
|
555 |
but instead have the same non-modal behavior for modal app vies" |
|
556 |
||
557 |
doNotCloseOnAbortSignal := something. |
|
558 |
! |
|
559 |
||
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
560 |
graphicsDevice |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
561 |
"return the device, we receive our events from" |
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
562 |
|
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
563 |
|dev| |
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
564 |
|
2857
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
565 |
graphicsDevice notNil ifTrue:[^ graphicsDevice]. |
b9bff260f854
cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents:
2851
diff
changeset
|
566 |
|
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
567 |
topViews notNil ifTrue:[ |
3077 | 568 |
topViews do:[:v | |
569 |
|app| |
|
1116 | 570 |
|
3077 | 571 |
v notNil ifTrue:[ |
572 |
(app := v application) notNil ifTrue:[ |
|
573 |
"/ |
|
574 |
"/ ok, it has an application; |
|
575 |
"/ ask it for preferences. |
|
576 |
"/ |
|
577 |
(dev := app graphicsDevice) notNil ifTrue:[ |
|
578 |
^ (graphicsDevice := dev) |
|
579 |
] |
|
580 |
]. |
|
581 |
(dev := v graphicsDevice) notNil ifTrue:[ |
|
582 |
^ (graphicsDevice := dev) |
|
583 |
] |
|
584 |
] |
|
585 |
] |
|
512 | 586 |
]. |
1311
0746d3fe9a62
changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
1304
diff
changeset
|
587 |
views notNil ifTrue:[ |
3077 | 588 |
views do:[:v | |
589 |
v notNil ifTrue:[ |
|
590 |
(dev := v graphicsDevice) notNil ifTrue:[ |
|
591 |
^ (graphicsDevice := dev) |
|
592 |
] |
|
593 |
] |
|
594 |
] |
|
2170
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
595 |
]. |
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
596 |
"/ 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
|
597 |
"/ 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
|
598 |
previousGroup notNil ifTrue:[ |
3077 | 599 |
^ previousGroup graphicsDevice |
512 | 600 |
]. |
601 |
^ nil |
|
602 |
||
2170
44b86a4cc0d5
in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
603 |
"Modified: / 9.7.1998 / 18:18:08 / cg" |
512 | 604 |
! |
605 |
||
6120 | 606 |
isDebugged |
607 |
"return true, if the receiver has a debugger sitting on top of me, |
|
608 |
so I do not have control" |
|
609 |
||
610 |
^ isDebugged ? false |
|
611 |
||
612 |
"Created: / 28-08-2013 / 21:51:33 / cg" |
|
613 |
! |
|
614 |
||
615 |
isDebugged:aBoolean |
|
616 |
"only set by the debugger to mark the currently active group as being debugged" |
|
617 |
||
618 |
isDebugged := aBoolean |
|
619 |
||
620 |
"Created: / 28-08-2013 / 21:52:35 / cg" |
|
621 |
! |
|
622 |
||
3737 | 623 |
isInModalLoop |
624 |
"return true, if the receiver has given up control to some other modal windowGroup |
|
625 |
(i.e. if it has popped up a modal dialog or a popUpMenu)" |
|
626 |
||
7676 | 627 |
"/ ^ modalGroup notNil. |
3737 | 628 |
^ inModalLoop ? false |
7676 | 629 |
|
630 |
"Modified: / 13-11-2016 / 22:59:29 / cg" |
|
3737 | 631 |
! |
632 |
||
512 | 633 |
isModal |
3737 | 634 |
"return true, if the receiver is for a modal view |
635 |
(i.e. it is for a modal box, dialog or popUpMenu). |
|
636 |
The suspended windowgroup would return true to the isInModalLoop query if this is the case." |
|
512 | 637 |
|
638 |
^ isModal |
|
639 |
||
640 |
"Modified: 7.3.1996 / 14:29:46 / cg" |
|
641 |
! |
|
642 |
||
643 |
mainGroup |
|
644 |
"return the main windowgroup (for modal groups only) |
|
645 |
that is the top one, which is not modal. |
|
646 |
NonModal groups return themSelf. |
|
647 |
||
648 |
There is one exception to this: the debugger (which is sort of modal) |
|
649 |
returns itself as mainGroup (not its debuggee)." |
|
650 |
||
651 |
|g prev| |
|
652 |
||
653 |
g := self. |
|
6364 | 654 |
[(g isModal or:[g isPopUp]) |
655 |
and:[(prev := g previousGroup) notNil]] whileTrue:[ |
|
7633 | 656 |
g == prev ifTrue:[^ g]. |
3354 | 657 |
g := prev |
512 | 658 |
]. |
659 |
^ g |
|
660 |
||
661 |
"Modified: 3.9.1995 / 14:57:20 / claus" |
|
662 |
"Modified: 7.3.1996 / 14:29:28 / cg" |
|
663 |
! |
|
664 |
||
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
665 |
mainGroup:aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
666 |
"set the main windowgroup (for modal/autonomous groups only) |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
667 |
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
|
668 |
as well." |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
669 |
|
6118 | 670 |
self assert:(aWindowGroup ~~ self). |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
671 |
previousGroup := aWindowGroup |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
672 |
|
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
673 |
"Created: 20.8.1997 / 17:57:35 / cg" |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
674 |
! |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
675 |
|
7678 | 676 |
modalGroup |
677 |
"if the receiver has given up control to some other modal windowGroup |
|
8696 | 678 |
(i.e. if it has popped up a modal dialog or a popUpMenu), this is the modalGroup" |
7678 | 679 |
|
680 |
^ modalGroup |
|
681 |
||
682 |
"Modified (comment): / 15-11-2016 / 00:13:47 / cg" |
|
683 |
! |
|
684 |
||
512 | 685 |
previousGroup |
686 |
"return the windowgroup that started this group. (for modal groups only). |
|
687 |
This may be another modalGroup (for boxes opened by boxes). |
|
688 |
NonModal groups return nil." |
|
689 |
||
690 |
^ previousGroup |
|
691 |
||
692 |
"Modified: 7.3.1996 / 14:28:46 / cg" |
|
693 |
! |
|
694 |
||
695 |
process |
|
696 |
"return the windowGroups process" |
|
697 |
||
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
698 |
myProcess isNil ifTrue:[ |
2363
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
699 |
previousGroup notNil ifTrue:[ |
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
700 |
^ previousGroup process |
e456e5040a57
care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
701 |
] |
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
702 |
]. |
512 | 703 |
^ myProcess |
2250
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
704 |
|
281f9fafdbe0
follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
705 |
"Modified: / 17.8.1998 / 10:21:29 / cg" |
512 | 706 |
! |
707 |
||
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
708 |
processPriority |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
709 |
^ processPriority |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
710 |
! |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
711 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
712 |
processPriority:anInteger |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
713 |
processPriority := anInteger. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
714 |
myProcess notNil ifTrue:[ |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
715 |
myProcess priority:anInteger. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
716 |
]. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
717 |
! |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
718 |
|
512 | 719 |
sensor |
5911 | 720 |
"return the windowGroup's sensor. |
721 |
All events for any of the group's views is handled by that sensor." |
|
512 | 722 |
|
723 |
^ mySensor |
|
724 |
||
5911 | 725 |
"Modified: / 07-03-1996 / 14:30:21 / cg" |
726 |
"Modified (comment): / 27-04-2012 / 13:55:53 / cg" |
|
512 | 727 |
! |
728 |
||
729 |
sensor:aSensor |
|
8506 | 730 |
"set the windowGroup's sensor" |
731 |
||
512 | 732 |
mySensor := aSensor |
733 |
! ! |
|
734 |
||
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
735 |
!WindowGroup methodsFor:'accessing-hooks'! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
736 |
|
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
737 |
addPostEventHook:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
738 |
"add another postEventHook" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
739 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
740 |
postEventHooks isNil ifTrue:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
741 |
postEventHooks := OrderedCollection new. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
742 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
743 |
(postEventHooks includesIdentical:anEventProcessor) ifFalse:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
744 |
postEventHooks add:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
745 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
746 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
747 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
748 |
addPreEventHook:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
749 |
"add another preEventHook" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
750 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
751 |
preEventHooks isNil ifTrue:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
752 |
preEventHooks := OrderedCollection new. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
753 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
754 |
(preEventHooks includesIdentical:anEventProcessor) ifFalse:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
755 |
preEventHooks add:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
756 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
757 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
758 |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
759 |
busyHook |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
760 |
"return the busyHook if any" |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
761 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
762 |
^ busyHook |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
763 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
764 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
765 |
busyHook:anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
766 |
"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
|
767 |
takes some time." |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
768 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
769 |
busyHook := anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
770 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
771 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
772 |
busyHookTimeout |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
773 |
"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
|
774 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
775 |
^ busyHookTimeout |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
776 |
! |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
777 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
778 |
busyHookTimeout:anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
779 |
"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
|
780 |
takes longer than this time." |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
781 |
|
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
782 |
busyHookTimeout := anObject |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
783 |
! |
512 | 784 |
|
8421 | 785 |
haltInterruptHandler:aHandlerBlock |
8419 | 786 |
"can be used to intercept control interrupts |
787 |
(breakpoints and halts) on a per windowGroup base. |
|
788 |
If set, it gets called like an exception handler |
|
789 |
(i.e. with optional ex argument, which can be rejected, resumed, etc.)" |
|
790 |
||
8421 | 791 |
haltInterruptHandler := aHandlerBlock |
792 |
||
793 |
"Created: / 28-06-2018 / 15:16:06 / Claus Gittinger" |
|
8419 | 794 |
! |
795 |
||
512 | 796 |
postEventHook |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
797 |
"return the postEventHook if any. |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
798 |
That is a backwardCompatibility leftOver - no multiple hooks are supported." |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
799 |
|
4174 | 800 |
<resource:#obsolete> |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
801 |
self obsoleteMethodWarning:'use #postEventHooks'. |
512 | 802 |
^ postEventHook |
803 |
||
804 |
"Created: 7.3.1996 / 14:42:46 / cg" |
|
805 |
! |
|
806 |
||
807 |
postEventHook:anObject |
|
808 |
"set the postEventHook - this one will get all events |
|
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
809 |
passed after being processed here (via #processEvent:). |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
810 |
That is a backwardCompatibility leftOver - no multiple hooks are supported." |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
811 |
|
4174 | 812 |
<resource:#obsolete> |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
813 |
self obsoleteMethodWarning:'use #addPostEventHook:/removePostEventHook:'. |
512 | 814 |
postEventHook := anObject |
815 |
! |
|
816 |
||
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
817 |
postEventHooks |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
818 |
"return the postEventHooks if any" |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
819 |
|
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
820 |
^ postEventHooks |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
821 |
! |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
822 |
|
512 | 823 |
preEventHook |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
824 |
"return the preEventHook if any. |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
825 |
That is a backwardCompatibility leftOver - no multiple hooks are supported." |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
826 |
|
4174 | 827 |
<resource:#obsolete> |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
828 |
self obsoleteMethodWarning:'use #preEventHooks'. |
512 | 829 |
^ preEventHook |
830 |
||
831 |
"Created: 7.3.1996 / 14:42:42 / cg" |
|
832 |
! |
|
833 |
||
834 |
preEventHook:anObject |
|
835 |
"set the preEventHook - this one will get all events |
|
836 |
passed before being processed here (via #processEvent:). |
|
837 |
If this returns true, the event is supposed to be already |
|
838 |
processed and ignored here. |
|
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
839 |
Otherwise, it is processed as usual. |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
840 |
That is a backwardCompatibility leftOver - no multiple hooks are supported." |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
841 |
|
4174 | 842 |
<resource:#obsolete> |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
843 |
self obsoleteMethodWarning:'use #addPreEventHook:/removePreEventHook:'. |
512 | 844 |
preEventHook := anObject |
3280 | 845 |
! |
846 |
||
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
847 |
preEventHooks |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
848 |
"return the preEventHooks if any" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
849 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
850 |
^ preEventHooks |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
851 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
852 |
"Created: 7.3.1996 / 14:42:42 / cg" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
853 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
854 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
855 |
removePostEventHook:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
856 |
"remove a postEventHook" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
857 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
858 |
postEventHooks notNil ifTrue:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
859 |
postEventHooks removeIdentical:anEventProcessor ifAbsent:nil. |
6093 | 860 |
postEventHooks := postEventHooks asNilIfEmpty. |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
861 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
862 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
863 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
864 |
removePreEventHook:anEventProcessor |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
865 |
"remove a preEventHook" |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
866 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
867 |
preEventHooks notNil ifTrue:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
868 |
preEventHooks removeIdentical:anEventProcessor ifAbsent:nil. |
6097 | 869 |
preEventHooks := preEventHooks asNilIfEmpty. |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
870 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
871 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
872 |
|
3280 | 873 |
showWaitCursorWhenBusyForMillis:millis |
874 |
"setup a busyHook, which automatically shows a waitCursor, |
|
875 |
whenever some action takes longer than millis" |
|
876 |
||
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
877 |
self busyHookTimeout:millis. |
3280 | 878 |
self |
879 |
busyHook:[:isBusy | |
|
880 |
isBusy ifTrue:[ |
|
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
881 |
self showCursor:(Cursor wait). |
4536 | 882 |
] ifFalse:[ |
3280 | 883 |
self restoreCursors |
884 |
] |
|
885 |
]. |
|
512 | 886 |
! ! |
887 |
||
888 |
!WindowGroup methodsFor:'accessing-views'! |
|
889 |
||
244 | 890 |
addTopView:aView |
891 |
"add a topview to the group" |
|
26 | 892 |
|
244 | 893 |
topViews isNil ifTrue:[ |
2723 | 894 |
topViews := OrderedCollection with:aView. |
2445 | 895 |
] ifFalse:[ |
2723 | 896 |
(topViews includesIdentical:aView) ifFalse:[ |
897 |
topViews add:aView |
|
898 |
] |
|
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
899 |
] |
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
900 |
|
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
901 |
"Modified: 6.3.1996 / 15:35:15 / cg" |
26 | 902 |
! |
903 |
||
11 | 904 |
addView:aView |
26 | 905 |
"add aView to the windowGroup" |
906 |
||
11 | 907 |
views isNil ifTrue:[ |
3151 | 908 |
views := OrderedCollection with:aView. |
2445 | 909 |
] ifFalse:[ |
3151 | 910 |
(views includesIdentical:aView) ifFalse:[ |
911 |
views add:aView |
|
912 |
] |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
913 |
] |
11 | 914 |
! |
915 |
||
3751 | 916 |
application |
917 |
|mainView| |
|
918 |
||
919 |
(mainView := self mainView) notNil ifTrue:[ |
|
920 |
^ mainView application |
|
921 |
]. |
|
922 |
^ nil |
|
923 |
! |
|
924 |
||
2445 | 925 |
mainView |
6849 | 926 |
"return the mainview. That's the first topView by default" |
927 |
||
8314 | 928 |
topViews isNil ifTrue:[ |
929 |
^ nil |
|
6849 | 930 |
]. |
8314 | 931 |
^ topViews |
932 |
detect:[:t | t isModal not] |
|
933 |
ifNone:[topViews first "a modal application"] |
|
934 |
||
935 |
"Modified: / 20-03-2018 / 14:53:23 / stefan" |
|
2445 | 936 |
! |
937 |
||
26 | 938 |
removeView:aView |
939 |
"remove aView from the windowGroup; |
|
940 |
if this was the last view in this group, |
|
81 | 941 |
also shut down the corresponding process |
942 |
(actually, only wake it up here - it will terminate itself |
|
943 |
when finding out that all views are gone)" |
|
11 | 944 |
|
263 | 945 |
|sema| |
946 |
||
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
947 |
focusView == aView ifTrue:[ |
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
948 |
self setFocusView:nil |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
949 |
]. |
3151 | 950 |
|
11 | 951 |
views notNil ifTrue:[ |
3151 | 952 |
views removeIdentical:aView ifAbsent:nil. |
6097 | 953 |
views := views asNilIfEmpty. |
11 | 954 |
]. |
955 |
topViews notNil ifTrue:[ |
|
3151 | 956 |
topViews removeIdentical:aView ifAbsent:nil. |
6097 | 957 |
topViews := topViews asNilIfEmpty. |
11 | 958 |
]. |
54 | 959 |
" |
960 |
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
|
961 |
removed (modalBoxes terminate their modalLoop if so) |
54 | 962 |
" |
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
963 |
mySensor notNil ifTrue:[ |
3151 | 964 |
(sema := mySensor eventSemaphore) notNil ifTrue:[ |
965 |
sema signal |
|
966 |
] |
|
262
546f42586e3c
only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
967 |
] |
1304 | 968 |
|
969 |
"Modified: 1.2.1997 / 12:13:26 / cg" |
|
11 | 970 |
! |
971 |
||
244 | 972 |
topViews |
2445 | 973 |
"return the topviews associated to this windowGroup" |
172 | 974 |
|
244 | 975 |
^ topViews |
172 | 976 |
! |
977 |
||
244 | 978 |
views |
2445 | 979 |
"return the views associated to this windowGroup" |
172 | 980 |
|
244 | 981 |
^ views |
54 | 982 |
! ! |
983 |
||
3887 | 984 |
!WindowGroup methodsFor:'activation & deactivation'! |
244 | 985 |
|
986 |
closeDownViews |
|
987 |
"destroy all views associated to this window group" |
|
988 |
||
8314 | 989 |
|list| |
990 |
||
244 | 991 |
topViews notNil ifTrue:[ |
8314 | 992 |
list := topViews. |
993 |
topViews := nil. |
|
994 |
list do:[:eachTopView | |
|
995 |
eachTopView notNil ifTrue:[ |
|
996 |
eachTopView destroy |
|
997 |
]. |
|
3130
d489adbd1fd2
enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents:
3103
diff
changeset
|
998 |
] |
244 | 999 |
]. |
1000 |
views := nil. |
|
5285 | 1001 |
|
1002 |
"/ keep the sensor in case there are pending incoming events; |
|
1003 |
"/ otherwise there is a chance that we end up in a debugger in the |
|
1004 |
"/ device's event handling (wGroup nonNil, but sensor isNil) for |
|
1005 |
"/ the unmappedView and focusOUT events. |
|
1006 |
mySensor flushAllEvents. |
|
1007 |
"/ mySensor := nil. |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1008 |
|
8314 | 1009 |
"Modified: / 06-05-1999 / 09:47:18 / cg" |
1010 |
"Modified: / 20-03-2018 / 14:45:29 / stefan" |
|
244 | 1011 |
! |
1012 |
||
7590 | 1013 |
hideTopViews |
1014 |
"unmap all topViews associated to this windowGroup." |
|
1015 |
||
1016 |
topViews notNil ifTrue:[ |
|
1017 |
topViews do:[:aView | |
|
1018 |
aView hide. |
|
1019 |
]. |
|
1020 |
]. |
|
1021 |
! |
|
1022 |
||
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1023 |
modalDialogFinished |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1024 |
"invoked, when a modal dialog is closed" |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1025 |
|
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1026 |
inModalLoop := false. |
7676 | 1027 |
modalGroup := nil. |
1028 |
||
1029 |
"Modified: / 13-11-2016 / 22:59:11 / cg" |
|
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1030 |
! |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1031 |
|
7676 | 1032 |
modalDialogStarts:aModalGroup |
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1033 |
"invoked, when a modal dialog is opened" |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1034 |
|
8447 | 1035 |
modalGroup := aModalGroup. "/ set it first, so that events may find out that they are |
1036 |
"/ processed in a modal context |
|
1037 |
self processEvents. "/ process any buffered message send events |
|
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1038 |
inModalLoop := true. |
7676 | 1039 |
|
1040 |
"Created: / 13-11-2016 / 17:18:31 / cg" |
|
1041 |
"Modified: / 13-11-2016 / 22:58:57 / cg" |
|
8447 | 1042 |
"Modified (comment): / 17-08-2018 / 17:46:38 / Stefan Vogel" |
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1043 |
! |
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
1044 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1045 |
realizeTopViews |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1046 |
"realize all topViews associated to this windowGroup." |
244 | 1047 |
|
1048 |
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
|
1049 |
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
|
1050 |
aView realize. |
9bda3ac0d83d
no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1051 |
]. |
244 | 1052 |
]. |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1053 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1054 |
"Created: 24.7.1997 / 12:56:09 / cg" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1055 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1056 |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1057 |
restart |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1058 |
"restart after a snapin. |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1059 |
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
|
1060 |
my views." |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1061 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1062 |
topViews notNil ifTrue:[ |
8069 | 1063 |
" |
1064 |
need a new semaphore, since obsolete processes |
|
1065 |
(from our previous live) may still sit on the current semaphore |
|
1066 |
" |
|
1067 |
mySensor eventSemaphore:(Semaphore name:'WGroup eventSema'). |
|
1068 |
isModal ifFalse:[ |
|
1069 |
self startupWith:[self restartTopViews]. |
|
1070 |
] |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1071 |
] |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1072 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1073 |
"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
|
1074 |
! |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1075 |
|
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1076 |
restartTopViews |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1077 |
"inform all topViews associated to this windowGroup. |
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1078 |
about the restart." |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1079 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1080 |
topViews notNil ifTrue:[ |
2723 | 1081 |
topViews do:[:aView | |
1082 |
aView isPopUpView ifFalse:[ |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1083 |
"/ aView realize. |
2723 | 1084 |
aView restarted |
1085 |
]. |
|
1086 |
]. |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1087 |
]. |
180 | 1088 |
|
2644
bb15778539af
oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents:
2587
diff
changeset
|
1089 |
"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
|
1090 |
"Created: / 6.5.1999 / 09:46:33 / cg" |
244 | 1091 |
! |
180 | 1092 |
|
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1093 |
shutDown |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1094 |
"shutdown the window group; close all views and |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1095 |
terminate the process" |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1096 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1097 |
self closeDownViews. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1098 |
self shutDownProcess. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1099 |
! |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1100 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1101 |
shutDownProcess |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1102 |
"shutdown the window group process" |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1103 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1104 |
|p| |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1105 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1106 |
myProcess notNil ifTrue:[ |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1107 |
p := myProcess. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1108 |
myProcess := nil. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1109 |
p terminate. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1110 |
] |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1111 |
! |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1112 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1113 |
startupModal:checkBlock |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1114 |
"startup the window-group in a modal loop |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1115 |
(i.e. under the currently running process); |
1876
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1116 |
checkBlock is evaluated and the modal loop is left, |
6b5a5931a2b9
allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
1117 |
whenever false is returned." |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1118 |
|
7827 | 1119 |
^ self startupModal:checkBlock forGroup:(self class activeGroup). |
1120 |
||
1121 |
"Created: / 10-12-1995 / 14:15:11 / cg" |
|
1122 |
"Modified: / 20-08-1997 / 17:54:33 / cg" |
|
1123 |
"Modified: / 31-01-2017 / 20:43:37 / stefan" |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1124 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1125 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1126 |
startupModal:checkBlock forGroup:mainGroup |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1127 |
"startup the window-group in a modal loop |
3780
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1128 |
(i.e. under the currently running process - NOT creating a new process); |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1129 |
checkBlock is evaluated and loop is left, when false is returned. |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1130 |
The mainGroup info is required to allow peeking into its |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1131 |
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
|
1132 |
|
4182 | 1133 |
|prevActiveKeyboardGrab prevActivePointerGrab prevFocus device tops prevGroup |
5270
5db2458e62c4
return focus disabled (the getKeyboadFocus as implemented
Claus Gittinger <cg@exept.de>
parents:
5267
diff
changeset
|
1134 |
oldFocusScheme returnFocus| |
5db2458e62c4
return focus disabled (the getKeyboadFocus as implemented
Claus Gittinger <cg@exept.de>
parents:
5267
diff
changeset
|
1135 |
|
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1136 |
"/ experimental (but seem to work fine...) |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1137 |
returnFocus := false. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1138 |
oldFocusScheme := false. |
3348 | 1139 |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1140 |
"set previousGroup to the main (non-modal) group" |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1141 |
|
6118 | 1142 |
previousGroup isNil ifTrue:[ |
7633 | 1143 |
(mainGroup ~~ self) ifTrue:[ |
1144 |
previousGroup := mainGroup |
|
1145 |
]. |
|
6118 | 1146 |
]. |
3348 | 1147 |
prevGroup := previousGroup. |
3354 | 1148 |
prevGroup notNil ifTrue:[ |
1149 |
"/ remember current grab, in case I am opened by |
|
1150 |
"/ a popup (such as an extendedComboBox) ... |
|
1151 |
device := prevGroup graphicsDevice. |
|
1152 |
prevActiveKeyboardGrab := device activeKeyboardGrab. |
|
1153 |
prevActivePointerGrab := device activePointerGrab. |
|
1154 |
]. |
|
8765 | 1155 |
"/ Transcript showCR:'prevGroup: %1' with:prevGroup. |
1156 |
"/ Transcript showCR:'prevFocus: %1' with:prevFocus. |
|
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1157 |
isModal := true. |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1158 |
|
3780
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1159 |
myProcess isNil ifTrue:[ |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1160 |
creatingProcess := Processor activeProcess |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1161 |
]. |
69a0a7142c48
remember process which created a modal group,
Claus Gittinger <cg@exept.de>
parents:
3777
diff
changeset
|
1162 |
|
8765 | 1163 |
"/ the old scheme fetched the current focus before (the new does it below, after). |
1164 |
"/ this has an effect iff the opened dialog does affect the opening application |
|
1165 |
"/ (i.e. changes its state, by adding a view or changes its focus view). |
|
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1166 |
oldFocusScheme ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1167 |
previousGroup notNil ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1168 |
prevFocus := previousGroup focusView. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1169 |
]. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1170 |
]. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1171 |
|
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1172 |
mainGroup notNil ifTrue:[ |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1173 |
"/ tell the other group, that some modal dialog has started. |
7676 | 1174 |
mainGroup modalDialogStarts:self. |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1175 |
]. |
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1176 |
[ |
7619 | 1177 |
self realizeTopViews. |
8292 | 1178 |
self eventLoopWhile:checkBlock onLeave:[] |
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1179 |
] ensure:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1180 |
mainGroup notNil ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1181 |
"/ tell the other group, that some modal dialog has closed down. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1182 |
mainGroup modalDialogFinished |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1183 |
] |
3352 | 1184 |
]. |
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1185 |
|
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1186 |
returnFocus ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1187 |
"/ restore current grab, in case was opened by |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1188 |
"/ a popup (such as an extendedComboBox) ... |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1189 |
mainGroup notNil ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1190 |
(prevGroup isModal or:[prevGroup isPopUp]) ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1191 |
" |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1192 |
return the input focus to the previously active group's top. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1193 |
" |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1194 |
tops := prevGroup topViews. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1195 |
tops notEmptyOrNil ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1196 |
tops first getKeyboardFocus. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1197 |
]. |
3348 | 1198 |
]. |
1199 |
]. |
|
1200 |
]. |
|
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1201 |
|
8765 | 1202 |
"/ the new scheme fetches the current focus afterwards. |
1203 |
"/ in case the maingroup changed its state, by adding a view or changed its focus view. |
|
5445
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1204 |
oldFocusScheme ifFalse:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1205 |
previousGroup notNil ifTrue:[ |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1206 |
prevFocus := previousGroup focusView. |
eb5e6920f2da
changed: #startupModal:forGroup:
Claus Gittinger <cg@exept.de>
parents:
5364
diff
changeset
|
1207 |
]. |
4182 | 1208 |
]. |
1209 |
||
1210 |
prevFocus notNil ifTrue:[ |
|
8765 | 1211 |
previousGroup focusView requestFocus. |
4182 | 1212 |
]. |
1213 |
||
3348 | 1214 |
prevActivePointerGrab notNil ifTrue:[ device grabPointerInView:prevActivePointerGrab ]. |
1215 |
prevActiveKeyboardGrab notNil ifTrue:[ device grabKeyboardInView:prevActiveKeyboardGrab ]. |
|
1216 |
||
7676 | 1217 |
"Created: / 10-12-1995 / 14:14:26 / cg" |
1218 |
"Modified: / 13-11-2016 / 17:19:16 / cg" |
|
1219 |
"Modified (format): / 14-11-2016 / 10:24:03 / cg" |
|
8292 | 1220 |
"Modified: / 15-02-2018 / 18:32:24 / stefan" |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1221 |
! |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1222 |
|
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1223 |
startupWith:startupAction |
244 | 1224 |
"startup the window-group; |
1822
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1225 |
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
|
1226 |
The startupAction arg is evaluated by the windowGroup process, |
38f24dca2eb2
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
1227 |
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
|
1228 |
[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
|
1229 |
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
|
1230 |
blocking operations ...]" |
244 | 1231 |
|
7984 | 1232 |
|invokingApp| |
244 | 1233 |
|
1234 |
previousGroup := nil. |
|
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1235 |
|
244 | 1236 |
myProcess isNil ifTrue:[ |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1237 |
isModal := false. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1238 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1239 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1240 |
"/ this is the windowGroup process; |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1241 |
"/ realize all views, then handle events forever |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1242 |
"/ (well, not really forever ... ;-) |
2878 | 1243 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1244 |
myProcess := [ |
7827 | 1245 |
[ |
1246 |
startupAction value. |
|
1247 |
self showWaitCursorWhenBusyForMillis:400. |
|
8292 | 1248 |
self eventLoopWhile:[true] onLeave:[]. |
7827 | 1249 |
] ensure:[ |
1250 |
|dev w app| |
|
1251 |
||
1252 |
(w := self mainView) notNil ifTrue:[ |
|
1253 |
(app := w application) notNil ifTrue:[ |
|
1254 |
app release |
|
1255 |
] |
|
1256 |
]. |
|
1257 |
dev := self graphicsDevice. |
|
1258 |
(dev notNil and:[views notNil]) ifTrue:[ |
|
1259 |
dev deviceIOErrorSignal catch:[ |
|
1260 |
"/ just in case the view did not yet have a chance to |
|
1261 |
"/ shutDown properly (process killed in processMonitor) |
|
7619 | 1262 |
self closeDownViews |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1263 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1264 |
] |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1265 |
] |
7827 | 1266 |
] newProcess. |
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1267 |
|
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1268 |
self setProcessNameWithRedirectIndicator:''. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
1269 |
myProcess priority:processPriority; |
3341 | 1270 |
beGroupLeader; |
1271 |
beGUIProcess. |
|
180 | 1272 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1273 |
"/ |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1274 |
"/ when the process gets suspended, |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1275 |
"/ there maybe still buffered draw requests. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1276 |
"/ Arrange for them to be flushed then. |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1277 |
"/ (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
|
1278 |
"/ 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
|
1279 |
"/ all over the place) |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1280 |
"/ |
4801 | 1281 |
myProcess |
1282 |
addSuspendAction:[ |
|
1283 |
|dev| |
|
1284 |
||
1285 |
dev := self graphicsDevice. |
|
1286 |
dev notNil ifTrue:[dev flush]. |
|
1287 |
]. |
|
2851 | 1288 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1289 |
"/ allow for the currently active application, |
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1290 |
"/ to hook on new-application process creation. |
7984 | 1291 |
invokingApp := self class activeMainApplication. |
1292 |
invokingApp notNil ifTrue:[ |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1293 |
invokingApp postApplicationProcessCreate:myProcess windowGroup:self. |
7984 | 1294 |
invokingApp:= nil. "/ to avoid dangling references via blocks home context. |
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1295 |
]. |
2959 | 1296 |
|
3172
9dbb035935b6
Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents:
3156
diff
changeset
|
1297 |
myProcess resume. |
244 | 1298 |
] |
313 | 1299 |
|
4801 | 1300 |
"Created: / 24-07-1997 / 12:52:04 / cg" |
1301 |
"Modified: / 17-09-2007 / 10:59:34 / cg" |
|
8292 | 1302 |
"Modified: / 15-02-2018 / 18:29:11 / stefan" |
7590 | 1303 |
! |
1304 |
||
1305 |
unhideTopViews |
|
1306 |
"map all topViews associated to this windowGroup." |
|
1307 |
||
1308 |
|first| |
|
1309 |
||
1310 |
topViews notNil ifTrue:[ |
|
1311 |
first := true. |
|
1312 |
topViews do:[:aView | |
|
1313 |
aView map. |
|
1314 |
first ifTrue:[ |
|
1315 |
aView activate. |
|
1316 |
first := false. |
|
1317 |
]. |
|
1318 |
]. |
|
1319 |
]. |
|
3373
3585120d4d58
only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents:
3372
diff
changeset
|
1320 |
! ! |
180 | 1321 |
|
90 | 1322 |
!WindowGroup methodsFor:'enumerating'! |
54 | 1323 |
|
1117 | 1324 |
allNonTopViewsDo:aBlock |
1325 |
"evaluate aBlock for all nonTopviews (i.e. subviews) in this group. |
|
1334 | 1326 |
This enumerates a copy of the view collection, to allow for |
1240 | 1327 |
destroy and other collection changing operations to be performed in the loop." |
1117 | 1328 |
|
1329 |
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
|
1330 |
views copy nonNilElementsDo:aBlock |
1117 | 1331 |
] |
1334 | 1332 |
|
1333 |
"Modified: 12.2.1997 / 12:20:25 / cg" |
|
1117 | 1334 |
! |
1335 |
||
1153 | 1336 |
allTopViewsDo:aBlock |
1337 |
"evaluate aBlock for all topviews in this group. |
|
1334 | 1338 |
This enumerates a copy of the view collection, to allow for |
1240 | 1339 |
destroy and other collection changing operations to be performed in the loop." |
1153 | 1340 |
|
1341 |
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
|
1342 |
topViews copy nonNilElementsDo:aBlock |
1153 | 1343 |
] |
1334 | 1344 |
|
1345 |
"Modified: 12.2.1997 / 12:20:30 / cg" |
|
1153 | 1346 |
! |
1347 |
||
54 | 1348 |
allTopViewsExcept:aView do:aBlock |
157 | 1349 |
"evaluate aBlock for all topviews except aView in this group. |
1334 | 1350 |
This enumerates a copy of the view collection, to allow for |
1240 | 1351 |
destroy and other collection changing operations to be performed in the loop." |
157 | 1352 |
|
1334 | 1353 |
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
|
1354 |
v ~~ aView ifTrue:[aBlock value:v] |
157 | 1355 |
]. |
1334 | 1356 |
|
1357 |
"Modified: 12.2.1997 / 12:22:10 / cg" |
|
157 | 1358 |
! |
1359 |
||
244 | 1360 |
allViewsDo:aBlock |
1361 |
"evaluate aBlock for all views & topviews in this group. |
|
1334 | 1362 |
This enumerates a copy of the view collection, to allow for |
1240 | 1363 |
destroy and other collection changing operations to be performed in the loop." |
244 | 1364 |
|
1117 | 1365 |
self allTopViewsDo:aBlock. |
1366 |
self allNonTopViewsDo:aBlock. |
|
1334 | 1367 |
|
1368 |
"Modified: 12.2.1997 / 12:20:20 / cg" |
|
244 | 1369 |
! |
1370 |
||
1371 |
partnersDo:aBlock |
|
1372 |
"evaluate aBlock for all partnerViews. |
|
1334 | 1373 |
This enumerates a copy of the view collection, to allow for |
1240 | 1374 |
destroy and other collection changing operations to be performed in the loop." |
244 | 1375 |
|
1334 | 1376 |
self allTopViewsDo:[:v | |
3622
42b9c35a0f18
use #isSlave, #isPartner instead of comparing the type
Claus Gittinger <cg@exept.de>
parents:
3619
diff
changeset
|
1377 |
v isPartner ifTrue:[aBlock value:v]. |
244 | 1378 |
]. |
1334 | 1379 |
|
1380 |
"Modified: 12.2.1997 / 12:21:41 / cg" |
|
244 | 1381 |
! |
1382 |
||
157 | 1383 |
slavesDo:aBlock |
1384 |
"evaluate aBlock for all slaveViews. |
|
1334 | 1385 |
This enumerates a copy of the view collection, to allow for |
1240 | 1386 |
destroy and other collection changing operations to be performed in the loop." |
54 | 1387 |
|
1334 | 1388 |
self allTopViewsDo:[:v | |
3622
42b9c35a0f18
use #isSlave, #isPartner instead of comparing the type
Claus Gittinger <cg@exept.de>
parents:
3619
diff
changeset
|
1389 |
v isSlave ifTrue:[aBlock value:v]. |
157 | 1390 |
]. |
1334 | 1391 |
|
1392 |
"Modified: 12.2.1997 / 12:21:46 / cg" |
|
11 | 1393 |
! ! |
1394 |
||
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1395 |
!WindowGroup methodsFor:'event debugging'! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1396 |
|
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1397 |
traceEvents |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1398 |
"return the event tracing flag" |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1399 |
|
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1400 |
^ traceEvents |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1401 |
! |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1402 |
|
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1403 |
traceEvents:trueOrFalse |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1404 |
"turn event tracing on/off" |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1405 |
|
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1406 |
traceEvents := trueOrFalse |
605
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1407 |
! ! |
20f960026796
convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
1408 |
|
19 | 1409 |
!WindowGroup methodsFor:'event handling'! |
11 | 1410 |
|
244 | 1411 |
eventLoop |
1412 |
"loop executed by windowGroup process; |
|
1413 |
wait-for and process events forever" |
|
1414 |
||
8292 | 1415 |
self eventLoopWhile:[true] onLeave:[] |
1416 |
||
1417 |
"Modified: / 15-02-2018 / 18:31:58 / stefan" |
|
244 | 1418 |
! |
1419 |
||
1420 |
eventLoopWhile:aBlock onLeave:cleanupActions |
|
8419 | 1421 |
"this is the main event loop in which application sits: |
1422 |
wait-for and process events. |
|
244 | 1423 |
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
|
1424 |
and aBlock evaluates to true. |
244 | 1425 |
|
1752 | 1426 |
Some signals are caught & handled: |
3348 | 1427 |
LeaveSignal forces an exit from the eventLoop; |
4220 | 1428 |
AbortOperationRequest brings us back into the loop, processing the next event; |
3348 | 1429 |
ActivityNotifications send a #showActivity: if nonModal, |
1430 |
otherwise they are ignored." |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1431 |
|
7827 | 1432 |
|signalsToHandle| |
244 | 1433 |
|
5520 | 1434 |
signalsToHandle := SignalSet |
8292 | 1435 |
with:LeaveSignal |
8419 | 1436 |
with:ActivityNotification |
8421 | 1437 |
with:HaltInterrupt. |
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1438 |
|
4474
58a2e62065a6
pass up AbortAllSignals to the original handler
Claus Gittinger <cg@exept.de>
parents:
4413
diff
changeset
|
1439 |
(isModal not or:[AbortAllOperationRequest isHandled not]) ifTrue:[ |
5520 | 1440 |
signalsToHandle add:AbortAllOperationRequest |
4474
58a2e62065a6
pass up AbortAllSignals to the original handler
Claus Gittinger <cg@exept.de>
parents:
4413
diff
changeset
|
1441 |
]. |
5520 | 1442 |
doNotCloseOnAbortSignal ifTrue:[ |
1443 |
signalsToHandle add:AbortOperationRequest |
|
5288 | 1444 |
]. |
1445 |
||
8330 | 1446 |
WindowGroupQuery answer:self do:[ |
1447 |
[ "/ ... ensure |
|
8292 | 1448 |
|g mainGroup mySema waitSema mainSema groupForSema| |
7619 | 1449 |
|
1450 |
waitSema := mySema := mySensor eventSemaphore. |
|
1451 |
||
1452 |
isModal ifTrue:[ |
|
1453 |
mainGroup := self mainGroup. |
|
1454 |
mainGroup == self ifTrue:[ |
|
1455 |
mainGroup := nil |
|
1456 |
]. |
|
1457 |
] ifFalse:[ |
|
1458 |
mainGroup := previousGroup |
|
3348 | 1459 |
]. |
7619 | 1460 |
|
1461 |
"/ if this is an event loop for a modal loop (popup or dialog), |
|
1462 |
"/ also make sure that we react on events coming for the mainGroup |
|
1463 |
"/ to allow for redraw of those views. |
|
1464 |
mainGroup notNil ifTrue:[ |
|
1465 |
mainSema := mainGroup sensor eventSemaphore. |
|
1466 |
waitSema := SemaphoreSet with:mySema with:mainSema. |
|
1467 |
||
1468 |
"/ must also care for all other groups in between |
|
1469 |
"/ (in case its a modal dialog opened from a modal dialog) |
|
1470 |
g := previousGroup. |
|
1471 |
g ~~ mainGroup ifTrue:[ |
|
1472 |
groupForSema := IdentityDictionary new. |
|
8292 | 1473 |
[ |
1474 |
|eventSema| |
|
1475 |
||
7619 | 1476 |
g sensor notNil ifTrue:[ |
8292 | 1477 |
eventSema := g sensor eventSemaphore. |
1478 |
waitSema add:eventSema. |
|
1479 |
groupForSema at:eventSema put:g. |
|
7619 | 1480 |
]. |
1481 |
g := g previousGroup. |
|
8292 | 1482 |
g ~~ mainGroup |
1483 |
] whileTrue. |
|
3348 | 1484 |
]. |
1485 |
]. |
|
1486 |
||
7841 | 1487 |
aBlock whileTrue:[ |
7619 | 1488 |
(views isNil and:[topViews isNil]) ifTrue:[ |
1489 |
myProcess notNil ifTrue:[ |
|
1490 |
self shutDownProcess. |
|
1491 |
"not reached - there is no life after death" |
|
1492 |
]. |
|
1493 |
" |
|
1494 |
this is the end of a modal loop |
|
1495 |
(not having a private process ...) |
|
1496 |
" |
|
3348 | 1497 |
^ self |
1498 |
]. |
|
1499 |
||
7619 | 1500 |
(graphicsDevice notNil and:[graphicsDevice isOpen not]) ifTrue:[ |
1501 |
self closeDownViews. |
|
1502 |
^ self. |
|
3348 | 1503 |
]. |
7619 | 1504 |
|
1505 |
signalsToHandle handle:[:ex | |
|
1506 |
|theSig| |
|
1507 |
||
1508 |
theSig := ex creator. |
|
1509 |
(AbortAllOperationRequest accepts:theSig) ifTrue:[ |
|
1510 |
"on AbortAllOperationRequest or AbortOperationRequest, |
|
1511 |
stay in loop" |
|
1512 |
ex return |
|
3348 | 1513 |
]. |
7619 | 1514 |
theSig == LeaveSignal ifTrue:[ |
1515 |
"/ |
|
1516 |
"/ on leave, exit the event loop |
|
1517 |
"/ |
|
1518 |
self closeDownViews. |
|
1519 |
^ self |
|
1520 |
]. |
|
8421 | 1521 |
(HaltInterrupt accepts:theSig) ifTrue:[ |
1522 |
haltInterruptHandler isNil ifTrue:[ |
|
8419 | 1523 |
ex reject. |
1524 |
]. |
|
8421 | 1525 |
haltInterruptHandler valueWithOptionalArgument:ex. |
8419 | 1526 |
ex resume. |
1527 |
]. |
|
1528 |
||
7619 | 1529 |
"/ ActivityNotification |
1530 |
"/ |
|
1531 |
"/ if I am a modal-group, let it be handled |
|
8419 | 1532 |
"/ by the outer main-group's handler (but only if there is one) |
7619 | 1533 |
"/ otherwise show the activityMessage and continue. |
1534 |
"/ |
|
1535 |
isModal ifTrue:[ |
|
1536 |
(theSig isHandledIn:ex handlerContext sender) ifTrue:[ |
|
4408
308c798612a8
more care for brokenConnections.
Claus Gittinger <cg@exept.de>
parents:
4378
diff
changeset
|
1537 |
ex reject. |
7619 | 1538 |
"never reached" |
4408
308c798612a8
more care for brokenConnections.
Claus Gittinger <cg@exept.de>
parents:
4378
diff
changeset
|
1539 |
]. |
5569
25b945e9c1f5
changed: #eventLoopWhile:onLeave:
Claus Gittinger <cg@exept.de>
parents:
5520
diff
changeset
|
1540 |
] ifFalse:[ |
7619 | 1541 |
self showActivity:ex messageText. |
5569
25b945e9c1f5
changed: #eventLoopWhile:onLeave:
Claus Gittinger <cg@exept.de>
parents:
5520
diff
changeset
|
1542 |
]. |
7619 | 1543 |
ex proceedWith:nil. |
1544 |
] do:[ |
|
7827 | 1545 |
|gotSema mainView| |
7619 | 1546 |
|
1547 |
(mainGroup notNil or:[mySensor hasEvents not]) ifTrue:[ |
|
1548 |
waitSema isNil ifTrue:[ |
|
1549 |
"/ oops - how can this happen .... |
|
1550 |
^ self. |
|
1551 |
]. |
|
1552 |
"/ Flush device output before going to sleep. |
|
1553 |
"/ This may produce more events to arrive. |
|
1554 |
"/ Q: is this still needed (see suspendAction) ? |
|
1555 |
Error |
|
1556 |
handle:[:ex | |
|
1557 |
(graphicsDevice notNil and:[graphicsDevice isOpen not]) ifTrue:[ |
|
1558 |
'WindowGroup [warning]: Error in flush - closing views' errorPrintCR. |
|
1559 |
self closeDownViews. |
|
1560 |
^ self. |
|
1561 |
]. |
|
1562 |
ex reject. |
|
1563 |
] |
|
1564 |
do:[ |
|
1565 |
self graphicsDevice flush. |
|
1566 |
]. |
|
1567 |
||
7827 | 1568 |
Processor activeProcess setStateTo:(self isModal ifTrue:[#modalEventWait] ifFalse:[#eventWait]) if:#active. |
7619 | 1569 |
|
1570 |
"/ now, wait for an event to arrive |
|
9004 | 1571 |
Processor activeProcess setStateTo:(self isModal ifTrue:[#modalEventWait] ifFalse:[#eventWait]) if:#active. |
7619 | 1572 |
gotSema := waitSema wait. |
3348 | 1573 |
] ifFalse:[ |
7619 | 1574 |
gotSema := mySema |
1575 |
]. |
|
1576 |
||
1577 |
"/ some bad guy ;-) could have closed all down |
|
1578 |
"/ in the meanwhile ... |
|
1579 |
mySensor notNil ifTrue:[ |
|
1580 |
gotSema == mySema ifTrue:[ |
|
1581 |
"/ |
|
1582 |
"/ an event for me |
|
1583 |
"/ |
|
1584 |
self processEventsWithModalGroup:nil |
|
3348 | 1585 |
] ifFalse:[ |
7619 | 1586 |
"/ |
1587 |
"/ modal and an event for my mainGroup or one of the groups in-between |
|
1588 |
"/ (we arrive here after we woke up on maingroup sensor eventSemaphore) |
|
1589 |
"/ |
|
1590 |
groupForSema notNil ifTrue:[ |
|
8292 | 1591 |
g := groupForSema at:gotSema ifAbsent:mainGroup. |
7619 | 1592 |
] ifFalse:[ |
1593 |
g := mainGroup |
|
1594 |
]. |
|
1595 |
||
1596 |
g topViews notNil ifTrue:[ |
|
1597 |
mainView := g topViews first |
|
1598 |
]. |
|
1599 |
mainView notNil ifTrue:[ |
|
1600 |
"/ if anything happened to the mainGroup |
|
1601 |
"/ bring my own topView back to the front |
|
1602 |
"/ This keeps modalBoxes visible |
|
1603 |
"/ (not needed with X, where the windowManager does it for us) |
|
1604 |
(g sensor hasConfigureEventFor:mainView) ifTrue:[ |
|
1605 |
(topViews size ~~ 0 and:[topViews first shown]) ifTrue:[ |
|
1606 |
topViews first raiseDeiconified |
|
1607 |
]. |
|
7131 | 1608 |
]. |
1609 |
]. |
|
7619 | 1610 |
g processEventsWithModalGroup:self. |
1611 |
] |
|
3348 | 1612 |
] |
7619 | 1613 |
]. |
3348 | 1614 |
]. |
7619 | 1615 |
] ensure:cleanupActions |
1616 |
] |
|
313 | 1617 |
|
5569
25b945e9c1f5
changed: #eventLoopWhile:onLeave:
Claus Gittinger <cg@exept.de>
parents:
5520
diff
changeset
|
1618 |
"Modified: / 06-07-2010 / 11:47:27 / cg" |
8330 | 1619 |
"Modified (comment): / 11-04-2018 / 11:30:52 / stefan" |
8421 | 1620 |
"Modified: / 28-06-2018 / 15:16:42 / Claus Gittinger" |
3373
3585120d4d58
only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents:
3372
diff
changeset
|
1621 |
! |
244 | 1622 |
|
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1623 |
executePostEventHooksFor:anEvent |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1624 |
postEventHook notNil ifTrue:[ |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1625 |
postEventHook processEvent:anEvent |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1626 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1627 |
postEventHooks notNil ifTrue:[ |
8433 | 1628 |
postEventHooks copy do:[:eachHook | |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1629 |
eachHook isBlock ifTrue:[ |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1630 |
eachHook value:anEvent |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1631 |
] ifFalse:[ |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1632 |
eachHook processEvent:anEvent |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1633 |
] |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1634 |
] |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1635 |
]. |
8433 | 1636 |
|
1637 |
"Modified: / 26-07-2018 / 22:35:02 / Claus Gittinger" |
|
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1638 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1639 |
|
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1640 |
executePreEventHooksFor:anEvent |
5003 | 1641 |
"return true, if the event was eaten" |
1642 |
||
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1643 |
traceEvents == true ifTrue:[ |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1644 |
anEvent displayString infoPrintCR. |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1645 |
]. |
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1646 |
|
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1647 |
preEventHook notNil ifTrue:[ |
8502 | 1648 |
(preEventHook processEvent:anEvent) ifTrue:[ |
1649 |
"/ Transcript showCR:('event was eaten by %1' bindWith:preEventHook). |
|
1650 |
^ true |
|
1651 |
]. |
|
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1652 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1653 |
preEventHooks notNil ifTrue:[ |
8433 | 1654 |
preEventHooks copy do:[:eachHook | |
5584
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1655 |
"/ can only be nil if changed, while enumerating... |
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1656 |
eachHook notNil ifTrue:[ |
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1657 |
eachHook isBlock ifTrue:[ |
8502 | 1658 |
(eachHook value:anEvent) ifTrue:[ |
1659 |
"/ Transcript showCR:('event was eaten by %1' bindWith:eachHook). |
|
1660 |
^ true |
|
1661 |
]. |
|
5584
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1662 |
] ifFalse:[ |
8502 | 1663 |
(eachHook processEvent:anEvent) ifTrue:[ |
1664 |
"/ Transcript showCR:('event was eaten by %1' bindWith:eachHook). |
|
1665 |
^ true |
|
1666 |
]. |
|
5584
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1667 |
] |
3786
8e238ec303d8
obsoleted preEventHook and postEventHook;
Claus Gittinger <cg@exept.de>
parents:
3780
diff
changeset
|
1668 |
] |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1669 |
] |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1670 |
]. |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1671 |
^ false |
5584
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1672 |
|
57e0a4a74d0e
changed: #executePreEventHooksFor:
Claus Gittinger <cg@exept.de>
parents:
5569
diff
changeset
|
1673 |
"Modified: / 28-07-2010 / 03:34:33 / cg" |
8433 | 1674 |
"Modified: / 26-07-2018 / 22:34:28 / Claus Gittinger" |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1675 |
! |
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
1676 |
|
3736 | 1677 |
lastEvent |
8330 | 1678 |
^ LastEventQuery query |
1679 |
||
1680 |
"Modified: / 11-04-2018 / 11:21:21 / stefan" |
|
3736 | 1681 |
! |
1682 |
||
244 | 1683 |
leaveEventLoop |
1684 |
"immediately leave the event loop, returning way back. |
|
1685 |
This can be used to leave (and closedown) a modal group. |
|
1686 |
(for normal views, this does not make sense)" |
|
1687 |
||
1688 |
^ LeaveSignal raise |
|
1689 |
! |
|
1690 |
||
3737 | 1691 |
leaveModalLoop |
1692 |
"if the receiver has a modal window open (i.e. is in a modalLoop), |
|
1693 |
force him to leave it and proceed as usual. |
|
1694 |
Be warned: this is not a regular (i.e. OK/ESCAPE) the modal box closing." |
|
1695 |
||
1696 |
self isInModalLoop ifTrue:[ |
|
8330 | 1697 |
self process interruptWith:[LeaveSignal isHandled ifTrue:[LeaveSignal raise]] |
3737 | 1698 |
]. |
8330 | 1699 |
|
1700 |
"Modified: / 11-04-2018 / 11:35:30 / stefan" |
|
3737 | 1701 |
! |
1702 |
||
103 | 1703 |
processEvents |
6861 | 1704 |
"process all pending events from either the damage- or user input queues. |
103 | 1705 |
Abort is assumed to be handled elsewhere." |
19 | 1706 |
|
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1707 |
self processEventsWithModalGroup:nil |
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1708 |
|
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1709 |
"Modified: 5.3.1997 / 11:33:51 / cg" |
1328 | 1710 |
! |
1711 |
||
1419
a40a4f3ad589
while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
1712 |
processEventsWithModalGroup:modalGroup |
6861 | 1713 |
"process all pending events from either the damage- or user input queues. |
5364
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
1714 |
Abort is assumed to be handled elsewhere. |
8921 | 1715 |
If modalGroup is non-nil, this is actually called from a modal-group's eventloop, |
5364
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
1716 |
in order for the underlying mainGroup (me) to handle its redraw events. |
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
1717 |
In this case, ignore any user input events." |
1328 | 1718 |
|
513
47b0f4bf4d89
use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
1719 |
<resource: #keyboard (#Escape )> |
496 | 1720 |
|
8330 | 1721 |
|event busyHookBlock busyHookCalled| |
11 | 1722 |
|
72 | 1723 |
self processExposeEvents. |
180 | 1724 |
|
8309 | 1725 |
[ "... on:ensure:" |
7825 | 1726 |
[mySensor notNil |
1727 |
and:[(event := mySensor nextEvent) notNil]] whileTrue:[ |
|
8309 | 1728 |
|ignore focus firstTop evView |
8921 | 1729 |
modalTop delegateKeyPress modalGroupTopViews keyboardProcessor |
1730 |
top evReceiver v| |
|
8309 | 1731 |
|
7825 | 1732 |
ignore := false. |
1733 |
focus := focusView. |
|
8921 | 1734 |
delegateKeyPress := false. |
7825 | 1735 |
modalTop := nil. |
1736 |
||
1737 |
modalGroup notNil ifTrue:[ |
|
1738 |
"/ an incoming event for a masterView, |
|
1739 |
"/ while being blocked by some other modalView. |
|
1740 |
||
8310 | 1741 |
modalGroupTopViews := modalGroup topViews. |
1742 |
modalGroupTopViews notNil ifTrue:[ |
|
1743 |
modalTop := modalGroupTopViews firstOrNil. |
|
1744 |
]. |
|
7825 | 1745 |
|
1746 |
event isKeyEvent ifTrue:[ |
|
1747 |
"/ forward keyboard events to my modal |
|
8921 | 1748 |
"/ group's first topView or the group's focusView. |
7825 | 1749 |
modalTop notNil ifTrue:[ |
1750 |
focus := modalTop. |
|
8921 | 1751 |
delegateKeyPress := true. |
7825 | 1752 |
]. |
8921 | 1753 |
(v := modalGroup focusView) notNil ifTrue:[ |
1754 |
focus := v |
|
3096 | 1755 |
]. |
7825 | 1756 |
] ifFalse:[ |
1757 |
event isFocusEvent ifTrue:[ |
|
1758 |
event isFocusInEvent ifTrue:[ |
|
1759 |
"/ move focus over to modalBox |
|
1760 |
modalTop notNil ifTrue:[ |
|
1761 |
modalTop getKeyboardFocus. |
|
1762 |
"/ focusIn is forwarded to the modalGroup |
|
1763 |
"/ (since keyboard is forwarded) |
|
1764 |
event view:modalTop. |
|
1765 |
focus := modalTop. |
|
1766 |
] |
|
1767 |
] ifFalse:[ |
|
1768 |
"/ focusOut goes to both the modal and |
|
1769 |
"/ the blocked main-group |
|
1770 |
"/ (actually, only the very first focusOut |
|
1771 |
"/ is needed in the mainGroup (to turn off the cursor) |
|
1772 |
"/ all others are only needed in the modalGroup) |
|
1773 |
||
1774 |
"/ syntheticEvent := event copy. |
|
1775 |
"/ syntheticEvent view:modalTop. |
|
1776 |
"/ LastEventQuerySignal handle:[:ex | |
|
1777 |
"/ ex proceedWith:syntheticEvent |
|
1778 |
"/ ] do:[ |
|
1779 |
"/ syntheticEvent sendEventWithFocusOn:nil. |
|
1780 |
"/ ]. |
|
1781 |
||
1782 |
"/ event view:modalTop. |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1783 |
]. |
8921 | 1784 |
delegateKeyPress := true. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1785 |
] ifFalse:[ |
7825 | 1786 |
event isPointerLeaveEvent ifTrue:[ |
3096 | 1787 |
] ifFalse:[ |
8921 | 1788 |
delegateKeyPress := true. |
7825 | 1789 |
event isUserEvent ifTrue:[ |
1790 |
ignore := true. |
|
1791 |
||
1792 |
event isButtonPressEvent ifTrue:[ |
|
8921 | 1793 |
event selector:#buttonPressOutside:x:y:. |
1794 |
ignore := true. |
|
8992 | 1795 |
(modalTop notNil and:[modalTop processOutsideButtonEventWhileModal:event]) ifFalse:[ |
8921 | 1796 |
"/ raise the modalTop and beep |
1797 |
event view device beep. |
|
1798 |
modalTop notNil ifTrue:[ modalTop raise ]. |
|
1799 |
] |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1800 |
] |
3096 | 1801 |
] |
1802 |
] |
|
7825 | 1803 |
] |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1804 |
]. |
7825 | 1805 |
"/ also update the slave-sensor's modifier state from the master-sensor's |
1806 |
"/ state. This is needed for a popUpView to see the correct shift-, ctrl- and alt states |
|
1807 |
"/ in its own sensor. |
|
1808 |
||
1809 |
"/ cg: disabled 15-jun-2014 |
|
1810 |
"/ mhmh - something seems to have changed on a lower level, |
|
1811 |
"/ so now the modal sensor already has the correct sensor state |
|
1812 |
"/ (as opposed to previous versions, where this was not true). |
|
1813 |
"/ Now, enabling the following line leads to a confirmation dialog to NOT |
|
1814 |
"/ behave correctly w.r.t. Shift-CursorRight. |
|
1815 |
"/ modalGroup sensor updateModifierStatesFrom:mySensor |
|
1816 |
]. |
|
1817 |
||
1818 |
ignore ifFalse:[ |
|
1819 |
(views notNil or:[topViews notNil]) ifTrue:[ |
|
1820 |
"/ give eventRecorders, catchers etc. |
|
1821 |
"/ a chance to eat or modify that event |
|
1822 |
modalGroup notNil ifTrue:[ |
|
1823 |
ignore := modalGroup executePreEventHooksFor:event. |
|
1824 |
] ifFalse:[ |
|
1825 |
ignore := false |
|
1826 |
]. |
|
1827 |
ignore ifFalse:[ |
|
1828 |
ignore := self executePreEventHooksFor:event. |
|
3777 | 1829 |
ignore ifFalse:[ |
7825 | 1830 |
evView := event view. |
1831 |
||
1832 |
(event isKeyEvent |
|
1833 |
and:[(keyboardProcessor := (modalTop ? evView topView) keyboardProcessor) notNil]) ifTrue:[ |
|
1834 |
ignore := keyboardProcessor processEvent:event forModalView:modalTop |
|
1835 |
]. |
|
1836 |
||
4475 | 1837 |
ignore ifFalse:[ |
7825 | 1838 |
"/ event handling below will vanish ... |
1839 |
"/ (keyboardProcessor will do it eventually) |
|
1840 |
||
1841 |
event isKeyPressEvent ifTrue:[ |
|
1842 |
event key == #Escape ifTrue:[ |
|
8921 | 1843 |
delegateKeyPress ifTrue:[ |
7825 | 1844 |
top := modalTop. |
1845 |
] ifFalse:[ |
|
1846 |
(isModal and:[topViews notEmptyOrNil]) ifTrue:[ |
|
1847 |
top := topViews first. |
|
1848 |
] |
|
1849 |
]. |
|
1850 |
top notNil ifTrue:[ |
|
1851 |
"/ a popUpView does it himself (only closing one submenu) |
|
1852 |
(top isPopUpView not |
|
1853 |
or:[UserPreferences current closePopUpMenuChainOnEscape]) ifTrue:[ |
|
1854 |
top escapeIsCancel ifTrue:[ |
|
1855 |
top closeCancel. |
|
1856 |
"/ top hideRequest. |
|
1857 |
top realized ifFalse:[ ignore := true ]. |
|
4475 | 1858 |
] |
1859 |
] |
|
7825 | 1860 |
]. |
1861 |
] |
|
1862 |
] ifFalse:[ |
|
1863 |
"/ |
|
1864 |
"/ keep track of which view has the pointer |
|
1865 |
"/ |
|
1866 |
event isPointerEnterEvent ifTrue:[ |
|
1867 |
pointerView := evView |
|
1868 |
] ifFalse:[event isPointerLeaveEvent ifTrue:[ |
|
1869 |
pointerView := nil |
|
1870 |
]]. |
|
4475 | 1871 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1872 |
]. |
3349 | 1873 |
]. |
7825 | 1874 |
]. |
1875 |
||
1876 |
ignore ifFalse:[ |
|
1877 |
"/ |
|
1878 |
"/ buttonPress events turn off explicit focus, and reverts |
|
1879 |
"/ to implicit focus control |
|
1880 |
"/ This used to be done for every click - |
|
1881 |
"/ but behaved ugly if clicking in a scrollbar ... |
|
1882 |
||
1883 |
"/ XXX: move to dispatchEvent |
|
1884 |
event isButtonPressEvent ifTrue:[ |
|
1885 |
(evView wantsFocusWithButtonPress) ifTrue:[ |
|
1886 |
"/ cannot use 'evView requestFocus' here, |
|
1887 |
"/ since we want to enforce it without giving the |
|
1888 |
"/ view a chance to circumvent this. |
|
1889 |
||
1890 |
"/ evView requestFocus. |
|
1891 |
self focusView:evView. |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1892 |
]. |
7825 | 1893 |
]. |
1894 |
||
1895 |
(busyHook notNil and:[busyHookBlock isNil]) ifTrue:[ |
|
1896 |
(event isKeyEvent or:[event isButtonPressEvent]) ifTrue:[ |
|
1897 |
"/ start a timeout action - to invoke the busyHook after some time |
|
1898 |
busyHookCalled := false. |
|
1899 |
busyHookBlock := [ |
|
1900 |
(inModalLoop ~~ true and:[busyHookCalled not]) ifTrue:[ |
|
1901 |
busyHook value:true. |
|
1902 |
busyHookCalled := true |
|
1903 |
] |
|
1904 |
]. |
|
1905 |
Processor |
|
1906 |
addTimedBlock:busyHookBlock |
|
1907 |
for:Processor timeoutHandlerProcess |
|
8309 | 1908 |
afterMilliseconds:(busyHookTimeout ? BusyHookTime). |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1909 |
]. |
7825 | 1910 |
]. |
1911 |
event isMessageSendEvent ifTrue:[ |
|
1912 |
"/ a synthetic event (delayed message) |
|
6023 | 1913 |
"/ cg: seems to not be a good idea (see modalLoopStarts): |
1914 |
"/ if in a modal-loop, do not process now, but repush onto the queue |
|
1915 |
"/ modalGroup notNil ifTrue:[ |
|
1916 |
"/ mySensor pushEvent:event |
|
1917 |
"/ ] ifFalse:[ |
|
7825 | 1918 |
event value |
6023 | 1919 |
"/ ] |
7825 | 1920 |
] ifFalse:[ |
1921 |
" |
|
1922 |
if there is no view information in the event, |
|
1923 |
it must have been sent directly to the sensor. |
|
1924 |
Send it to the first topView. |
|
1925 |
" |
|
1926 |
(evReceiver := evView) isNil ifTrue:[ |
|
1927 |
(firstTop := topViews first) notNil ifTrue:[ |
|
1928 |
event isApplicationEvent ifTrue:[ |
|
1929 |
evReceiver := firstTop application ? firstTop |
|
1930 |
] ifFalse:[ |
|
1931 |
evReceiver := firstTop. |
|
1932 |
]. |
|
1933 |
] |
|
1934 |
]. |
|
1935 |
evReceiver isNil ifTrue:[ |
|
1936 |
('WindowGroup [warning]: no receiver to dispatch ' , event type asString , '-event to. Ignored.') infoPrintCR. |
|
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1937 |
] ifFalse:[ |
7825 | 1938 |
evReceiver dispatchEvent:event withFocusOn:focus delegate:true |
3096 | 1939 |
]. |
1940 |
]. |
|
7825 | 1941 |
]. |
1942 |
||
1943 |
"/ give eventRecorders, postProcessors |
|
1944 |
"/ a chance to see that event |
|
1945 |
self executePostEventHooksFor:event |
|
1946 |
] |
|
3096 | 1947 |
]. |
7825 | 1948 |
] "end while". |
8330 | 1949 |
] on:LastEventQuery do:[:ex | |
7825 | 1950 |
ex proceedWith:event |
3604
e32b5044a59e
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3557
diff
changeset
|
1951 |
] ensure:[ |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1952 |
busyHookBlock notNil ifTrue:[ |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1953 |
Processor removeTimedBlock:busyHookBlock. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1954 |
busyHookBlock := nil. |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1955 |
busyHookCalled ifTrue:[ |
3281
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1956 |
busyHook value:false. |
95e6d0e98f92
care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents:
3280
diff
changeset
|
1957 |
busyHookCalled := false. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1958 |
] |
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1959 |
]. |
3279
9d7a9a94bec0
unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents:
3278
diff
changeset
|
1960 |
]. |
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
1961 |
|
7825 | 1962 |
"Created: / 05-03-1997 / 11:33:11 / cg" |
1963 |
"Modified: / 04-08-1998 / 18:18:55 / cg" |
|
8330 | 1964 |
"Modified: / 11-04-2018 / 11:21:14 / stefan" |
1965 |
"Modified (format): / 11-04-2018 / 12:39:34 / stefan" |
|
8992 | 1966 |
"Modified: / 17-02-2020 / 13:53:32 / Stefan Vogel" |
3373
3585120d4d58
only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents:
3372
diff
changeset
|
1967 |
! |
48 | 1968 |
|
1969 |
processExposeEvents |
|
6861 | 1970 |
"process only pending expose events from the damage queue. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1971 |
This also handles resize, mapped and unmap events." |
48 | 1972 |
|
2407 | 1973 |
self processExposeEventsFor:nil |
1974 |
||
1975 |
"Modified: / 3.12.1998 / 14:01:57 / cg" |
|
1976 |
! |
|
1977 |
||
1978 |
processExposeEventsFor:aViewOrNil |
|
6861 | 1979 |
"process only pending expose events from the damage queue. |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
1980 |
This also handles resize, mapped and unmap events." |
2407 | 1981 |
|
8330 | 1982 |
|sensor| |
1983 |
||
8334 | 1984 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
1985 |
sensor hasDamage ifFalse:[^ self]. |
|
1986 |
||
1987 |
WindowGroupQuery answer:self do:[ |
|
1988 |
|event view| |
|
1989 |
||
1990 |
[(event := sensor nextDamageEventFor:aViewOrNil) notNil] whileTrue:[ |
|
1991 |
(views notNil or:[topViews notNil]) ifTrue:[ |
|
1992 |
view := event view. |
|
1993 |
(aViewOrNil isNil or:[aViewOrNil == view]) ifTrue:[ |
|
1994 |
LastEventQuery answer:event do:[ |
|
1995 |
(self executePreEventHooksFor:event) ifFalse:[ |
|
1996 |
"/ |
|
1997 |
"/ if the view is no longer shown (iconified or closed), |
|
1998 |
"/ this is a leftover event and ignored. |
|
1999 |
"/ |
|
2000 |
"/ could this ever be a non-damage ? |
|
2001 |
"/ |
|
2002 |
(view notNil and:[view shown or:[event isDamage not]]) ifTrue:[ |
|
2003 |
view dispatchEvent:event withFocusOn:nil delegate:true. |
|
3096 | 2004 |
]. |
3511
5c695c10caa1
multiple pre/post event hooks;
Claus Gittinger <cg@exept.de>
parents:
3486
diff
changeset
|
2005 |
]. |
8334 | 2006 |
self executePostEventHooksFor:event. |
2007 |
]. |
|
3096 | 2008 |
] |
2009 |
] |
|
2010 |
] |
|
90 | 2011 |
] |
1157 | 2012 |
|
8330 | 2013 |
"Created: / 03-12-1998 / 14:01:39 / cg" |
2014 |
"Modified: / 05-02-1999 / 22:26:44 / cg" |
|
8334 | 2015 |
"Modified (format): / 13-04-2018 / 12:36:58 / stefan" |
11 | 2016 |
! |
2017 |
||
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2018 |
processRealExposeEvents |
6861 | 2019 |
"process only pending expose events from the damage queue |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2020 |
(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
|
2021 |
This only handles true expose events - leaving map, unmap etc. in the queue. |
8450 | 2022 |
This is required before/after a scroll operation, |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2023 |
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
|
2024 |
|
2093 | 2025 |
self processRealExposeEventsFor:nil |
8450 | 2026 |
|
2027 |
"Modified (comment): / 22-08-2018 / 10:10:10 / Claus Gittinger" |
|
2093 | 2028 |
! |
2029 |
||
2030 |
processRealExposeEventsFor:someViewOrNil |
|
6861 | 2031 |
"process only pending expose events from the damage queue |
2093 | 2032 |
(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
|
2033 |
This only handles true expose events - leaving map, unmap etc. in the queue. |
8450 | 2034 |
This is required before/after a scroll operation, |
2093 | 2035 |
to wait for either a noExpose or a real expose." |
2036 |
||
7827 | 2037 |
|sensor| |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2038 |
|
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2039 |
(sensor := mySensor) isNil ifTrue:[^ self]. |
8334 | 2040 |
sensor hasDamage ifFalse:[^ self]. |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2041 |
|
8330 | 2042 |
WindowGroupQuery answer:self do:[ |
2043 |
|event| |
|
7827 | 2044 |
|
2045 |
[ |
|
7619 | 2046 |
"/ event := aView nextDamage. |
2047 |
event := sensor nextExposeEventFor:someViewOrNil. |
|
8330 | 2048 |
event isNil ifTrue:[ |
2049 |
^ self |
|
2050 |
]. |
|
7619 | 2051 |
|
2052 |
(views notNil or:[topViews notNil]) ifTrue:[ |
|
8330 | 2053 |
LastEventQuery answer:event do:[ |
2054 |
|view| |
|
2055 |
||
7619 | 2056 |
(self executePreEventHooksFor:event) ifFalse:[ |
2057 |
view := event view. |
|
2058 |
"/ |
|
2059 |
"/ if the view is no longer shown (iconified or closed), |
|
2060 |
"/ this is a leftover event and ignored. |
|
2061 |
"/ |
|
2062 |
view shown ifTrue:[ |
|
2063 |
view dispatchEvent:event withFocusOn:nil delegate:true. |
|
2064 |
] |
|
2065 |
]. |
|
2066 |
self executePostEventHooksFor:event. |
|
2067 |
] |
|
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
2068 |
] |
7827 | 2069 |
] loop. |
2070 |
]. |
|
2071 |
||
2072 |
"Created: / 02-07-1997 / 14:32:19 / cg" |
|
2073 |
"Modified: / 05-04-1998 / 11:35:43 / cg" |
|
8334 | 2074 |
"Modified: / 13-04-2018 / 12:29:20 / stefan" |
8450 | 2075 |
"Modified (comment): / 22-08-2018 / 10:10:22 / Claus Gittinger" |
1806
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2076 |
! |
16c958be35d8
fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents:
1752
diff
changeset
|
2077 |
|
2444 | 2078 |
repairDamage |
2079 |
"repair all damaged areas for any of my views right now." |
|
2080 |
||
2081 |
self processExposeEvents |
|
2082 |
||
2083 |
! |
|
2084 |
||
28 | 2085 |
waitForExposeFor:aView |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
2086 |
"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
|
2087 |
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
|
2088 |
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
|
2089 |
(i.e. a synthetic noExpose may be generated there)." |
28 | 2090 |
|
2091 |
mySensor waitForExposeFor:aView. |
|
4220 | 2092 |
AbortOperationRequest catch:[ |
3278
ecdd26a9d003
added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents:
3276
diff
changeset
|
2093 |
self processRealExposeEventsFor:aView |
90 | 2094 |
] |
500
a313e9fda9f0
ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents:
496
diff
changeset
|
2095 |
|
1851
6a6225647696
fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
2096 |
"Modified: 6.8.1997 / 19:50:24 / cg" |
11 | 2097 |
! ! |
19 | 2098 |
|
90 | 2099 |
!WindowGroup methodsFor:'focus control'! |
2100 |
||
2691
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
2101 |
defaultKeyboardConsumer |
4180 | 2102 |
|view keyboardProcessor| |
2103 |
||
2104 |
view := self mainView. |
|
2105 |
view notNil ifTrue:[ |
|
2106 |
keyboardProcessor := view keyboardProcessor. |
|
2107 |
keyboardProcessor notNil ifTrue:[ |
|
2108 |
^ keyboardProcessor componentWithInitialFocus. |
|
2109 |
] |
|
2110 |
]. |
|
2691
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
2111 |
^ nil |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
2112 |
! |
26dd87552563
provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents:
2686
diff
changeset
|
2113 |
|
2519 | 2114 |
explicitFocusView |
2115 |
"return the view which currently has the explicit (i.e. tabbed) focus" |
|
2116 |
||
2117 |
focusByTab == true ifFalse:[^ nil]. |
|
2118 |
^ focusView |
|
2119 |
! |
|
2120 |
||
6466 | 2121 |
focusBackToPreviousFocusView |
2122 |
"give focus to the view who had it before" |
|
2123 |
||
2124 |
previousFocusView notNil ifTrue:[ |
|
2125 |
previousFocusView isVisible ifTrue:[ |
|
6742 | 2126 |
"/ self focusToView:previousFocusView |
2127 |
self focusView:previousFocusView |
|
6466 | 2128 |
] |
2129 |
] |
|
2130 |
! |
|
2131 |
||
2517 | 2132 |
focusCameByTab |
6638 | 2133 |
^ focusByTab ? false |
2517 | 2134 |
! |
2135 |
||
6518 | 2136 |
focusMomentaryRelease |
2137 |
"release and reacquire focus. |
|
8042 | 2138 |
Use this to allow input fields with accept on lost focus |
6518 | 2139 |
to accept when a button or menu item is pressed" |
2140 |
||
2141 |
|oldFocusView| |
|
2142 |
||
6564 | 2143 |
"/ the problem was that the #focusToView: asked for canTab |
8042 | 2144 |
"/ what should not be done during restore (might answer false). |
6564 | 2145 |
|
6518 | 2146 |
oldFocusView := self focusView. |
6564 | 2147 |
oldFocusView isNil ifTrue:[^ self]. |
8042 | 2148 |
|
6564 | 2149 |
self focusView:nil. |
2150 |
||
2151 |
self focusView == oldFocusView ifTrue:[^ self]. |
|
2152 |
(oldFocusView shown and:[oldFocusView enabled]) ifTrue:[ |
|
2153 |
self focusView:oldFocusView. |
|
2154 |
]. |
|
2155 |
"/ self focusToView:nil. |
|
2156 |
"/ self focusToView:oldFocusView |
|
8042 | 2157 |
|
2158 |
"Modified (comment): / 30-05-2017 / 19:20:49 / mawalch" |
|
6518 | 2159 |
! |
2160 |
||
244 | 2161 |
focusNext |
6466 | 2162 |
"give focus to next view in the focusSequence from focusView or topView |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2163 |
" |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2164 |
|curView oldView nxtView myTopViews| |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2165 |
|
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2166 |
(myTopViews := topViews) isEmptyOrNil ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2167 |
self setFocusView:nil. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2168 |
^ self |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2169 |
]. |
244 | 2170 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2171 |
(curView := focusView) isNil ifTrue:[ |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2172 |
myTopViews do:[:aView| |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2173 |
(aView shown and:[(nxtView := aView focusNext) notNil]) ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2174 |
^ self focusView:nxtView byTab:true |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2175 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2176 |
]. |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2177 |
^ self |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2178 |
]. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2179 |
(nxtView := curView focusNext) notNil ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2180 |
self focusView:nxtView byTab:true. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2181 |
^ self |
949
3894d442e895
care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
2182 |
]. |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2183 |
self setFocusView:nil. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2184 |
|
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2185 |
[ oldView := curView. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2186 |
(curView := curView superView) notNil |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2187 |
] whileTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2188 |
curView shown ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2189 |
nxtView := curView focusNextChildAfter:oldView. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2190 |
nxtView notNil ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2191 |
^ self focusView:nxtView byTab:true |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2192 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2193 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2194 |
]. |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2195 |
"/ ? should tab through the windowGroup ? |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2196 |
focusView isNil ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2197 |
self focusNext |
244 | 2198 |
]. |
2199 |
! |
|
2200 |
||
2219 | 2201 |
focusNextFrom:aView |
2202 |
"give focus to the view after aView in the focusSequence" |
|
2203 |
||
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2204 |
self setFocusView:aView. |
2219 | 2205 |
self focusNext |
2206 |
||
2207 |
"Created: / 4.8.1998 / 02:43:17 / cg" |
|
2208 |
! |
|
2209 |
||
244 | 2210 |
focusPrevious |
6466 | 2211 |
"give focus to previous view in the focusSequence from focusView or topView |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2212 |
" |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2213 |
|curView oldView nxtView subViews done| |
244 | 2214 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2215 |
(curView := focusView) isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2216 |
topViews notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2217 |
curView := topViews detect:[:aView|aView shown] ifNone:nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2218 |
] |
2479
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
2219 |
]. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2220 |
curView isNil ifTrue:[^ self]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2221 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2222 |
focusView isNil ifTrue:[ |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2223 |
subViews := curView subviewsInFocusOrder. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2224 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2225 |
subViews size ~~ 0 ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2226 |
curView := subViews detectLast:[:v|v shown] ifNone:nil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2227 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2228 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2229 |
^ self focusToView:nil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2230 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2231 |
done := false. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2232 |
|
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2233 |
[done not and:[(subViews := curView subviewsInFocusOrder) size ~~ 0]] whileTrue:[ |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2234 |
nxtView := subViews detectLast:[:v|v shown] ifNone:nil. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2235 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2236 |
nxtView notNil ifTrue:[curView := nxtView] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2237 |
ifFalse:[done := true]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2238 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2239 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2240 |
(curView canTab and:[curView enabled]) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2241 |
^ self focusView:curView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2242 |
]. |
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2243 |
self setFocusView:curView. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2244 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2245 |
nxtView := focusView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2246 |
"/ 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
|
2247 |
|
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2248 |
[(nxtView := nxtView superView) notNil] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2249 |
nxtView shown ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2250 |
curView := nxtView superView |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2251 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2252 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2253 |
curView ~~ focusView ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2254 |
curView isNil ifTrue:[ |
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2255 |
self setFocusView:nil. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2256 |
self focusPrevious. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2257 |
] ifFalse:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2258 |
self focusView:curView byTab:true |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2259 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2260 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2261 |
]. |
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2262 |
self setFocusView:nil. |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2263 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2264 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2265 |
[true] whileTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2266 |
oldView := curView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2267 |
curView := curView superView. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2268 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2269 |
curView isNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2270 |
focusView notNil ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2271 |
^ self |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2272 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2273 |
^ self focusPrevious |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2274 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2275 |
|
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2276 |
curView shown ifTrue:[ |
4733
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2277 |
nxtView := curView focusPreviousChildBefore:oldView. |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2278 |
nxtView notNil ifTrue:[ |
80b915a584ab
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4677
diff
changeset
|
2279 |
^ self focusView:nxtView byTab:true |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2280 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2281 |
]. |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2282 |
]. |
244 | 2283 |
! |
2284 |
||
2219 | 2285 |
focusPreviousFrom:aView |
2286 |
"give focus to the view before aView in the focusSequence" |
|
2287 |
||
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2288 |
self setFocusView:aView. |
2219 | 2289 |
self focusPrevious |
2290 |
||
2291 |
"Created: / 4.8.1998 / 02:43:08 / cg" |
|
2292 |
! |
|
2293 |
||
2506 | 2294 |
focusRequestFrom:aView |
2295 |
"aView requests focus. I will grant it, if I have no explicit |
|
2296 |
focusView (i.e. not tabbed)" |
|
2297 |
||
3651 | 2298 |
|prevFocusView myDisplay| |
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
2299 |
|
2692 | 2300 |
"/ 'focusRequest:' print. aView print. |
2301 |
||
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
2302 |
myDisplay := self graphicsDevice. |
3651 | 2303 |
(myDisplay notNil and:[myDisplay activateOnClick:nil]) ifTrue:[ |
3400 | 2304 |
prevFocusView := myDisplay focusView. |
2305 |
(prevFocusView notNil |
|
8933 | 2306 |
and:[ prevFocusView windowGroup notNil |
2307 |
and:[ prevFocusView windowGroup ~~ aView windowGroup]]) ifTrue:[ |
|
3400 | 2308 |
"/ a view from another windowGroup requests the focus. |
2309 |
"/ 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
|
2310 |
|
2692 | 2311 |
"/ ' not granted' printCR. |
3657 | 2312 |
|
2313 |
"/ check this - must be commented for windows |
|
2314 |
"/ prevFocusView getKeyboardFocus. |
|
3400 | 2315 |
^ false |
2316 |
]. |
|
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
2317 |
]. |
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
2318 |
|
2692 | 2319 |
"/ ' granted' printCR. |
2320 |
||
2506 | 2321 |
(focusView isNil or:[focusByTab not]) ifTrue:[ |
3400 | 2322 |
(aView isNil or:[aView ~~ focusView]) ifTrue:[ |
6141 | 2323 |
self focusView:aView byTab:false. "/ do not change to true - focus followsMouse will no longer work then |
3400 | 2324 |
]. |
2325 |
^ true |
|
2506 | 2326 |
]. |
2327 |
^ false |
|
2686
f074aa7d0748
care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents:
2644
diff
changeset
|
2328 |
|
2692 | 2329 |
"Modified: / 20.5.1999 / 18:30:31 / cg" |
2506 | 2330 |
! |
2331 |
||
90 | 2332 |
focusSequence:aSequenceableCollection |
2333 |
"define the focus sequence for focusNext/focusPrevious. |
|
2334 |
Focus is stepped in the order in which subviews occur in |
|
1946 | 2335 |
the sequence." |
90 | 2336 |
! |
2337 |
||
2353
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2338 |
focusToView:aViewOrNil |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2339 |
"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
|
2340 |
|
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2341 |
focusView == aViewOrNil ifFalse:[ |
4943 | 2342 |
(aViewOrNil isNil |
3156
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2343 |
or:[(aViewOrNil canTab and:[aViewOrNil enabled])] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2344 |
) ifTrue:[ |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2345 |
self focusView:aViewOrNil |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2346 |
] |
38b73e5c08aa
focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents:
3151
diff
changeset
|
2347 |
]. |
2353
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2348 |
! |
e04098201f7c
added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2349 |
|
90 | 2350 |
focusView |
135 | 2351 |
"return the view which currently has the focus" |
90 | 2352 |
|
2353 |
^ focusView |
|
2354 |
! |
|
2355 |
||
2356 |
focusView:aViewOrNil |
|
2357 |
"give focus to aViewOrNil" |
|
2358 |
||
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2359 |
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
|
2360 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2361 |
" |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2362 |
|top v1 v2| |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2363 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2364 |
top := StandardSystemView new. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2365 |
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
|
2366 |
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
|
2367 |
top open. |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2368 |
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
|
2369 |
" |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2370 |
|
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2371 |
"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
|
2372 |
! |
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2373 |
|
5003 | 2374 |
focusView:aViewOrNil byTab:focusCameViaTabOrNil |
2507 | 2375 |
"give focus to aViewOrNil. |
5003 | 2376 |
The focusCameViaTabOrNil argument specifies if the focus came via |
2377 |
tabbing or by pointer-movement/automatic or (if nil) by reassigning the topView focus |
|
2378 |
to the windowGroup which had it before. |
|
2507 | 2379 |
If it came via tabbing, the view is notified differently, to allow |
6141 | 2380 |
for special highlighting (i.e. drawing a focus-border around itself). |
2381 |
Also, if tabbed in, the focusFollowsMouse behavior is disabled (as we assume, |
|
2382 |
that the user has explicitely tabbed into the view to force focus to it)" |
|
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2383 |
|
3652 | 2384 |
|prevFocusView myDisplay| |
6744 | 2385 |
"/(aViewOrNil notNil and:[aViewOrNil shown not]) ifTrue:[ |
2386 |
"/aViewOrNil topView shown ifTrue:[self halt]. |
|
2387 |
"/]. |
|
2506 | 2388 |
|
6125 | 2389 |
"/'focusToView:' print. aViewOrNil print. |
2390 |
"/' (prev: ' print. focusView print. ')' printCR. |
|
2692 | 2391 |
|
2507 | 2392 |
myDisplay := self graphicsDevice. |
2522 | 2393 |
myDisplay notNil ifTrue:[ |
3376 | 2394 |
"/ |
2395 |
"/ take the focus from whichEver view had it previously |
|
2396 |
"/ |
|
2397 |
prevFocusView := myDisplay focusView. |
|
2398 |
prevFocusView ~~ aViewOrNil ifTrue:[ |
|
6125 | 2399 |
"/'take focus from ' print. prevFocusView printCR. |
3376 | 2400 |
self class takeFocusFromDevice:myDisplay. |
2401 |
]. |
|
2506 | 2402 |
]. |
2403 |
||
4677 | 2404 |
myDisplay focusView:aViewOrNil. |
4676 | 2405 |
|
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2406 |
focusView == aViewOrNil ifTrue:[ |
3376 | 2407 |
focusView notNil ifTrue:[ |
2408 |
"/ this is the case when the mouse-pointer reenters |
|
2409 |
"/ into a topView which had a focusView |
|
4973 | 2410 |
"/ cg: disabled 5.jun.08 |
5003 | 2411 |
focusCameViaTabOrNil notNil ifTrue:[ |
2412 |
focusByTab := focusCameViaTabOrNil "or:[focusByTab]". |
|
2413 |
]. |
|
6742 | 2414 |
true ifTrue:[ |
6125 | 2415 |
focusView showFocus:focusByTab. |
6742 | 2416 |
]. |
2417 |
true ifTrue:[ |
|
6745 | 2418 |
"/ 'give focus to ' print. aViewOrNil printCR. |
6125 | 2419 |
self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true. |
2420 |
]. |
|
3376 | 2421 |
]. |
2422 |
^ self |
|
2485
410e810ccbcc
remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents:
2479
diff
changeset
|
2423 |
]. |
410
9d9d03fa5d82
moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2424 |
|
90 | 2425 |
focusView notNil ifTrue:[ |
3376 | 2426 |
"/ lost explicit focus |
2427 |
focusView == aViewOrNil ifTrue:[ |
|
6125 | 2428 |
"/'give focus to ' print. aViewOrNil printCR. |
6742 | 2429 |
aViewOrNil showFocus:(focusCameViaTabOrNil ? true). |
3376 | 2430 |
self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true. |
2431 |
^ self |
|
2432 |
]. |
|
90 | 2433 |
]. |
387
aa80487842b8
compile event classes with optSpace;
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
2434 |
|
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2435 |
self setFocusView:aViewOrNil. |
90 | 2436 |
focusView notNil ifTrue:[ |
3376 | 2437 |
"/ got explicit focus |
5003 | 2438 |
aViewOrNil showFocus:(focusCameViaTabOrNil ? true). |
6125 | 2439 |
"/'give focus to ' print. aViewOrNil printCR. |
3376 | 2440 |
self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true. |
5003 | 2441 |
focusCameViaTabOrNil notNil ifTrue:[ |
2442 |
focusByTab := focusCameViaTabOrNil. |
|
2443 |
] |
|
90 | 2444 |
]. |
2445 |
||
2446 |
" |
|
2447 |
|top v1 v2| |
|
2448 |
||
2449 |
top := StandardSystemView new. |
|
2450 |
v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
2451 |
v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
2452 |
top open. |
|
2453 |
top windowGroup focusView:v1. |
|
2454 |
" |
|
357
3655807445b7
keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents:
330
diff
changeset
|
2455 |
|
5676 | 2456 |
"Modified: / 20-01-2011 / 22:39:57 / cg" |
2479
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
2457 |
! |
2dbe1821533b
care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
2458 |
|
4737 | 2459 |
focusViewUnmapped |
2460 |
"the view which currently had the focus was unmapped" |
|
2461 |
||
2462 |
self focusView:nil |
|
2463 |
! |
|
2464 |
||
2737 | 2465 |
pointerView |
2466 |
"return the view which currently has the pointer" |
|
2467 |
||
2468 |
^ pointerView |
|
3486
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2469 |
! |
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2470 |
|
f93691c57540
cleanup - single access to focusView
Claus Gittinger <cg@exept.de>
parents:
3459
diff
changeset
|
2471 |
setFocusView:aViewOrNil |
6147 | 2472 |
focusView notNil ifTrue:[ |
2473 |
self class sendKeyboardFocusEventTo:focusView withArgument:false |
|
2474 |
]. |
|
6466 | 2475 |
previousFocusView := focusView. |
6147 | 2476 |
focusView := aViewOrNil. |
2477 |
focusView notNil ifTrue:[ |
|
2478 |
self class sendKeyboardFocusEventTo:focusView withArgument:true |
|
2479 |
]. |
|
244 | 2480 |
! ! |
2481 |
||
2482 |
!WindowGroup methodsFor:'initialization'! |
|
2483 |
||
3683 | 2484 |
beSynchronous |
2485 |
mySensor := SynchronousWindowSensor new. |
|
2486 |
! |
|
2487 |
||
244 | 2488 |
initialize |
2489 |
"setup the windowgroup, by creating a new sensor |
|
2490 |
and an event semaphore" |
|
2491 |
||
2492 |
mySensor := WindowSensor new. |
|
8066 | 2493 |
mySensor eventSemaphore:(Semaphore name:'WGroup eventSema'). |
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2494 |
processPriority := Processor userSchedulingPriority. |
244 | 2495 |
isModal := false. |
417 | 2496 |
isForModalSubview := false. |
5520 | 2497 |
doNotCloseOnAbortSignal := false. |
1273 | 2498 |
|
8066 | 2499 |
"Modified: / 09-08-2017 / 12:00:17 / cg" |
90 | 2500 |
! |
2501 |
||
244 | 2502 |
reinitialize |
2503 |
"reinitialize the windowgroup after an image restart" |
|
90 | 2504 |
|
244 | 2505 |
"throw away old (zombie) process" |
2506 |
myProcess notNil ifTrue:[ |
|
3683 | 2507 |
"/ careful: the old processes exit-actions must be cleared. |
2508 |
"/ otherwise, it might do destroy or other actions when it |
|
2509 |
"/ gets finalized ... |
|
1186
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
2510 |
|
e1fbbabcd682
no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
2511 |
"/ myProcess removeAllExitActions. |
3683 | 2512 |
myProcess removeAllSuspendActions. |
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2513 |
processPriority := myProcess priority. "save old priority" |
3683 | 2514 |
myProcess := nil. |
244 | 2515 |
]. |
90 | 2516 |
|
5918 | 2517 |
inWithCursorDoBlock := false. |
2518 |
||
244 | 2519 |
"throw away old events" |
3683 | 2520 |
mySensor notNil ifTrue:[mySensor reinitialize] |
313 | 2521 |
|
2522 |
"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
|
2523 |
"Modified: 12.1.1997 / 00:45:01 / cg" |
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2524 |
! |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2525 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2526 |
setProcessNameWithRedirectIndicator:redirectString |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2527 |
"give the windowGroup process a user friendly name. |
5291 | 2528 |
This name shows up in the ProcessMonitor. |
2529 |
redirectString is nonEmpty, for remote display views" |
|
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2530 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2531 |
|top nm dev devNm defaultDisplay| |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2532 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2533 |
"ask my topView for the processName, and |
7889 | 2534 |
optionally append the displayName (if it's not the default)" |
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2535 |
|
7984 | 2536 |
topViews notEmptyOrNil ifTrue:[ |
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2537 |
top := topViews first. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2538 |
nm := top processName. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2539 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2540 |
dev := top graphicsDevice. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2541 |
defaultDisplay := Screen default. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2542 |
(dev notNil and:[dev ~~ defaultDisplay]) ifTrue:[ |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2543 |
devNm := dev displayName. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2544 |
(devNm notNil and:[defaultDisplay isNil or:[devNm ~= defaultDisplay displayName]]) ifTrue:[ |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2545 |
nm := nm , ' (' , redirectString , devNm , ')' |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2546 |
] |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2547 |
] |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2548 |
] ifFalse:[ |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2549 |
nm := 'window handler'. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2550 |
]. |
7440 | 2551 |
myProcess notNil ifTrue:[ |
2552 |
myProcess name:nm. |
|
2553 |
]. |
|
7889 | 2554 |
|
2555 |
"Modified (format): / 13-02-2017 / 20:34:28 / cg" |
|
7984 | 2556 |
"Modified: / 17-03-2017 / 16:55:19 / stefan" |
90 | 2557 |
! ! |
2558 |
||
3372 | 2559 |
!WindowGroup methodsFor:'keyboard control'! |
2560 |
||
3391 | 2561 |
processMnemonic:aKeyEvent |
3372 | 2562 |
"a mnemonicKey event as forwarded from the keyboardProcessor - if there |
3822 | 2563 |
is the mnemonic-key defined for a subView, true is returned and the view |
2564 |
becomes the focusView. Otherwise return false. |
|
3372 | 2565 |
" |
2566 |
|topView mnemonicView| |
|
2567 |
||
2568 |
focusView notNil ifTrue:[ |
|
2569 |
"/ start from current focusView |
|
2570 |
mnemonicView := focusView mnemonicViewNext:aKeyEvent. |
|
2571 |
||
3391 | 2572 |
(mnemonicView notNil and:[true "mnemonicView canTab" and:[mnemonicView enabled]]) ifTrue:[ |
3372 | 2573 |
self focusView:mnemonicView byTab:false. |
3822 | 2574 |
^ true |
3372 | 2575 |
] |
2576 |
]. |
|
2577 |
||
2578 |
"/ start from any topview |
|
2579 |
topViews notNil ifTrue:[ |
|
2580 |
topView := topViews detect:[:aView| aView shown ] ifNone:nil. |
|
2581 |
||
2582 |
topView notNil ifTrue:[ |
|
2583 |
mnemonicView := topView mnemonicViewNext:aKeyEvent. |
|
2584 |
||
3391 | 2585 |
(mnemonicView notNil and:[true "mnemonicView canTab" and:[mnemonicView enabled]]) ifTrue:[ |
3372 | 2586 |
self focusView:mnemonicView byTab:false. |
3822 | 2587 |
^ true |
3372 | 2588 |
] |
2589 |
] |
|
2590 |
]. |
|
3376 | 2591 |
^ false |
2592 |
! |
|
3372 | 2593 |
|
2594 |
processShortcut:aKeyEvent |
|
3652 | 2595 |
"a shortcut key event as forwarded from the keyboardProcessor - if there is the |
4943 | 2596 |
shortcut key defined, process the shortcut and return true - otherwise false." |
2597 |
||
3652 | 2598 |
|topView| |
3372 | 2599 |
|
2600 |
"/ start from current focusView |
|
2601 |
(focusView notNil and:[focusView processShortcut:aKeyEvent]) ifTrue:[ |
|
2602 |
^ true |
|
2603 |
]. |
|
2604 |
||
2605 |
"/ start from any topview |
|
2606 |
topViews notNil ifTrue:[ |
|
2607 |
topView := topViews detect:[:v| v ~~ focusView and:[v shown]] ifNone:nil. |
|
4943 | 2608 |
^ topView notNil and:[topView processShortcut:aKeyEvent] |
3372 | 2609 |
]. |
3376 | 2610 |
^ false |
2611 |
! ! |
|
3372 | 2612 |
|
3276 | 2613 |
!WindowGroup methodsFor:'printing & storing'! |
19 | 2614 |
|
90 | 2615 |
printOn:aStream |
19 | 2616 |
"return a printed representation; |
144 | 2617 |
just for more user friendlyness: add name of process." |
19 | 2618 |
|
90 | 2619 |
myProcess isNil ifTrue:[ |
3077 | 2620 |
(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[ |
2621 |
aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')'). |
|
2622 |
^ self. |
|
2623 |
]. |
|
2624 |
^ super printOn:aStream |
|
2870 | 2625 |
]. |
2626 |
isModal ifTrue:[ |
|
3077 | 2627 |
aStream nextPutAll:('WindowGroup(modal for ' , myProcess nameOrId , ')'). |
2628 |
^ self. |
|
90 | 2629 |
]. |
2630 |
aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')') |
|
19 | 2631 |
! ! |
244 | 2632 |
|
4962 | 2633 |
!WindowGroup methodsFor:'queries'! |
2634 |
||
2635 |
anyViewHasFocus |
|
5948 | 2636 |
|focusVw| |
2637 |
||
4962 | 2638 |
^ graphicsDevice notNil |
5948 | 2639 |
and:[ (focusVw := graphicsDevice focusView) notNil |
2640 |
and:[ focusVw windowGroup == self ]] |
|
4962 | 2641 |
! |
2642 |
||
2643 |
isPopUp |
|
2644 |
"return true, if the receiver is for a popUp view" |
|
2645 |
||
2646 |
isModal ifFalse:[^ false]. |
|
2647 |
topViews isNil ifTrue:[^ true]. "/ a closed popup ... |
|
2648 |
^ topViews first isPopUpView |
|
2649 |
||
2650 |
"Created: / 9.7.1998 / 01:13:01 / cg" |
|
2651 |
"Modified: / 9.7.1998 / 01:17:11 / cg" |
|
2652 |
! ! |
|
2653 |
||
244 | 2654 |
!WindowGroup methodsFor:'special'! |
2655 |
||
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2656 |
migrateTo:anotherDisplay |
3302 | 2657 |
"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
|
2658 |
|
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2659 |
|myDevice previouslyRealized| |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2660 |
|
3304
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2661 |
self isModal ifTrue:[ |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2662 |
"/ cannot migrate a modal box away from its owner ... |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2663 |
"/ (need a separate process and views may not be owned) |
4348 | 2664 |
Transcript showCR:'Modal windogroup cannot be migrated.'. |
2665 |
"/ self error:'Modal windogroup cannot be migrated.'. |
|
3304
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2666 |
^ self |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2667 |
]. |
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2668 |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2669 |
previouslyRealized := IdentitySet new. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2670 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2671 |
myDevice := self graphicsDevice. |
3308 | 2672 |
DeviceWorkstation flushCachedLastScreen. |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2673 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2674 |
graphicsDevice := nil. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2675 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2676 |
"/ enumerate views - flush their device info ... |
3841
39b293125434
care for 'migrate back' pressed without any topViews left (closed before).
martin
parents:
3822
diff
changeset
|
2677 |
self allTopViewsDo:[:eachTopView | |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2678 |
eachTopView realized ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2679 |
previouslyRealized add:eachTopView |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2680 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2681 |
eachTopView unmap. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2682 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2683 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2684 |
"/ destroy them - but without notifying application/views |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2685 |
self allViewsDo:[:eachView | |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2686 |
eachView releaseDeviceResources. |
3302 | 2687 |
eachView setDevice:anotherDisplay id:nil gcId:nil. |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2688 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2689 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2690 |
"/ recreate them ... |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2691 |
self allViewsDo:[:eachView | |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2692 |
eachView recreate. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2693 |
eachView fetchDeviceResources |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2694 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2695 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2696 |
"/ realize them ... |
3304
6dcc6bb7c3e5
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
3302
diff
changeset
|
2697 |
(topViews ? previouslyRealized) do:[:eachTopView | |
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2698 |
(previouslyRealized includes:eachTopView) ifTrue:[ |
8677 | 2699 |
eachTopView expand. |
2700 |
"/ eachTopView realize |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2701 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2702 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2703 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2704 |
graphicsDevice := anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2705 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2706 |
anotherDisplay sync. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2707 |
myDevice sync. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2708 |
|
4375
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2709 |
|
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2710 |
"change the name of my process" |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2711 |
self setProcessNameWithRedirectIndicator:'->'. |
d16dc7e26e38
On snapshot image restart, restore the priority
Stefan Vogel <sv@exept.de>
parents:
4348
diff
changeset
|
2712 |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2713 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2714 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2715 |
|anotherDisplay v host| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2716 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2717 |
v := StandardSystemView new. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2718 |
v extent:100@100. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2719 |
v addSubView:(Button label:'foo'). |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2720 |
v openAndWait. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2721 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2722 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2723 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2724 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2725 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2726 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2727 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2728 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2729 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2730 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2731 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2732 |
v windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2733 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2734 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2735 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2736 |
|anotherDisplay app host| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2737 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2738 |
app := NewSystemBrowser open. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2739 |
app window waitUntilVisible. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2740 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2741 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2742 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2743 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2744 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2745 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2746 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2747 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2748 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2749 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2750 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2751 |
app windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2752 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2753 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2754 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2755 |
|host anotherDisplay| |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2756 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2757 |
host := Dialog request:'display:' initialAnswer:'dawn:0'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2758 |
host isNil ifTrue:[^ self]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2759 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2760 |
anotherDisplay := XWorkstation newDispatchingFor:host. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2761 |
anotherDisplay isNil ifTrue:[ |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2762 |
self warn:'Could not connect to remote display'. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2763 |
^ self |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2764 |
]. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2765 |
Smalltalk at:#Display2 put:anotherDisplay. |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2766 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2767 |
Transcript topView windowGroup migrateTo:anotherDisplay |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2768 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2769 |
|
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2770 |
" |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2771 |
Transcript topView windowGroup migrateTo:Display |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2772 |
" |
8677 | 2773 |
|
2774 |
"Modified: / 11-05-2019 / 10:57:10 / Claus Gittinger" |
|
3302 | 2775 |
! ! |
2776 |
||
2777 |
!WindowGroup methodsFor:'special-accessing'! |
|
2778 |
||
2779 |
isForModalSubview |
|
7676 | 2780 |
"special for windowgroup with modal subviews. |
3302 | 2781 |
These must be flagged specially to avoid the views being reassigned |
2782 |
to the maingroup. |
|
2783 |
This is a private interface to the SimpleView class" |
|
2784 |
||
2785 |
^ isForModalSubview |
|
7676 | 2786 |
|
2787 |
"Modified (comment): / 13-11-2016 / 17:09:18 / cg" |
|
3293
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2788 |
! |
a5c5d64b36e9
migration - not yet finished
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
2789 |
|
3302 | 2790 |
isForModalSubview:aBoolean |
7676 | 2791 |
"special for windowgroups with modal subviews. |
3302 | 2792 |
These must be flagged specially to avoid the views being reassigned |
2793 |
to the maingroup. |
|
2794 |
This is a private interface to the SimpleView class" |
|
2795 |
||
2796 |
isForModalSubview := aBoolean |
|
7676 | 2797 |
|
2798 |
"Modified (comment): / 13-11-2016 / 17:09:22 / cg" |
|
3302 | 2799 |
! |
2800 |
||
2801 |
setModal:aBoolean |
|
2802 |
"special entry for debugger: set the modal flag. |
|
2803 |
Not for public use" |
|
2804 |
||
2805 |
isModal := aBoolean |
|
2806 |
||
2807 |
"Modified: 3.9.1995 / 14:51:04 / claus" |
|
2808 |
! |
|
2809 |
||
2810 |
setPreviousGroup:aGroup |
|
2811 |
"special entry for debugger: |
|
2812 |
set the windowgroup that started this group (for modal groups only). |
|
2813 |
This is not a public interface." |
|
2814 |
||
6118 | 2815 |
self assert:(aGroup ~~ self). |
3302 | 2816 |
previousGroup := aGroup |
2817 |
||
2818 |
"Modified: 3.9.1995 / 14:55:40 / claus" |
|
2819 |
! |
|
2820 |
||
2821 |
setProcess:aProcess |
|
2822 |
"special entry for debugger: set the windowGroups process. |
|
2823 |
Not for public use." |
|
2824 |
||
2825 |
myProcess := aProcess |
|
2826 |
||
2827 |
"Modified: 3.9.1995 / 14:25:38 / claus" |
|
2828 |
! ! |
|
2829 |
||
2830 |
!WindowGroup methodsFor:'special-user interaction'! |
|
2831 |
||
244 | 2832 |
restoreCursors |
2833 |
"restore the original cursors in all of my views" |
|
2834 |
||
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2835 |
|myDevice| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2836 |
|
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2837 |
myDevice := self graphicsDevice. |
8460 | 2838 |
myDevice isOpen ifFalse:[ |
2839 |
^ self. |
|
2840 |
]. |
|
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2841 |
|
330
13a3fa93330c
careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents:
329
diff
changeset
|
2842 |
self allViewsDo:[:aView | |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2843 |
|c dev id cid| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2844 |
|
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2845 |
dev := aView graphicsDevice. |
8460 | 2846 |
(dev notNil and:[dev isOpen]) ifTrue:[ |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2847 |
(id := aView id) notNil ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2848 |
c := aView cursor. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2849 |
c notNil ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2850 |
c := c onDevice:dev. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2851 |
(c notNil and:[(cid := c id) notNil]) ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2852 |
dev setCursor:cid in:id. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2853 |
dev ~~ myDevice ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2854 |
dev flush |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2855 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2856 |
]. |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2857 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2858 |
] |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2859 |
] |
244 | 2860 |
]. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2861 |
myDevice flush |
743 | 2862 |
|
8460 | 2863 |
"Modified: / 22-04-1998 / 14:28:22 / cg" |
2864 |
"Modified: / 10-09-2018 / 15:40:38 / Stefan Vogel" |
|
244 | 2865 |
! |
2866 |
||
328 | 2867 |
showActivity:someMessage |
597 | 2868 |
"some activityNotification shalt be communicated to |
2869 |
the user; |
|
2870 |
forward it to my first topView if there is one |
|
2871 |
(that one should know how to deal with it)" |
|
2872 |
||
328 | 2873 |
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
|
2874 |
topViews first showActivity:someMessage |
328 | 2875 |
] |
2876 |
||
2877 |
"Created: 16.12.1995 / 18:39:40 / cg" |
|
597 | 2878 |
"Modified: 23.4.1996 / 21:36:54 / cg" |
328 | 2879 |
! |
2880 |
||
244 | 2881 |
showCursor:aCursor |
3280 | 2882 |
"change the cursor to aCursor in all of my views |
2883 |
(This sets the cursor directly, without changing the state of the cursor instance variable; |
|
2884 |
the reason is to allow for #restoreCursors to be able to undo this)." |
|
244 | 2885 |
|
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2886 |
|myDevice c| |
244 | 2887 |
|
3062 | 2888 |
aCursor isNil ifTrue:[^ self]. |
2889 |
||
244 | 2890 |
c := aCursor. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2891 |
myDevice := self graphicsDevice. |
244 | 2892 |
self allViewsDo:[:aView | |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2893 |
|cId vId dev| |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2894 |
|
3280 | 2895 |
dev := aView graphicsDevice. |
4408
308c798612a8
more care for brokenConnections.
Claus Gittinger <cg@exept.de>
parents:
4378
diff
changeset
|
2896 |
(dev notNil and:[dev isOpen]) ifTrue:[ |
3280 | 2897 |
c := c onDevice:dev. |
2898 |
(cId := c id) notNil ifTrue:[ |
|
2899 |
(vId := aView id) notNil ifTrue:[ |
|
2900 |
dev setCursor:cId in:vId. |
|
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2901 |
dev ~~ myDevice ifTrue:[ |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2902 |
dev flush |
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2903 |
] |
3280 | 2904 |
] |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2905 |
]. |
3286
21f022859294
flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents:
3281
diff
changeset
|
2906 |
]. |
244 | 2907 |
]. |
3288
13ae063e593e
only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents:
3286
diff
changeset
|
2908 |
myDevice flush |
244 | 2909 |
! |
2910 |
||
2911 |
withCursor:aCursor do:aBlock |
|
2912 |
"evaluate aBlock while showing aCursor in all |
|
2913 |
my views (used to show wait-cursor while doing something). |
|
2914 |
Return the result as returned by aBlock." |
|
2915 |
||
6832 | 2916 |
|oldCursors dev deviceCursor retVal| |
317
7a1271ecb987
use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
2917 |
|
926
1b8422921e4d
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
777
diff
changeset
|
2918 |
dev := self graphicsDevice. |
7089 | 2919 |
(dev isNil or:[aCursor isNil or:[inWithCursorDoBlock == true]]) ifTrue:[ |
5266
e0a7f249435e
remember when already in a withCursorDo-block,
Claus Gittinger <cg@exept.de>
parents:
5260
diff
changeset
|
2920 |
^ aBlock value |
e0a7f249435e
remember when already in a withCursorDo-block,
Claus Gittinger <cg@exept.de>
parents:
5260
diff
changeset
|
2921 |
]. |
e0a7f249435e
remember when already in a withCursorDo-block,
Claus Gittinger <cg@exept.de>
parents:
5260
diff
changeset
|
2922 |
|
1652 | 2923 |
deviceCursor := aCursor onDevice:dev. |
2924 |
||
244 | 2925 |
" |
2926 |
get mapping of view->cursor for all of my subviews |
|
2927 |
" |
|
2928 |
oldCursors := IdentityDictionary new. |
|
6773 | 2929 |
[ |
2930 |
inWithCursorDoBlock := true. |
|
2931 |
||
2932 |
self allViewsDo:[:eachView | |
|
2933 |
|old| |
|
2934 |
||
2935 |
old := eachView cursor. |
|
2936 |
old ~~ deviceCursor ifTrue:[ |
|
2937 |
oldCursors at:eachView put:old. |
|
2938 |
eachView cursor:deviceCursor now:false |
|
2939 |
] |
|
2940 |
]. |
|
2941 |
||
6832 | 2942 |
retVal := aBlock value. |
6773 | 2943 |
|
6343 | 2944 |
"used to do a sync here to make the cursor visible, |
2945 |
but everything is so fast nowaday, that it doesn't make a difference" |
|
2946 |
dev flush. |
|
6773 | 2947 |
] ensure:[ |
2948 |
" |
|
2949 |
restore cursors from the mapping |
|
2950 |
" |
|
2951 |
oldCursors keysAndValuesDo:[:eachView :eachCursor | |
|
2952 |
eachView cursor:eachCursor now:false. |
|
2953 |
]. |
|
2954 |
dev flush. |
|
2955 |
inWithCursorDoBlock := false. |
|
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2956 |
]. |
6832 | 2957 |
^ retVal |
1387
3fabdef0790d
better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
2958 |
|
2097
d290e7910bec
dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents:
2093
diff
changeset
|
2959 |
"Modified: / 22.4.1998 / 14:36:47 / cg" |
408 | 2960 |
! |
2961 |
||
2213
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2962 |
withExecuteCursorDo:aBlock |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2963 |
"evaluate aBlock while showing a busyCursor in all |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2964 |
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
|
2965 |
Return the result as returned by aBlock." |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2966 |
|
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2967 |
^ self withCursor:(Cursor execute) do:aBlock |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2968 |
|
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2969 |
"Created: / 31.7.1998 / 20:11:52 / cg" |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2970 |
! |
84035dc560e0
added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents:
2172
diff
changeset
|
2971 |
|
5922 | 2972 |
withReadCursorDo:aBlock |
2973 |
"evaluate aBlock while showing a readCursor in all |
|
2974 |
my views (used to show read-cursor while reading a file). |
|
2975 |
Return the result as returned by aBlock." |
|
2976 |
||
2977 |
^ self withCursor:(Cursor read) do:aBlock |
|
2978 |
||
2979 |
"Created: / 27-07-2012 / 09:43:47 / cg" |
|
2980 |
! |
|
2981 |
||
408 | 2982 |
withWaitCursorDo:aBlock |
2983 |
"evaluate aBlock while showing a waitCursor in all |
|
2984 |
my views (used to show wait-cursor while doing something time consuming). |
|
2985 |
Return the result as returned by aBlock." |
|
2986 |
||
2987 |
^ self withCursor:(Cursor wait) do:aBlock |
|
2988 |
||
2989 |
"Created: 6.2.1996 / 19:51:53 / cg" |
|
5922 | 2990 |
! |
2991 |
||
2992 |
withWriteCursorDo:aBlock |
|
2993 |
"evaluate aBlock while showing a writeCursor in all |
|
2994 |
my views (used to show read-cursor while writing a file). |
|
2995 |
Return the result as returned by aBlock." |
|
2996 |
||
2997 |
^ self withCursor:(Cursor write) do:aBlock |
|
2998 |
||
2999 |
"Created: / 27-07-2012 / 09:44:00 / cg" |
|
244 | 3000 |
! ! |
3001 |
||
7619 | 3002 |
!WindowGroup::WindowGroupQuery class methodsFor:'redefined answering'! |
3003 |
||
3004 |
answer:something do:action |
|
7827 | 3005 |
^ [ |
7619 | 3006 |
WindowGroup flushCachedActiveGroup. |
7827 | 3007 |
super answer:something do:action |
7619 | 3008 |
] ensure:[ |
3009 |
WindowGroup flushCachedActiveGroup |
|
3010 |
]. |
|
7827 | 3011 |
|
3012 |
"Modified: / 31-01-2017 / 20:28:14 / stefan" |
|
7619 | 3013 |
! ! |
3014 |
||
1110 | 3015 |
!WindowGroup class methodsFor:'documentation'! |
251 | 3016 |
|
3017 |
version |
|
7089 | 3018 |
^ '$Header$' |
5364
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
3019 |
! |
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
3020 |
|
6f4ceb2bc439
behavior of escape key, while a chain of popup-menus is open
Claus Gittinger <cg@exept.de>
parents:
5350
diff
changeset
|
3021 |
version_CVS |
7089 | 3022 |
^ '$Header$' |
251 | 3023 |
! ! |
3736 | 3024 |
|
6023 | 3025 |
|
244 | 3026 |
WindowGroup initialize! |