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