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