WindowGroup.st
author Claus Gittinger <cg@exept.de>
Fri, 31 Jul 1998 20:13:08 +0200
changeset 2213 84035dc560e0
parent 2172 6dccf11733fd
child 2219 8dcff419009d
permissions -rw-r--r--
added #withExecuteCursorDo: (for completeness)
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:[
2089
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   266
        LastActiveGroup process == LastActiveProcess ifTrue:[
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   267
            ^ LastActiveGroup
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
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:[
2089
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   274
        "/ mhmh - noone willing to answer that question ...
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   275
        "/ (how can this happen ?)
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   276
        groups := self scheduledWindowGroups 
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   277
                    select:[:wg | wg process == activeProcess].
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   278
        groups size == 1 ifTrue:[
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   279
            wg := groups anElement
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   280
        ] ifFalse:[
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   281
            wg := groups detect:[:wg | wg isModal] ifNone:nil.
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   282
            wg isNil ifTrue:[
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   283
                wg := groups anElement
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   284
            ]
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
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:[
2089
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   289
        LastActiveProcess := activeProcess.
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
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
2089
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   298
    "Modified: / 3.9.1995 / 14:49:53 / claus"
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   299
    "Modified: / 17.4.1998 / 11:49:28 / 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:[
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   359
        topViews do:[:v |
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   360
            |app|
1116
c04e4739b42c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1111
diff changeset
   361
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   362
            (app := v application) notNil ifTrue:[
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   363
                "/
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   364
                "/ ok, it has an application;
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   365
                "/ ask it for preferences.
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   366
                "/
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   367
                (dev := app graphicsDevice) notNil ifTrue:[
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   368
                    ^ dev
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   369
                ]
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   370
            ].
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   371
            (dev := v graphicsDevice) notNil ifTrue:[
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   372
                ^ dev
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   373
            ]
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
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:[
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   377
        views do:[:v |
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   378
            (dev := v graphicsDevice) notNil ifTrue:[
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   379
                ^ dev
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   380
            ]
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   381
        ]
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   382
    ].
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   383
    "/ ask the previousGroup; I could be a popUp-views group,
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   384
    "/ which has already closed its views (and is performing its action)
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   385
    previousGroup notNil ifTrue:[
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   386
        ^ previousGroup graphicsDevice
512
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
    ^ nil
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   389
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   390
    "Modified: / 9.7.1998 / 18:18:08 / cg"
512
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
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   393
isModal
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   394
    "return true, if the receiver is in a modal mode
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   395
     (i.e. for a modal box)"
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
    ^ isModal
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   398
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   399
    "Modified: 7.3.1996 / 14:29:46 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   400
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   401
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   402
isPopUp
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   403
    "return true, if the receiver is for a popUp view"
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   404
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   405
    isModal ifFalse:[^ false].
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   406
    topViews isNil ifTrue:[^ true]. "/ a close popup ...
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   407
    ^ topViews first isPopUpView
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   408
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   409
    "Created: / 9.7.1998 / 01:13:01 / cg"
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   410
    "Modified: / 9.7.1998 / 01:17:11 / cg"
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   411
!
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   412
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   413
mainGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   414
    "return the main windowgroup (for modal groups only) 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   415
     that is the top one, which is not modal.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   416
     NonModal groups return themSelf.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   417
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   418
     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
   419
     returns itself as mainGroup (not its debuggee)."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   420
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   421
    |g prev|
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   422
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   423
    g := self.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   424
    [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
   425
	g := prev
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   426
    ].
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   427
    ^ g
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   428
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   429
    "Modified: 3.9.1995 / 14:57:20 / claus"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   430
    "Modified: 7.3.1996 / 14:29:28 / cg"
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
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   433
mainGroup:aWindowGroup
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   434
    "set the main windowgroup (for modal/autonomous groups only) 
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   435
     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
   436
     as well."
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   437
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   438
    previousGroup := aWindowGroup
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   439
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   440
    "Created: 20.8.1997 / 17:57:35 / cg"
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   441
!
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   442
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   443
previousGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   444
    "return the windowgroup that started this group. (for modal groups only).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   445
     This may be another modalGroup (for boxes opened by boxes).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   446
     NonModal groups return nil."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   447
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   448
    ^ previousGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   449
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   450
    "Modified: 7.3.1996 / 14:28:46 / cg"
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
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   453
process 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   454
    "return the windowGroups process"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   455
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   456
    ^ myProcess
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
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   459
sensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   460
    "return the windowGroups sensor.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   461
     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
   462
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   463
    ^ mySensor
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
    "Modified: 7.3.1996 / 14:30:21 / 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
sensor:aSensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   469
    "set the windowGroups sensor"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   470
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   471
    mySensor := aSensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   472
! !
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
!WindowGroup methodsFor:'accessing-hook'!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   475
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   476
postEventHook 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   477
    "return the postEventHook if any"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   478
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   479
    ^ postEventHook
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   480
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   481
    "Created: 7.3.1996 / 14:42:46 / cg"
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
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   484
postEventHook:anObject 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   485
    "set the postEventHook - this one will get all events
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   486
     passed after being processed here (via #processEvent:)."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   487
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   488
    postEventHook := anObject
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
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   491
preEventHook 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   492
    "return the preEventHook if any"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   493
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   494
    ^ preEventHook
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   495
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   496
    "Created: 7.3.1996 / 14:42:42 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   497
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   498
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   499
preEventHook:anObject 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   500
    "set the preEventHook - this one will get all events
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   501
     passed before being processed here (via #processEvent:).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   502
     If this returns true, the event is supposed to be already
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   503
     processed and ignored here.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   504
     Otherwise, it is processed as usual."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   505
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   506
    preEventHook := anObject
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   507
! !
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   508
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   509
!WindowGroup methodsFor:'accessing-views'!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   510
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   511
addTopView:aView
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   512
    "add a topview to the group"
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   513
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   514
    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
   515
	topViews := OrderedCollection new.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   516
    ].
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   517
    (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
   518
	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
   519
    ]
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   520
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   521
    "Modified: 6.3.1996 / 15:35:15 / cg"
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   522
!
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   523
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   524
addView:aView
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   525
    "add aView to the windowGroup"
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   526
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   527
    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
   528
	views := OrderedCollection new.
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   529
    ].
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   530
    (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
   531
	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
   532
    ]
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   533
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   534
    "Modified: 6.3.1996 / 15:35:41 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   535
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   536
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   537
removeView:aView
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   538
    "remove aView from the windowGroup;
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   539
     if this was the last view in this group, 
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   540
     also shut down the corresponding process 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   541
     (actually, only wake it up here - it will terminate itself 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   542
      when finding out that all views are gone)"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   543
263
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   544
    |sema|
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   545
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   546
    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
   547
	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
   548
	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
   549
	    views := nil
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   550
	]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   551
    ].
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   552
    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
   553
	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
   554
	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
   555
	    topViews := nil
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   556
	]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   557
    ].
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   558
    "
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   559
     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
   560
     removed (modalBoxes terminate their modalLoop if so)
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   561
    "
262
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   562
    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
   563
	(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
   564
	    sema signal
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   565
	]
262
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   566
    ]
1304
d914bfc99b49 use #removeIdentical
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
   567
d914bfc99b49 use #removeIdentical
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
   568
    "Modified: 1.2.1997 / 12:13:26 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   569
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   570
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   571
topViews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   572
    "return the topviews accociated to this windowGroup"
172
claus
parents: 162
diff changeset
   573
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   574
    ^ topViews
172
claus
parents: 162
diff changeset
   575
!
claus
parents: 162
diff changeset
   576
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   577
views
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   578
    "return the views accociated to this windowGroup"
172
claus
parents: 162
diff changeset
   579
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   580
    ^ views
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   581
! !
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   582
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   583
!WindowGroup methodsFor:'activation / deactivation'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   584
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   585
closeDownViews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   586
    "destroy all views associated to this window group"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   587
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   588
    topViews notNil ifTrue:[
403
a3ff487fba88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 393
diff changeset
   589
	topViews do:[:aTopView | aTopView notNil ifTrue:[aTopView destroy]]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   590
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   591
    views := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   592
    topViews := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   593
    mySensor := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   594
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   595
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   596
realizeTopViews
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   597
    "realize all topViews associated to this windowGroup."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   598
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   599
    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
   600
	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
   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
	].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   603
    ].
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   604
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   605
    "Created: 24.7.1997 / 12:56:09 / cg"
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   606
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   607
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   608
rerealizeTopViews
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   609
    "rerealize all topViews associated to this windowGroup.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   610
     and tell topViews about it."
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   611
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
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
	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
   614
	    aView isPopUpView
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   615
	    ifFalse:
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
		aView realize.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   618
		aView restarted
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   619
	    ].
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   620
	].
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   621
    ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   622
!
180
claus
parents: 172
diff changeset
   623
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   624
restart
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   625
    "restart after a snapin.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   626
     This reopens all views in this group."
180
claus
parents: 172
diff changeset
   627
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   628
    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
   629
	"
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   630
	 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
   631
	 (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
   632
	"
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   633
	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
   634
	isModal ifFalse:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   635
	    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
   636
	]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   637
    ]
1273
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   638
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   639
    "Modified: 24.7.1997 / 13:00:12 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   640
!
180
claus
parents: 172
diff changeset
   641
582
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   642
shutDown
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   643
    "shutdown the window group; close all views and
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   644
     terminate the process"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   645
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   646
    |p|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   647
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   648
    self closeDownViews.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   649
    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
   650
	p := myProcess.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   651
	myProcess := nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   652
	p terminate.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   653
    ]
582
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   654
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   655
    "Created: 22.4.1996 / 17:58:37 / cg"
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   656
    "Modified: 8.2.1997 / 16:46:31 / cg"
180
claus
parents: 172
diff changeset
   657
!
claus
parents: 172
diff changeset
   658
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   659
startupModal:checkBlock
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   660
    "startup the window-group in a modal loop 
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   661
     (i.e. under the currently running process);
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   662
     checkBlock is evaluated and the modal loop is left, 
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   663
     whenever false is returned."
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   664
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   665
    ^ self startupModal:checkBlock forGroup:(WindowGroup activeGroup).
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   666
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   667
    "Created: 10.12.1995 / 14:15:11 / cg"
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   668
    "Modified: 20.8.1997 / 17:54:33 / cg"
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   669
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   670
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   671
startupModal:checkBlock forGroup:mainGroup
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   672
    "startup the window-group in a modal loop 
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   673
     (i.e. under the currently running process);
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   674
     checkBlock is evaluated and loop is left, when false is
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   675
     returned.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   676
     The mainGroup info is required to allow peeking into its
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   677
     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
   678
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   679
    "set previousGroup to the main (non-modal) group"
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   680
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   681
    previousGroup := mainGroup.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   682
    isModal := true.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   683
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   684
    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
   685
	ex proceedWith:self
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   686
    ] do:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   687
	self realizeTopViews.
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   688
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   689
	self 
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   690
	    eventLoopWhile:checkBlock 
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   691
	    onLeave:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   692
		"
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   693
		 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
   694
		"
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   695
		previousGroup := nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   696
		topViews := nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   697
		views := nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   698
		"
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   699
		 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
   700
		 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
   701
		"
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   702
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   703
"/                topViews notNil ifTrue:[
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   704
"/                    topViews do:[:aView |
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   705
"/                        aView destroy
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   706
"/                    ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   707
"/                    topViews := nil.
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   708
"/                ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   709
"/                views notNil ifTrue:[
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   710
"/                    views do:[:aView |
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   711
"/                        aView destroy
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   712
"/                    ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   713
"/                    views := nil.
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   714
"/                ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   715
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   716
	    ]
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   717
	]
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   718
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   719
    "Created: 10.12.1995 / 14:14:26 / cg"
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   720
    "Modified: 20.8.1997 / 18:12:20 / cg"
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   721
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   722
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   723
startupWith:startupAction
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   724
    "startup the window-group;
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   725
     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
   726
     The startupAction arg is evaluated by the windowGroup process,
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   727
     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
   728
     [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
   729
      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
   730
      blocking operations ...]"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   731
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   732
    |top nm dev devNm|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   733
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   734
    previousGroup := nil.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   735
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   736
    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
   737
	isModal := false.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   738
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   739
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   740
	"/ 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
   741
	"/ 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
   742
	"/ (well, not really forever ... ;-)
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   743
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   744
	myProcess := [
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   745
	    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
   746
		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
   747
	    ] do:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   748
		[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   749
		    startupAction value.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   750
		    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
   751
		] valueNowOrOnUnwindDo:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   752
		    self closeDownViews
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   753
		]
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
	] forkAt:(Processor userSchedulingPriority).
180
claus
parents: 172
diff changeset
   756
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   757
	(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
   758
	    "/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   759
	    "/ 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
   760
	    "/ 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
   761
	    "/ 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
   762
	    "/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   763
	    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
   764
	    nm := top processName.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   765
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   766
	    (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
   767
		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
   768
		(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
   769
		    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
   770
		]
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   771
	    ]
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   772
	] ifFalse:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   773
	    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
   774
	].
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   775
	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
   776
	myProcess beGroupLeader.
180
claus
parents: 172
diff changeset
   777
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   778
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   779
	"/ 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
   780
	"/ 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
   781
	"/ 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
   782
	"/ (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
   783
	"/  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
   784
	"/  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
   785
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   786
	myProcess addSuspendAction:[ 
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   787
	    |dev|
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   788
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   789
	    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
   790
	    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
   791
	].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   792
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   793
1965
765f9e696b42 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
   794
    "Modified: / 13.12.1995 / 14:04:53 / stefan"
765f9e696b42 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
   795
    "Created: / 24.7.1997 / 12:52:04 / cg"
765f9e696b42 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
   796
    "Modified: / 4.12.1997 / 14:13:35 / cg"
180
claus
parents: 172
diff changeset
   797
! !
claus
parents: 172
diff changeset
   798
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   799
!WindowGroup methodsFor:'enumerating'!
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   800
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   801
allNonTopViewsDo:aBlock
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   802
    "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
   803
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   804
     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
   805
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   806
    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
   807
	views copy nonNilElementsDo:aBlock
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   808
    ]
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   809
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   810
    "Modified: 12.2.1997 / 12:20:25 / cg"
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   811
!
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   812
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   813
allTopViewsDo:aBlock
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   814
    "evaluate aBlock for all topviews in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   815
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   816
     destroy and other collection changing operations to be performed in the loop."
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   817
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   818
    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
   819
	topViews copy nonNilElementsDo:aBlock
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   820
    ]
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   821
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   822
    "Modified: 12.2.1997 / 12:20:30 / cg"
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   823
!
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   824
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   825
allTopViewsExcept:aView do:aBlock
157
claus
parents: 152
diff changeset
   826
    "evaluate aBlock for all topviews except aView in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   827
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   828
     destroy and other collection changing operations to be performed in the loop."
157
claus
parents: 152
diff changeset
   829
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   830
    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
   831
	v ~~ aView ifTrue:[aBlock value:v]
157
claus
parents: 152
diff changeset
   832
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   833
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   834
    "Modified: 12.2.1997 / 12:22:10 / cg"
157
claus
parents: 152
diff changeset
   835
!
claus
parents: 152
diff changeset
   836
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   837
allViewsDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   838
    "evaluate aBlock for all views & topviews in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   839
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   840
     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
   841
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   842
    self allTopViewsDo:aBlock.
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   843
    self allNonTopViewsDo:aBlock.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   844
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   845
    "Modified: 12.2.1997 / 12:20:20 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   846
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   847
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   848
partnersDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   849
    "evaluate aBlock for all partnerViews.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   850
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   851
     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
   852
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   853
    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
   854
	(v type == #partner) ifTrue:[aBlock value:v].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   855
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   856
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   857
    "Modified: 12.2.1997 / 12:21:41 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   858
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   859
157
claus
parents: 152
diff changeset
   860
slavesDo:aBlock
claus
parents: 152
diff changeset
   861
    "evaluate aBlock for all slaveViews.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   862
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   863
     destroy and other collection changing operations to be performed in the loop."
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   864
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   865
    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
   866
	(v type == #slave) ifTrue:[aBlock value:v].
157
claus
parents: 152
diff changeset
   867
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   868
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   869
    "Modified: 12.2.1997 / 12:21:46 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   870
! !
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   871
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   872
!WindowGroup methodsFor:'event debugging'!
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   873
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   874
traceEvents:trueOrFalse
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   875
    |hook|
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   876
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   877
    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
   878
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   879
	"/ 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
   880
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   881
	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
   882
	"/ Transcript showCR:'removed eventHook'.
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   883
    ] ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   884
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   885
	"/ 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
   886
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   887
	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
   888
	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
   889
		  with:[:ev | ev displayString printCR. false].
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   890
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   891
	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
   892
	"/ Transcript showCR:'set eventHook for tracing'.
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   893
    ]
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   894
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   895
    "Created: 24.4.1996 / 10:25:21 / cg"
698
3be775ccac3c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 697
diff changeset
   896
    "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
   897
! !
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
   898
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
   899
!WindowGroup methodsFor:'event handling'!
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   900
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   901
eventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   902
    "loop executed by windowGroup process;
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   903
     wait-for and process events forever"
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
   self eventLoopWhile:[true] onLeave:[]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   906
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   907
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   908
eventLoopWhile:aBlock onLeave:cleanupActions
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   909
    "wait-for and process events.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   910
     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
   911
     and aBlock evaluates to true.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   912
1752
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   913
     Some signals are caught & handled: 
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   914
        LeaveSignal forces an exit from the eventLoop;
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   915
        AbortSignal brings us back into the loop, processing the next event;
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   916
        ActivityNotifications send a #showActivity: if nonModal, 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   917
        otherwise they are ignored."
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   918
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   919
    |thisProcess sigs mainSema prevSema|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   920
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   921
    thisProcess := Processor activeProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   922
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   923
    sigs := SignalSet 
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   924
                with:AbortSignal 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   925
                with:LeaveSignal 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   926
                with:(self class activityNotificationSignal).
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   927
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   928
    [
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   929
        |p g s mainGroup mySema waitSema groupForSema|
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   930
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   931
        waitSema := mySema := mySensor eventSemaphore.
325
b24d9a1c74dc stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   932
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   933
        isModal ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   934
            mainGroup := self mainGroup.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   935
            mainGroup == self ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   936
                mainGroup := nil
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   937
            ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   938
        ] ifFalse:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   939
            mainGroup := previousGroup
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   940
        ].
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   941
        
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   942
        mainGroup notNil ifTrue:[
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   943
            mainSema := mainGroup sensor eventSemaphore.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   944
            waitSema := SemaphoreSet with:mySema with:mainSema.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   945
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   946
            "/ must also care for all other groups in between
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   947
            "/ (in case its a modal dialog opened from a modal dialog)
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   948
        
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   949
            g := previousGroup.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   950
            g ~~ mainGroup ifTrue:[
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   951
                groupForSema := IdentityDictionary new.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   952
                [g ~~ mainGroup] whileTrue:[
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   953
                    s := g sensor eventSemaphore.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   954
                    waitSema add:s.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   955
                    groupForSema at:s put:g.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   956
                    g := g previousGroup.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   957
                ]
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   958
            ].
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   959
        ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   960
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   961
        [aBlock value] whileTrue:[ 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   962
            LastActiveGroup := self.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   963
            LastActiveProcess := thisProcess.
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
   964
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   965
            (views isNil and:[topViews isNil]) ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   966
                myProcess notNil ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   967
                    p := myProcess.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   968
                    myProcess := nil.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   969
                    p terminate.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   970
                    "not reached - there is no life after death"
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   971
                ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   972
                "
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   973
                 this is the end of a modal loop
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   974
                 (not having a private process ...)
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   975
                "
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   976
                ^ self
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   977
            ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   978
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   979
            sigs handle:[:ex |
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   980
                |theSig|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   981
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   982
                (theSig := ex signal) == AbortSignal ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   983
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   984
                    "/ on abort, stay in loop
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   985
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   986
                    ex return
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   987
                ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   988
                theSig == LeaveSignal ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   989
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   990
                    "/ on leave, exit the event loop
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   991
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   992
                    ^ self
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   993
                ].
323
619085d52522 be careful - device may be nil
Claus Gittinger <cg@exept.de>
parents: 319
diff changeset
   994
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   995
                "/ ActivityNotification
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   996
                "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   997
                "/ if I am a modal-group, let it be handled
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   998
                "/ by the outer main-groups handler
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
   999
                "/ otherwise show the activityMessage and continue.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1000
                "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1001
                isModal ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1002
                    ex reject
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1003
                    "never reached"
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1004
                ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1005
                self showActivity:(ex errorString).
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1006
                ex proceed.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1007
            ] do:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1008
                |dev gotSema mainView|
429
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1009
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1010
                "/ Flush device output before going to sleep. 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1011
                "/ This may produce more events to arrive.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1012
                "/ Q: is this still needed (see suspendAction) ?
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1013
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1014
"/                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
  1015
"/                dev notNil ifTrue:[dev flush].
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1016
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1017
                "/ now, wait for an event to arrive
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1018
                thisProcess setStateTo:#eventWait if:#active.
2116
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1019
                waitSema isNil ifTrue:[
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1020
                    "/ oops - how can this happen ....
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1021
                    ^ self.
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1022
                ].
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1023
                gotSema := waitSema wait.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1024
                LastActiveGroup := self.
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1025
                LastActiveProcess := thisProcess.
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1026
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1027
                gotSema == mySema ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1028
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1029
                    "/ an event for me 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1030
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1031
                    self processEventsWithModalGroup:nil
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1032
                ] ifFalse:[
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1033
                    groupForSema notNil ifTrue:[
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1034
                        g := groupForSema at:gotSema ifAbsent:nil.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1035
                        g := g ? mainGroup.
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1036
                    ] ifFalse:[
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1037
                        g := mainGroup
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1038
                    ].
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1039
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1040
                    "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1041
                    "/ an event for my mainGroup 
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1042
                    "/
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1043
                    g topViews notNil ifTrue:[
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1044
                        mainView := g topViews first
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1045
                    ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1046
                    mainView notNil ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1047
                        "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1048
                        "/ if anything happened to the mainGroup
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1049
                        "/ bring my own topView back to the front
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1050
                        "/ This keeps modalBoxes visible
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1051
                        "/
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1052
                        (g sensor hasConfigureEventFor:mainView) ifTrue:[
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1053
                            topViews size > 0 ifTrue:[
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1054
                                topViews first raiseDeiconified
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1055
                            ]
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1056
                        ]
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1057
                    ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1058
                    "
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1059
                     if modal, also check for redraw events in my maingroup
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1060
                     (we arrive here after we woke up on maingroup sensor eventSemaphore)
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1061
                    "
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1062
                    g processEventsWithModalGroup:self.
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1063
                ]
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1064
            ].
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1065
        ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1066
    ] valueNowOrOnUnwindDo:[
2046
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1067
        "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1068
        "/ perform any cleanupActions
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1069
        "/
abd56d83bac5 use activityNotificationSignal (easier to find)
ca
parents: 1987
diff changeset
  1070
        cleanupActions notNil ifTrue:[cleanupActions value]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1071
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1072
2116
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1073
    "Modified: / 14.12.1995 / 11:12:24 / stefan"
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1074
    "Modified: / 9.7.1998 / 00:58:39 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1075
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1076
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1077
leaveEventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1078
    "immediately leave the event loop, returning way back.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1079
     This can be used to leave (and closedown) a modal group.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1080
     (for normal views, this does not make sense)"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1081
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1082
    ^ LeaveSignal raise
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1083
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1084
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1085
processEvents
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1086
    "process events from either the damage- or user input queues.
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1087
     Abort is assumed to be handled elsewhere."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1088
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1089
    self processEventsWithModalGroup:nil
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1090
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1091
    "Modified: 5.3.1997 / 11:33:51 / cg"
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1092
!
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1093
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1094
processEventsWithModalGroup:modalGroup
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1095
    "process events from either the damage- or user input queues.
1868
484e0fca2cf6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1096
     Abort is assumed to be handled elsewhere."
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1097
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1098
    <resource: #keyboard (#Escape )>
496
71ecf6bfdff2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
  1099
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1100
    |event ignore key focus firstTop evView evType evArgs
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1101
     modalTops modalTop modalDelegate syntheticEvent|
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1102
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
  1103
    self processExposeEvents.
180
claus
parents: 172
diff changeset
  1104
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1105
    [(event := mySensor nextEvent) notNil] whileTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1106
        ignore := false.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1107
        focus := focusView.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1108
        modalDelegate := false.
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1109
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1110
        modalGroup notNil ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1111
            "/ an incoming event for a masterView, 
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1112
            "/ while being blocked by some other modalView.
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1113
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1114
            modalTops := modalGroup topViews.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1115
            modalTops size > 0 ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1116
                modalTop := modalTops first.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1117
            ].
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1118
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1119
            event isKeyEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1120
                "/ forward keyboard events to my modal
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1121
                "/ groups first topView ...
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1122
                modalTop notNil ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1123
                    focus := modalTop.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1124
                    modalDelegate := true.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1125
                ]
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1126
            ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1127
                event isFocusEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1128
                    event isFocusInEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1129
                        "/ focusIn is forwarded to the modalGroup
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1130
                        "/ (since keyboard is forwarded)
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1131
                        event view:modalTop.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1132
                        focus := modalTop.
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1133
                    ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1134
                        "/ focusOut goes to both the modal and
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1135
                        "/ the blocked main-group
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1136
                        "/ (actually, only the very first focusOut
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1137
                        "/  is needed in the mainGroup (to turn off the cursor)
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1138
                        "/  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
  1139
"/                            syntheticEvent := event copy.
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1140
"/                            syntheticEvent view:modalTop.
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1141
"/                            LastEventQuerySignal handle:[:ex |
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1142
"/                                ex proceedWith:syntheticEvent
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1143
"/                            ] do:[
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1144
"/                                syntheticEvent sendEventWithFocusOn:nil.
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1145
"/                            ].
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1146
                        event view:modalTop.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1147
                    ].
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1148
                    modalDelegate := true.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1149
                ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1150
                    event isPointerLeaveEvent ifTrue:[
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1151
                    ] ifFalse:[
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1152
                        event isUserEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1153
                            ignore := true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1154
                        ]
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1155
                    ]
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1156
                ]
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1157
            ]
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1158
        ].
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1159
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1160
        ignore ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1161
            (views notNil or:[topViews notNil]) ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1162
                LastEventQuerySignal handle:[:ex |
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1163
                    ex proceedWith:event
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1164
                ] do:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1165
                    (preEventHook  notNil 
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1166
                    and:[preEventHook processEvent:event]) ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1167
                        ignore := true.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1168
                    ].
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1169
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1170
                    ignore ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1171
                        evView := event view.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1172
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1173
                        event isKeyPressEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1174
                            key := event key.
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
  1175
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1176
                            key == #Escape ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1177
                                modalDelegate ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1178
                                    modalTop hideRequest
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1179
                                ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1180
                                    isModal ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1181
                                        topViews first hideRequest
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1182
                                    ]
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1183
                                ]
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1184
                            ]
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1185
                        ] ifFalse:[
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1186
                            "/
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1187
                            "/ keep track of which view has the pointer
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1188
                            "/
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1189
                            event isPointerEnterEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1190
                                pointerView := evView
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1191
                            ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1192
                                event isPointerLeaveEvent ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1193
                                    pointerView := nil
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1194
                                ]
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1195
                            ]
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1196
                        ].
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1197
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1198
                        "/
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1199
                        "/  buttonPress events turn off explicit focus, and revert
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1200
                        "/  to implicit focus control
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1201
                        "/
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1202
                        (focusView notNil
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1203
                        and:[event isButtonPressEvent]) ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1204
                            self focusView:nil
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1205
                        ].
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1206
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1207
                        LastActiveGroup := self.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1208
                        LastActiveProcess := Processor activeProcess.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1209
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1210
                        "
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1211
                         if there is no view information in the event,
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1212
                         it must have been sent directly to the sensor.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1213
                         Send it to the first topView.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1214
                        "
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1215
                        evType := event type.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1216
                        evArgs := event arguments.
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1217
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1218
                        evView isNil ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1219
                            (firstTop := topViews first) notNil ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1220
                                firstTop perform:evType withArguments:evArgs
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1221
                            ]
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1222
                        ] ifFalse:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1223
                            evView
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1224
                                dispatchEvent:evType 
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1225
                                arguments:evArgs 
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1226
                                withFocusOn:focus 
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1227
                                delegate:true
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1228
                        ]
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1229
                    ].
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1230
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1231
                    postEventHook notNil ifTrue:[
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1232
                        postEventHook processEvent:event
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1233
                    ].
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1234
                ]
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1235
            ]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1236
        ].
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
  1237
    ]
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  1238
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1239
    "Created: / 5.3.1997 / 11:33:11 / cg"
2172
6dccf11733fd avoid a send in #processEventsWithModalGroup:
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  1240
    "Modified: / 14.7.1998 / 20:59:40 / cg"
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1241
!
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1242
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1243
processExposeEvents
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1244
    "process only expose events from the damage queue"
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1245
180
claus
parents: 172
diff changeset
  1246
    |event view rect x y w h sensor thisProcess|
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
  1247
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
  1248
    (sensor := mySensor) isNil ifTrue:[^ self].
2154
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1249
    (sensor damageCount ~~ 0) ifTrue:[
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1250
        thisProcess := Processor activeProcess.
180
claus
parents: 172
diff changeset
  1251
2154
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1252
        [(event := sensor nextDamage) notNil] whileTrue:[
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1253
            LastActiveGroup := self.
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1254
            LastActiveProcess := thisProcess.
180
claus
parents: 172
diff changeset
  1255
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1256
            (views notNil or:[topViews notNil]) ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1257
                LastEventQuerySignal handle:[:ex |
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1258
                    ex proceedWith:event
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1259
                ] do:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1260
                    (preEventHook notNil 
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1261
                    and:[preEventHook processEvent:event]) ifFalse:[
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1262
                        view := event view.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1263
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1264
                        event isDamage ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1265
                            "/
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1266
                            "/ if the view is no longer shown (iconified or closed),
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1267
                            "/ this is a leftover event and ignored.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1268
                            "/
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1269
                            view shown ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1270
                                LastActiveGroup := self.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1271
                                LastActiveProcess := thisProcess.
1868
484e0fca2cf6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1272
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1273
                                view
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1274
                                    dispatchEvent:(event type) 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1275
                                    arguments:(event arguments) 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1276
                                    withFocusOn:nil 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1277
                                    delegate:true
1868
484e0fca2cf6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1278
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1279
"/                            ] ifFalse:[
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1822
diff changeset
  1280
"/                                ('WGROUP: damage for ' , view displayString , ' ignored') infoPrintCR.
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1281
                            ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1282
                        ] ifFalse:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1283
                            "
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1284
                             mhmh - could we possibly arrive here ?
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1285
                            "
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1286
                            LastActiveGroup := self.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1287
                            LastActiveProcess := thisProcess.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1288
                            "/ event sendEventWithFocusOn:nil.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1289
                            view
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1290
                                dispatchEvent:(event type) 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1291
                                arguments:(event arguments) 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1292
                                withFocusOn:nil 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1293
                                delegate:true
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1294
                        ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1295
                    ].
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1296
                    postEventHook notNil ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1297
                        postEventHook processEvent:event
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1298
                    ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1299
                ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1300
            ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1301
        ]
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1302
    ]
1157
ffcb958058ad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1153
diff changeset
  1303
2154
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1304
    "Modified: / 17.6.1998 / 09:09:48 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1305
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1306
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1307
processRealExposeEvents
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1308
    "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
  1309
     (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
  1310
     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
  1311
     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
  1312
2093
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1313
    self processRealExposeEventsFor:nil
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1314
!
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1315
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1316
processRealExposeEventsFor:someViewOrNil
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1317
    "process only expose events from the damage queue
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1318
     (for any of my views if the arg is nil).
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1319
     This is required after a scroll operation,
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1320
     to wait for either a noExpose or a real expose."
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1321
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1322
    |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
  1323
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1324
    (sensor := mySensor) isNil ifTrue:[^ self].
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1325
    sensor damageCount == 0 ifTrue:[^ self].
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1326
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1327
    thisProcess := Processor activeProcess.
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1328
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1329
    [true] whileTrue:[
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1330
        LastActiveGroup := self.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1331
        LastActiveProcess := thisProcess.
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1332
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1333
        "/ event := aView nextDamage.
2093
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1334
        event := sensor nextExposeEventFor:someViewOrNil.
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1335
        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
  1336
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1337
        (views notNil or:[topViews notNil]) ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1338
            LastEventQuerySignal handle:[:ex |
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1339
                ex proceedWith:event
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1340
            ] do:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1341
                (preEventHook notNil 
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1342
                and:[preEventHook processEvent:event]) ifFalse:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1343
                    view := event view.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1344
                    "/
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1345
                    "/ if the view is no longer shown (iconified or closed),
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1346
                    "/ this is a leftover event and ignored.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1347
                    "/
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1348
                    view shown ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1349
                        rect := event rectangle.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1350
                        x := rect left.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1351
                        y := rect top.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1352
                        w := rect width.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1353
                        h := rect height.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1354
                        LastActiveGroup := self.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1355
                        LastActiveProcess := thisProcess.
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1356
                        view transformation notNil ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1357
                            view deviceExposeX:x y:y width:w height:h
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1358
                        ] ifFalse:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1359
                            view exposeX:x y:y width:w height:h
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1360
                        ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1361
                    ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1362
                ].
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1363
                postEventHook notNil ifTrue:[
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1364
                    postEventHook processEvent:event
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1365
                ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1366
            ]
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1367
        ]
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1368
    ]
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1369
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1370
    "Created: / 2.7.1997 / 14:32:19 / cg"
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1371
    "Modified: / 5.4.1998 / 11:35:43 / cg"
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1372
!
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1373
28
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1374
waitForExposeFor:aView
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1375
    "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
  1376
     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
  1377
     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
  1378
     (i.e. a synthetic noExpose may be generated there)."
28
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1379
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1380
    mySensor waitForExposeFor:aView.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1381
    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
  1382
	self processRealExposeEventsFor:aView
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1383
    ]
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1384
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1822
diff changeset
  1385
    "Modified: 6.8.1997 / 19:50:24 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1386
! !
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1387
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1388
!WindowGroup methodsFor:'focus control'!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1389
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1390
focusNext
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1391
    "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
  1392
     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
  1393
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1394
    |index "{ Class: SmallInteger }"
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1395
     lastIndex "{ Class: SmallInteger }"
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1396
     index0 next sequence|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1397
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1398
    sequence := self focusSequence.
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1399
    (lastIndex := sequence size) == 0 ifTrue:[^ self].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1400
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1401
    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
  1402
	index := index0 := (sequence identityIndexOf:focusView).
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1403
    ] ifFalse:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1404
	index := 0.
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1405
    ].
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1406
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1407
    [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
  1408
	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
  1409
	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
  1410
	    index := 1.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1411
	    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
  1412
	].
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1413
	index == index0 ifTrue:[^ self].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1414
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1415
	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
  1416
	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
  1417
	    next := nil
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1418
	] ifFalse:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1419
	    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
  1420
		next := nil
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
	]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1423
    ].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1424
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1425
    self focusView:next
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1426
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1427
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1428
     |top v1 v2|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1429
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1430
     top := StandardSystemView new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1431
     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
  1432
     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
  1433
     top open.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1434
     top windowGroup focusSequence:(Array with:v1 with:v2).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1435
     top windowGroup focusOn:v1.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1436
     (Delay forSeconds:10) wait.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1437
     top windowGroup focusNext.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1438
    "
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1439
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1440
    "Modified: / 31.10.1997 / 19:22:34 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1441
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1442
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1443
focusPrevious
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1444
    "give focus to previous view in focusSequence"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1445
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1446
    |index     "{ Class: SmallInteger }"
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1447
     lastIndex "{ Class: SmallInteger }"
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1448
     prev index0 sequence|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1449
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1450
    sequence := self focusSequence.
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1451
    (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
  1452
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1453
    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
  1454
	index := index0 := (sequence identityIndexOf:focusView).
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1455
    ] ifFalse:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1456
	index := lastIndex + 1.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1457
    ].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1458
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1459
    [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
  1460
	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
  1461
	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
  1462
	    index := lastIndex.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1463
	    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
  1464
	].
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1465
	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
  1466
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1467
	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
  1468
	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
  1469
	    prev := nil
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1470
	] ifFalse:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1471
	    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
  1472
		prev := nil
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
	].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1475
    ].
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1476
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1477
    self focusView:prev
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1478
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1479
    "Modified: / 31.10.1997 / 19:21:50 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1480
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1481
135
claus
parents: 121
diff changeset
  1482
focusSequence
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1483
    "return my focus sequence for focusNext/focusPrevious.
135
claus
parents: 121
diff changeset
  1484
     Focus is stepped in the order in which subviews occur in
claus
parents: 121
diff changeset
  1485
     the sequence"
claus
parents: 121
diff changeset
  1486
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1487
    |sequence|
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1488
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1489
    "/ 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
  1490
    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
  1491
507
5098d8e9be3c oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1492
    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
  1493
	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
  1494
	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
  1495
    ].
5098d8e9be3c oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1496
5098d8e9be3c oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1497
    ^ nil
5098d8e9be3c oops - when asking for focusSequence, take first nonNil collection from any topView
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1498
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1499
    "Modified: / 31.10.1997 / 20:37:54 / cg"
135
claus
parents: 121
diff changeset
  1500
!
claus
parents: 121
diff changeset
  1501
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1502
focusSequence:aSequenceableCollection
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1503
    "define the focus sequence for focusNext/focusPrevious.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1504
     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
  1505
     the sequence."
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1506
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1507
    focusSequence := aSequenceableCollection
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1508
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  1509
    "Modified: / 31.10.1997 / 20:40:04 / cg"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1510
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1511
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1512
focusView
135
claus
parents: 121
diff changeset
  1513
    "return the view which currently has the focus"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1514
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1515
    ^ focusView
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1516
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1517
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1518
focusView:aViewOrNil
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1519
    "give focus to aViewOrNil"
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1520
410
9d9d03fa5d82 moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents: 408
diff changeset
  1521
    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
  1522
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1523
    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
  1524
	"/ 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
  1525
	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
  1526
	focusView showNoFocus:true.
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  1527
    ] ifFalse:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1528
	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
  1529
	    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
  1530
		"/ 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
  1531
		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
  1532
	    ]
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1533
	].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1534
    ].
387
aa80487842b8 compile event classes with optSpace;
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1535
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1536
    focusView := aViewOrNil.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1537
    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
  1538
	"/ 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
  1539
	focusView showFocus:true.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1540
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1541
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1542
    "
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1543
     |top v1 v2|
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1544
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1545
     top := StandardSystemView new.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1546
     v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1547
     v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1548
     top open.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1549
     top windowGroup focusView:v1.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1550
    "
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  1551
777
4d0b66f65346 search in focusSequence for identical view - who knows
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
  1552
    "Modified: 31.5.1996 / 21:13:25 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1553
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1554
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1555
!WindowGroup methodsFor:'initialization'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1556
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1557
initialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1558
    "setup the windowgroup, by creating a new sensor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1559
     and an event semaphore"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1560
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1561
    mySensor := WindowSensor new.
1273
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  1562
    mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema').
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1563
    isModal := false.
417
940ebb195fc6 added isModalForSubView flag
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1564
    isForModalSubview := false.
1273
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  1565
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  1566
    "Modified: 25.1.1997 / 00:20:19 / cg"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1567
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1568
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1569
reinitialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1570
    "reinitialize the windowgroup after an image restart"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1571
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1572
    "throw away old (zombie) process"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1573
    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
  1574
	"/ 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
  1575
	"/ 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
  1576
	"/ gets finalized ...
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1577
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1578
"/        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
  1579
	myProcess removeAllSuspendActions.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1580
	myProcess := nil.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1581
    ].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1582
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1583
    "throw away old events"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1584
    mySensor reinitialize
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1585
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1586
    "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
  1587
    "Modified: 12.1.1997 / 00:45:01 / cg"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1588
! !
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1589
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1590
!WindowGroup methodsFor:'printing'!
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1591
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1592
printOn:aStream
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1593
    "return a printed representation;
144
claus
parents: 141
diff changeset
  1594
     just for more user friendlyness: add name of process."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1595
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1596
    myProcess isNil ifTrue:[
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1597
	(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1598
	    aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')').
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1599
	    ^ self.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1600
	].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1601
	^ super printOn:aStream
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1602
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1603
    aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')')
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1604
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1605
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1606
!WindowGroup methodsFor:'special'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1607
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1608
restoreCursors
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1609
    "restore the original cursors in all of my views"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1610
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1611
    self allViewsDo:[:aView |  
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1612
        |c dev id cid|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1613
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1614
        dev := aView graphicsDevice.
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1615
        dev notNil ifTrue:[
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1616
            (id := aView id) notNil ifTrue:[
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1617
                c := aView cursor onDevice:dev.
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1618
                (cid := c id) notNil ifTrue:[
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1619
                    dev setCursor:cid in:id.
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1620
                ]
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1621
            ]
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1622
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1623
    ].
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 698
diff changeset
  1624
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1625
    "Modified: / 22.4.1998 / 14:28:22 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1626
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1627
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1628
showActivity:someMessage
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1629
    "some activityNotification shalt be communicated to
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1630
     the user; 
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1631
     forward it to my first topView if there is one
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1632
     (that one should know how to deal with it)"
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1633
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1634
    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
  1635
	topViews first showActivity:someMessage
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1636
    ]
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1637
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1638
    "Created: 16.12.1995 / 18:39:40 / cg"
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1639
    "Modified: 23.4.1996 / 21:36:54 / cg"
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1640
!
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1641
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1642
showCursor:aCursor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1643
    "change the cursor to aCursor in all of my views."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1644
2051
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1645
    |c cId vId dev|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1646
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1647
    c := aCursor.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1648
    self allViewsDo:[:aView |  
2051
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1649
        dev := aView graphicsDevice.
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1650
        dev notNil ifTrue:[
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1651
            c := c onDevice:dev.
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1652
            (cId := c id) notNil ifTrue:[
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1653
               (vId := aView id) notNil ifTrue:[
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1654
                    dev setCursor:cId in:vId.
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1655
                ]
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1656
            ]
323362098e21 care for view being still physically present, when setting cursor back
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1657
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1658
    ].
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 698
diff changeset
  1659
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1660
    "Modified: / 22.4.1998 / 14:26:45 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1661
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1662
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1663
withCursor:aCursor do:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1664
    "evaluate aBlock while showing aCursor in all
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1665
     my views (used to show wait-cursor while doing something).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1666
     Return the result as returned by aBlock."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1667
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1668
    |oldCursors dev deviceCursor action|
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1669
926
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
  1670
    dev := self graphicsDevice.   
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1671
    dev isNil ifTrue:[
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1672
        ^ aBlock value
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1673
    ].
244
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
    deviceCursor := aCursor onDevice:dev.
5745269f78a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1561
diff changeset
  1676
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1677
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1678
     get mapping of view->cursor for all of my subviews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1679
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1680
    oldCursors := IdentityDictionary new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1681
    self allViewsDo:[:aView |
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1682
        |old|
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  1683
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1684
        old := aView cursor.
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1685
        old ~~ aCursor ifTrue:[
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1686
            oldCursors at:aView put:old.
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1687
            aView cursor:deviceCursor now:false
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1688
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1689
    ].
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  1690
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  1691
    oldCursors size == 0 ifTrue:[
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1692
        action := aBlock
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1693
    ] ifFalse:[
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1694
        action := [
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1695
                    |rslt|
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1696
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1697
                    "/
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1698
                    "/ here sync looks better; flush leads to almost invisible cursors when accepting.
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1699
                    "/ I dont really know why (maybe unix does not context-switch to the Xserver
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1700
                    "/ early enough after the requests have been sent ?)
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1701
                    "/
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1702
                    dev sync.
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1703
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1704
                    rslt := aBlock valueNowOrOnUnwindDo:[
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1705
                        "
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1706
                         restore cursors from the mapping
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1707
                        "
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1708
                        oldCursors keysAndValuesDo:[:view :cursor |
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1709
                            view cursor:cursor now:false.
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1710
                        ].
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1711
                        dev flush
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1712
                    ].
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1713
                    rslt
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1714
                  ]
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  1715
    ].
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  1716
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1717
"/    (self isModal and:[previousGroup notNil]) ifTrue:[
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1718
"/        "/ pass the work to my parentGroup
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1719
"/        ^ previousGroup withCursor:aCursor do:action
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1720
"/    ].
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  1721
    ^ action value.
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1722
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  1723
    "Modified: / 22.4.1998 / 14:36:47 / cg"
408
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1724
!
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1725
2213
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1726
withExecuteCursorDo:aBlock
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1727
    "evaluate aBlock while showing a busyCursor in all
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1728
     my views (used to show busy-cursor while doing something time consuming).
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1729
     Return the result as returned by aBlock."
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1730
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1731
    ^ self withCursor:(Cursor execute) do:aBlock
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1732
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1733
    "Created: / 31.7.1998 / 20:11:52 / cg"
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1734
!
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1735
408
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1736
withWaitCursorDo:aBlock
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1737
    "evaluate aBlock while showing a waitCursor in all
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1738
     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
  1739
     Return the result as returned by aBlock."
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1740
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1741
    ^ self withCursor:(Cursor wait) do:aBlock
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1742
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  1743
    "Created: 6.2.1996 / 19:51:53 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1744
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1745
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1746
!WindowGroup methodsFor:'special accessing'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1747
429
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1748
isForModalSubview 
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1749
    "special for windowgroups for modal subviews.
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1750
     These must be flagged specially to avoid the views being reassigned
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1751
     to the maingroup.
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1752
     This is a private interface to the SimpleView class"
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1753
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1754
    ^ isForModalSubview
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1755
!
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1756
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1757
isForModalSubview:aBoolean
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1758
    "special for windowgroups for modal subviews.
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1759
     These must be flagged specially to avoid the views being reassigned
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1760
     to the maingroup.
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1761
     This is a private interface to the SimpleView class"
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1762
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1763
    isForModalSubview := aBoolean
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1764
!
0d3bebf239ab autoRaise modalBox when mainView is moved/resized
werner
parents: 417
diff changeset
  1765
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1766
setModal:aBoolean
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1767
    "special entry for debugger: set the modal flag.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1768
     Not for public use"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1769
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1770
    isModal := aBoolean
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
    "Modified: 3.9.1995 / 14:51:04 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1773
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1774
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1775
setPreviousGroup:aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1776
    "special entry for debugger:
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1777
     set the windowgroup that started this group (for modal groups only).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1778
     This is not a public interface."
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
    previousGroup := aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1781
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1782
    "Modified: 3.9.1995 / 14:55:40 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1783
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1784
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1785
setProcess:aProcess 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1786
    "special entry for debugger: set the windowGroups process.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1787
     Not for public use."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1788
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1789
    myProcess := aProcess
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1790
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1791
    "Modified: 3.9.1995 / 14:25:38 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1792
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1793
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
  1794
!WindowGroup class methodsFor:'documentation'!
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1795
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1796
version
2213
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  1797
    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.140 1998-07-31 18:13:08 cg Exp $'
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1798
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1799
WindowGroup initialize!