WindowGroup.st
author Claus Gittinger <cg@exept.de>
Sat, 27 Jan 1996 16:35:09 +0100
changeset 385 15fd1c806d2a
parent 383 a700611bb24b
child 387 aa80487842b8
permissions -rw-r--r--
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
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
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
    15
		focusSequence preEventHook postEventHook pointerView'
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
    16
	classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal'
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
    17
	poolDictionaries:''
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
    18
	category:'Interface-Support'
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
    19
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
    20
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    21
!WindowGroup class methodsFor:'documentation'!
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    22
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    23
copyright
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    24
"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    25
 COPYRIGHT (c) 1993 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
    26
	      All Rights Reserved
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    27
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    28
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    29
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    32
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    33
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    34
"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    35
!
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    36
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    37
documentation
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    38
"
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    39
    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
    40
    extended (split) into a WindowGroup which handles process related stuff, 
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    41
    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
    42
    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
    43
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    44
    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
    45
    windows. All views in a windowGroup share a single windowSensor which holds the
144
claus
parents: 141
diff changeset
    46
    event queue (therefore views all share the same input event queue).
claus
parents: 141
diff changeset
    47
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    48
    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
    49
    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
    50
    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
    51
    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
    52
    There may be multiple event dispatchers running (to support multiple displays);
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    53
    see the documentation/examples in DeviceWorkstation/XWorkstation on how this is done.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    54
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    55
    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
    56
    which waits for events to arrive and processes them, by sending corresponding
144
claus
parents: 141
diff changeset
    57
    event messages to the views controller or the view (*). 
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    58
    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
    59
    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
    60
    This allows for simple views to work without a controller.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    61
    (all of this is actually done in a WindowEvent method)
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    62
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    63
    Therefore, multiple applications run pseudo parallel.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    64
    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
    65
    and entered into the corresponding event queues (because the event dispatcher process
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    66
    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
    67
    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
    68
    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
    69
    a chance to execute (some views do this while performing longtime actions).
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    70
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    71
    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
    72
    box, but execute the event-processing loop for this new group in the original process - 
144
claus
parents: 141
diff changeset
    73
    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
    74
    interaction.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    75
    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
    76
    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
    77
    the original group continues to get update/redraw events.
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    78
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    79
    Normally, one windowgroup is associated to each topview (StandardSystemView)
144
claus
parents: 141
diff changeset
    80
    and all of its subviews. However, this is not strictly required; 
claus
parents: 141
diff changeset
    81
    it is possible to create extra windowgroups for subviews, which will let them
claus
parents: 141
diff changeset
    82
    run in parallel 
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    83
	(for example, the FileBrowsers kill-Button is created that 
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    84
	 way, to allow a kill of an executing unix command, while the browser 
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    85
	 itself reads the pipeStream for incoming text.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    86
	 Even if the fileBrowser is busy reading the pipe, the killButton is still
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    87
	 working and allows terminating the pipe-read action).
144
claus
parents: 141
diff changeset
    88
claus
parents: 141
diff changeset
    89
    On the other hand, multiple topviews can be placed into the same windowGroup;
claus
parents: 141
diff changeset
    90
    which allows for multiview applications, of which only one communicates with
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    91
    the user at a time.
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
    92
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    93
    Multiple topviews within a windowGropup can be configured to behave like one 
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    94
    unit with respect to iconification, deiconification and termination.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    95
    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
    96
    or partner relation among them (see TopView>>beSlave and TopView>>bePartner).
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    97
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
    98
    WindowGroups also support a focus window: this is the one that gets the
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    99
    keyboard input - even if the cursor is located in another subview.
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   100
    (this is a brand new feature and not yet fully released for public use)
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   101
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   102
    Finally, windowgroups are the perfect place for things like defining a
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   103
    cursor for all associated views, flushing all input, waiting for expose
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   104
    events etc.
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   105
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   106
    Dont get confused:
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   107
	You dont have to care for details in the normal case, a windowgroup is
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   108
	created for you automatically, when a view is opened.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   109
	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
   110
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   111
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   112
    instance variables:
144
claus
parents: 141
diff changeset
   113
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   114
	views                   collection of views of this group
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   115
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   116
	topViews                collection of topviews of this group
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   117
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   118
	myProcess               the process executing the events
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   119
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   120
	mySensor                my input sensor
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   121
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   122
	isModal                 true if this is for a modal box
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   123
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   124
	previousGroup           if modal, the group that started this one
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   125
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   126
	focusView               the one that has the focus (or nil)
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   127
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   128
	focusSequence           defines the focus sequence
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   129
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   130
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   131
    clas variables:
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   132
	LeaveSignal             if raised, a modal box leaves (closes)
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   133
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   134
144
claus
parents: 141
diff changeset
   135
    (*) 
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   136
	due to historic reasons, many views have the controller functionality
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   137
	integrated, and handle events themself. The windowSensor takes care
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   138
	of this, by checking if a view has a controller, and, if so, forwarding 
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   139
	the events to it. Otherwise, events are sent directly to the view.
144
claus
parents: 141
diff changeset
   140
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   141
	In the future, all views will be rewritten to actually use a controller.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   142
	Currently (being in the middle of this migration), only some views
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   143
	(buttons, toggles and subclasses) do so.
144
claus
parents: 141
diff changeset
   144
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   145
302
b12e58238233 manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   146
b12e58238233 manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   147
b12e58238233 manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   148
b12e58238233 manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   149
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   150
    For more information, read 'introduction to view programming' in the
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   151
    doc/online directory.
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   152
"
302
b12e58238233 manually resolved conflict (docu only)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   153
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   154
! !
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   155
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   156
!WindowGroup class methodsFor:'initialization'!
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   157
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   158
initialize
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   159
    LeaveSignal isNil ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   160
	LeaveSignal := (Signal new) mayProceed:true.
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   161
	LeaveSignal nameClass:self message:#leaveSignal.
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   162
	LeaveSignal notifierString:'unhandled leave signal'.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   163
    ].
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   164
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   165
    "WindowGroup initialize"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   166
! !
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   167
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   168
!WindowGroup class methodsFor:'instance creation'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   169
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   170
new
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   171
    "create and return a new WindowGroup object"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   172
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   173
    ^ self basicNew initialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   174
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   175
144
claus
parents: 141
diff changeset
   176
!WindowGroup class methodsFor:'Signal constants'!
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   177
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   178
leaveSignal
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   179
    "return the signal which is used to exit a modal loop.
144
claus
parents: 141
diff changeset
   180
     This private signal, is always cought while a modalbox is active.
claus
parents: 141
diff changeset
   181
     Raising it will exit the modal loop and return from the views #openModal
claus
parents: 141
diff changeset
   182
     method."
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   183
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   184
    ^ LeaveSignal
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   185
! !
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   186
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   187
!WindowGroup class methodsFor:'accessing'!
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   188
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   189
activeGroup
180
claus
parents: 172
diff changeset
   190
    "return the currently active windowGroup.
claus
parents: 172
diff changeset
   191
     The returned value may not be fully correct, in case the current process
claus
parents: 172
diff changeset
   192
     handles multiple windowGroups simulaniously. In this case, 
claus
parents: 172
diff changeset
   193
     the first group is returned (prefering a modal if there is one). 
claus
parents: 172
diff changeset
   194
     (maybe we should return a collection of windowGroups here).
claus
parents: 172
diff changeset
   195
claus
parents: 172
diff changeset
   196
     This method is required to simulate the historic ST-80 single display
claus
parents: 172
diff changeset
   197
     behavior for Cursor>>show / Cursor>>showWhile and some others (raising the
claus
parents: 172
diff changeset
   198
     activeGroups topView when modalBoxes appear) on multiple display screens. 
claus
parents: 172
diff changeset
   199
     These methods should change the cursor for the currently 
claus
parents: 172
diff changeset
   200
     active windowGroup ONLY, instead of globally affecting the display or
claus
parents: 172
diff changeset
   201
     all views
claus
parents: 172
diff changeset
   202
     (since, depending on the priority, other views could be unaffacted by this 
claus
parents: 172
diff changeset
   203
      and an overall cursor change does not make sense.)"
claus
parents: 172
diff changeset
   204
claus
parents: 172
diff changeset
   205
    |activeProcess groups wg|
claus
parents: 172
diff changeset
   206
claus
parents: 172
diff changeset
   207
    Processor isNil ifTrue:[^ nil]. "/ only during very early init phase
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   208
180
claus
parents: 172
diff changeset
   209
    activeProcess := Processor activeProcess.
claus
parents: 172
diff changeset
   210
    " caching the last value ..."
claus
parents: 172
diff changeset
   211
    activeProcess == LastActive ifTrue:[
claus
parents: 172
diff changeset
   212
	LastActiveGroup process == LastActive ifTrue:[
claus
parents: 172
diff changeset
   213
	    ^ LastActiveGroup
claus
parents: 172
diff changeset
   214
	]
claus
parents: 172
diff changeset
   215
    ].
claus
parents: 172
diff changeset
   216
    groups := self scheduledWindowGroups 
claus
parents: 172
diff changeset
   217
		select:[:wg | wg process == activeProcess].
claus
parents: 172
diff changeset
   218
    groups size == 1 ifTrue:[
claus
parents: 172
diff changeset
   219
	wg := groups anElement
claus
parents: 172
diff changeset
   220
    ] ifFalse:[
claus
parents: 172
diff changeset
   221
	wg := groups detect:[:wg | wg isModal] ifNone:nil.
claus
parents: 172
diff changeset
   222
	wg isNil ifTrue:[
claus
parents: 172
diff changeset
   223
	    wg := groups anElement
claus
parents: 172
diff changeset
   224
	]
claus
parents: 172
diff changeset
   225
    ].
claus
parents: 172
diff changeset
   226
    wg notNil ifTrue:[
claus
parents: 172
diff changeset
   227
	LastActiveProcess := activeProcess.
claus
parents: 172
diff changeset
   228
	LastActiveGroup := wg.
claus
parents: 172
diff changeset
   229
    ].
claus
parents: 172
diff changeset
   230
    ^ wg
claus
parents: 172
diff changeset
   231
claus
parents: 172
diff changeset
   232
    "
claus
parents: 172
diff changeset
   233
     WindowGroup activeGroup 
claus
parents: 172
diff changeset
   234
    "
claus
parents: 172
diff changeset
   235
claus
parents: 172
diff changeset
   236
    "Modified: 3.9.1995 / 14:49:53 / claus"
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   237
!
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   238
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   239
scheduledWindowGroups
180
claus
parents: 172
diff changeset
   240
    "return a collection of all windowGroups (possibly for different
claus
parents: 172
diff changeset
   241
     display devices) which are scheduled (i.e. which have a process 
claus
parents: 172
diff changeset
   242
     running, handling events)."
claus
parents: 172
diff changeset
   243
claus
parents: 172
diff changeset
   244
    |set screens|
claus
parents: 172
diff changeset
   245
claus
parents: 172
diff changeset
   246
    screens := Screen allScreens.
claus
parents: 172
diff changeset
   247
    screens isNil ifTrue:[^ #()].
claus
parents: 172
diff changeset
   248
claus
parents: 172
diff changeset
   249
    set := IdentitySet new.
claus
parents: 172
diff changeset
   250
    screens do:[:aDevice |
claus
parents: 172
diff changeset
   251
	aDevice allViewsDo:[:aView |
claus
parents: 172
diff changeset
   252
	    |wg|
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   253
180
claus
parents: 172
diff changeset
   254
	    (wg := aView windowGroup) notNil ifTrue:[
claus
parents: 172
diff changeset
   255
		wg process notNil ifTrue:[
claus
parents: 172
diff changeset
   256
		    set add:wg
claus
parents: 172
diff changeset
   257
		]
claus
parents: 172
diff changeset
   258
	    ].
claus
parents: 172
diff changeset
   259
	].
claus
parents: 172
diff changeset
   260
    ].
claus
parents: 172
diff changeset
   261
    ^ set asArray
claus
parents: 172
diff changeset
   262
claus
parents: 172
diff changeset
   263
    "
claus
parents: 172
diff changeset
   264
     WindowGroup scheduledWindowGroups   
claus
parents: 172
diff changeset
   265
    "
claus
parents: 172
diff changeset
   266
claus
parents: 172
diff changeset
   267
    "Modified: 1.9.1995 / 13:43:09 / claus"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   268
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   269
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   270
setActiveGroup:aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   271
    "set the currently active windowGroup.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   272
     Temporary; do not use this interface, it will vanish."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   273
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   274
    LastActiveProcess := Processor activeProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   275
    LastActiveGroup := aGroup
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   276
! !
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   277
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   278
!WindowGroup methodsFor:'accessing'!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   279
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   280
addTopView:aView
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   281
    "add a topview to the group"
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   282
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   283
    topViews isNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   284
	topViews := OrderedCollection new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   285
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   286
    topViews add:aView
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   287
!
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   288
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   289
addView:aView
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   290
    "add aView to the windowGroup"
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   291
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   292
    views isNil ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   293
	views := OrderedCollection new.
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   294
    ].
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   295
    views add:aView
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   296
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   297
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   298
device
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   299
    "return the device, we receive our events from"
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   300
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   301
    (topViews notNil and:[topViews isEmpty not]) ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   302
	^ topViews first device
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   303
    ].
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   304
    (views notNil and:[views isEmpty not]) ifTrue:[
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   305
	^ views first device
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   306
    ].
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   307
    ^ nil
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   308
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   309
    "Created: 13.12.1995 / 14:00:45 / stefan"
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   310
    "Modified: 13.12.1995 / 14:18:11 / stefan"
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   311
!
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
   312
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   313
isModal
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   314
    "return true, if I am in a modal mode"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   315
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   316
    ^ isModal
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   317
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   318
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   319
mainGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   320
    "return the main windowgroup 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   321
     (that is the top one, which is not modal).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   322
     There is one exception to this: the debugger (which is sort of modal)
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   323
     returns itself as mainGroup (not its debuggee)."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   324
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   325
    |g prev|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   326
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   327
    g := self.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   328
    [g notNil and:[g isModal and:[(prev := g previousGroup) notNil]]] whileTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   329
	g := prev
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   330
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   331
    ^ g
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
    "Modified: 3.9.1995 / 14:57:20 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   334
!
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   335
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   336
postEventHook:anObject 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   337
    "set the postEventHook - this one will get all events
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   338
     passed after being processed here (via #processEvent:)."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   339
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   340
    postEventHook := anObject
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   341
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   342
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   343
preEventHook:anObject 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   344
    "set the preEventHook - this one will get all events
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   345
     passed before being processed here (via #processEvent:).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   346
     If this returns true, the event is supposed to be already
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   347
     processed and ignored here.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   348
     Otherwise, it is processed as usual."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   349
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   350
    preEventHook := anObject
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   351
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   352
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   353
previousGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   354
    "return the windowgroup that started this group.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   355
     (for modal groups only)"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   356
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   357
    ^ previousGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   358
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   359
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   360
process 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   361
    "return the windowGroups process"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   362
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   363
    ^ myProcess
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   364
!
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   365
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   366
removeView:aView
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   367
    "remove aView from the windowGroup;
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   368
     if this was the last view in this group, 
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   369
     also shut down the corresponding process 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   370
     (actually, only wake it up here - it will terminate itself 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   371
      when finding out that all views are gone)"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   372
263
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   373
    |sema|
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   374
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   375
    views notNil ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   376
	views remove:aView ifAbsent:[].
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   377
	views isEmpty ifTrue:[
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   378
	    views := nil
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   379
	]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   380
    ].
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   381
    topViews notNil ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   382
	topViews remove:aView ifAbsent:[].
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   383
	topViews isEmpty ifTrue:[
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   384
	    topViews := nil
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   385
	]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   386
    ].
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   387
    "
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   388
     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
   389
     removed (modalBoxes terminate their modalLoop if so)
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   390
    "
262
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   391
    mySensor notNil ifTrue:[
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   392
	(sema := mySensor eventSemaphore) notNil ifTrue:[
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   393
	    sema signal
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   394
	]
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   395
    ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   396
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   397
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   398
sensor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   399
    "return the windowGroups sensor"
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   400
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   401
    ^ mySensor
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   402
!
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   403
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   404
sensor:aSensor
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   405
    "set the windowGroups sensor"
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   406
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   407
    mySensor := aSensor
172
claus
parents: 162
diff changeset
   408
!
claus
parents: 162
diff changeset
   409
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   410
topViews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   411
    "return the topviews accociated to this windowGroup"
172
claus
parents: 162
diff changeset
   412
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   413
    ^ topViews
172
claus
parents: 162
diff changeset
   414
!
claus
parents: 162
diff changeset
   415
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   416
views
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   417
    "return the views accociated to this windowGroup"
172
claus
parents: 162
diff changeset
   418
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   419
    ^ views
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   420
! !
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   421
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   422
!WindowGroup methodsFor:'activation / deactivation'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   423
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   424
closeDownViews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   425
    "destroy all views associated to this window group"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   426
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   427
    topViews notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   428
	topViews do:[:aTopView | aTopView destroy]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   429
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   430
    views := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   431
    topViews := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   432
    mySensor := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   433
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   434
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   435
realizeTopViews:isRestart
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   436
    "realize all topViews associated to this windowGroup.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   437
     If this is a restart, tell topViews about it."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   438
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   439
    topViews notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   440
	topViews do:[:aView |
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   441
	    aView realize.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   442
	    isRestart ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   443
		aView restarted
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   444
	    ]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   445
	].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   446
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   447
!
180
claus
parents: 172
diff changeset
   448
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   449
restart
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   450
    "restart after a snapin."
180
claus
parents: 172
diff changeset
   451
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   452
    topViews notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   453
	"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   454
	 need a new semaphore, since obsolete processes 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   455
	 (from our previous live) may still sit on the current semaphore
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   456
	"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   457
	mySensor eventSemaphore:Semaphore new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   458
	isModal ifFalse:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   459
	    self startup:true 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   460
	]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   461
    ]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   462
!
180
claus
parents: 172
diff changeset
   463
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   464
shutdown
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   465
    "shutdow the window group; close all views and
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   466
     terminate process"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   467
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   468
    |p|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   469
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   470
    self closeDownViews.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   471
    myProcess notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   472
	p := myProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   473
	myProcess := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   474
	p terminate.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   475
    ]
180
claus
parents: 172
diff changeset
   476
!
claus
parents: 172
diff changeset
   477
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   478
startup:isRestart
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   479
    "startup the window-group;
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   480
     this creates a new window group process, which
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   481
     does the event processing."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   482
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   483
    |top nm dev devNm|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   484
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   485
    previousGroup := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   486
    myProcess isNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   487
	isModal := false.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   488
	myProcess := [
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   489
	    self realizeTopViews:isRestart.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   490
	    self eventLoopWhile:[true] onLeave:[]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   491
	] forkAt:Processor userSchedulingPriority.
180
claus
parents: 172
diff changeset
   492
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   493
	(topViews notNil and:[topViews isEmpty not]) ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   494
	    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   495
	     give the handler process a user friendly name
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   496
	    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   497
	    top := topViews first.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   498
	    nm := top processName.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   499
	    (dev := top device) notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   500
		devNm := dev displayName.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   501
		(devNm notNil and:[devNm ~= Display displayName]) ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   502
		    nm := nm , ' (' , devNm , ')'
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   503
		]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   504
	    ]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   505
	] ifFalse:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   506
	    nm := 'window handler'.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   507
	].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   508
	myProcess name:nm.
180
claus
parents: 172
diff changeset
   509
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   510
	"
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   511
	 when the process gets suspended, there maybe still buffered draw requests.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   512
	 Flush them.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   513
	"
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   514
	myProcess suspendAction:[ 
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   515
	    |dev|
318
30d7b8d96eaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   516
	    dev := self device.
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   517
	    dev notNil ifTrue:[dev flush].
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   518
	].
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   519
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   520
	"when the process dies, we have to close-down
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   521
	 the views as well
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   522
	"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   523
	myProcess exitAction:[self closeDownViews]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   524
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   525
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   526
    "Modified: 13.12.1995 / 14:04:53 / stefan"
180
claus
parents: 172
diff changeset
   527
!
claus
parents: 172
diff changeset
   528
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   529
startupModal:checkBlock
301
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   530
    "startup the window-group in a modal loop 
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   531
     (i.e. under the currently running process);
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   532
     checkBlock is evaluated and the modal loop is left, whenever false is returned."
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   533
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   534
    ^ self startupModal:checkBlock forGroup:WindowGroup activeGroup.
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   535
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   536
    "Created: 10.12.1995 / 14:15:11 / cg"
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   537
!
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   538
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   539
startupModal:checkBlock forGroup:mainGroup
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   540
    "startup the window-group in a modal loop 
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   541
     (i.e. under the currently running process);
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   542
     checkBlock is evaluated and loop is left, when false is
301
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   543
     returned.
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   544
     The mainGroup info is required to allow peeking into its
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   545
     event queue in order for its expose/redraws to be handled."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   546
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   547
    "set previousGroup to the main (non-modal) group"
180
claus
parents: 172
diff changeset
   548
301
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   549
    previousGroup := mainGroup.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   550
    isModal := true.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   551
    self realizeTopViews:false.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   552
    self 
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   553
	eventLoopWhile:checkBlock 
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   554
	onLeave:[
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   555
	    "
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   556
	     cleanup, in case of a terminate
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   557
	    "
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   558
	    previousGroup := nil.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   559
	    topViews := nil.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   560
	    views := nil.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   561
	    "
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   562
	     the following is rubbish;
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   563
	     the views could be reused ..
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   564
	    "
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   565
"
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   566
	    topViews notNil ifTrue:[
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   567
		topViews do:[:aView |
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   568
		    aView destroy
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   569
		].
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   570
		topViews := nil.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   571
	    ].
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   572
	    views notNil ifTrue:[
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   573
		views do:[:aView |
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   574
		    aView destroy
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   575
		].
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   576
		views := nil.
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   577
	    ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   578
"
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   579
	]
301
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   580
b57451fd8560 passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   581
    "Created: 10.12.1995 / 14:14:26 / cg"
180
claus
parents: 172
diff changeset
   582
! !
claus
parents: 172
diff changeset
   583
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   584
!WindowGroup methodsFor:'enumerating'!
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   585
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   586
allTopViewsExcept:aView do:aBlock
157
claus
parents: 152
diff changeset
   587
    "evaluate aBlock for all topviews except aView in this group.
claus
parents: 152
diff changeset
   588
     This works on a copy of the view collection, to allow for
158
claus
parents: 157
diff changeset
   589
     destroy and other collection changing operations to be done."
157
claus
parents: 152
diff changeset
   590
claus
parents: 152
diff changeset
   591
    topViews notNil ifTrue:[
claus
parents: 152
diff changeset
   592
	topViews copy do:[:v |
claus
parents: 152
diff changeset
   593
	    v ~~ aView ifTrue:[aBlock value:v]
claus
parents: 152
diff changeset
   594
	]
claus
parents: 152
diff changeset
   595
    ].
claus
parents: 152
diff changeset
   596
!
claus
parents: 152
diff changeset
   597
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   598
allViewsDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   599
    "evaluate aBlock for all views & topviews in this group.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   600
     This works on a copy of the view collection, to allow for
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   601
     destroy and other collection changing operations to be done."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   602
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   603
    topViews notNil ifTrue:[topViews copy do:aBlock].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   604
    views notNil ifTrue:[views copy do:aBlock]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   605
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   606
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   607
partnersDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   608
    "evaluate aBlock for all partnerViews.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   609
     This works on a copy of the view collection, to allow for
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   610
     destroy and other collection changing operations to be done."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   611
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   612
    topViews notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   613
	topViews copy do:[:v |
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   614
	    v notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   615
		v type == #partner ifTrue:[aBlock value:v].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   616
	    ]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   617
	]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   618
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   619
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   620
157
claus
parents: 152
diff changeset
   621
slavesDo:aBlock
claus
parents: 152
diff changeset
   622
    "evaluate aBlock for all slaveViews.
claus
parents: 152
diff changeset
   623
     This works on a copy of the view collection, to allow for
158
claus
parents: 157
diff changeset
   624
     destroy and other collection changing operations to be done."
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   625
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   626
    topViews notNil ifTrue:[
157
claus
parents: 152
diff changeset
   627
	topViews copy do:[:v |
claus
parents: 152
diff changeset
   628
	    v notNil ifTrue:[
claus
parents: 152
diff changeset
   629
		v type == #slave ifTrue:[aBlock value:v].
claus
parents: 152
diff changeset
   630
	    ]
claus
parents: 152
diff changeset
   631
	]
claus
parents: 152
diff changeset
   632
    ].
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   633
! !
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   634
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
   635
!WindowGroup methodsFor:'event handling'!
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   636
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   637
eventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   638
    "loop executed by windowGroup process;
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   639
     wait-for and process events forever"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   640
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   641
   self eventLoopWhile:[true] onLeave:[]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   642
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   643
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   644
eventLoopWhile:aBlock onLeave:cleanupActions
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   645
    "wait-for and process events. 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   646
     Stay in this loop while there are still any views to dispatch for,
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   647
     and aBlock evaluates to true."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   648
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   649
    |thisProcess|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   650
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   651
    thisProcess := Processor activeProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   652
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   653
    [
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   654
	"/
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   655
	"/ on leave, exit the event loop
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   656
	"/
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   657
	LeaveSignal handle:[:ex |
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   658
	    ex return
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   659
	] do:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   660
	    |p g mainGroup mySema waitSema|
325
b24d9a1c74dc stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   661
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   662
	    waitSema := mySema := mySensor eventSemaphore.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   663
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   664
	    isModal ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   665
		mainGroup := self mainGroup.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   666
		mainGroup == self ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   667
		    mainGroup := nil
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   668
		].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   669
		mainGroup notNil ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   670
		    waitSema := SemaphoreSet with:mySema 
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   671
					     with:(mainGroup sensor eventSemaphore).
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   672
		].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   673
	    ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   674
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   675
	    aBlock whileTrue:[ 
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   676
		LastActiveGroup := self.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   677
		LastActiveProcess := thisProcess.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   678
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   679
		(views isNil and:[topViews isNil]) ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   680
		    myProcess notNil ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   681
			p := myProcess.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   682
			myProcess := nil.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   683
			p terminate.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   684
			"not reached - there is no life after death"
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   685
		    ].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   686
		    "
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   687
		     this is the end of a modal loop
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   688
		     (not having a private process ...)
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   689
		    "
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   690
		    ^ self
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   691
		].
323
619085d52522 be careful - device may be nil
Claus Gittinger <cg@exept.de>
parents: 319
diff changeset
   692
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   693
		"/
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   694
		"/ on abort, stay in the event loop
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   695
		"/
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   696
		AbortSignal handle:[:ex |
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   697
		    ex return
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   698
		] do:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   699
		    ActivityNotificationSignal handle:[:ex |
375
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   700
			"/
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   701
			"/ if I am a modal-group, let it be handled
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   702
			"/ by the outer main-groups handler
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   703
			"/
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   704
			isModal ifTrue:[
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   705
			    ex reject
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   706
			    "never reached"
44d1d4006cdd modalBoxes should not handle activityNotification requests (but forward to the mainGroup)
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   707
			].
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   708
			self showActivity:(ex errorString).
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   709
			ex proceed.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   710
		    ] do:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   711
			|dev gotSema|
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
   712
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   713
			"/ no more events. Flush device output. This may produce more events.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   714
			dev := self device.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   715
			dev notNil ifTrue:[dev flush].
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   716
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   717
			thisProcess setStateTo:#eventWait if:#active.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   718
			gotSema := waitSema wait.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   719
			LastActiveGroup := self.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   720
			LastActiveProcess := thisProcess.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   721
			gotSema == mySema ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   722
			    self processEvents
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   723
			] ifFalse:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   724
			    "
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   725
			     if modal, also check for redraw events in my maingroup
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   726
			     (we arrive here after we woke up on maingroup sensor eventSemaphore)
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   727
			    "
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   728
			    mainGroup processExposeEvents
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   729
			]
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   730
		    ]
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   731
		].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   732
	    ].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   733
	].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   734
    ] valueNowOrOnUnwindDo:[
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   735
	cleanupActions notNil ifTrue:[cleanupActions value]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   736
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
   737
325
b24d9a1c74dc stefans modalBox changes (no more polling)
Claus Gittinger <cg@exept.de>
parents: 324
diff changeset
   738
    "Modified: 14.12.1995 / 11:12:24 / stefan"
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
   739
    "Modified: 16.12.1995 / 18:39:03 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   740
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   741
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   742
leaveEventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   743
    "immediately leave the event loop, returning way back.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   744
     This can be used to leave (and closedown) a modal group.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   745
     (for normal views, this does not make sense)"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   746
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   747
    ^ LeaveSignal raise
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   748
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   749
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   750
processEvents
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   751
    "process events from either the damage- or user input queues.
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   752
     Abort is assumed to be handled elsewhere."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
   753
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   754
    |event ignore|
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   755
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   756
    self processExposeEvents.
180
claus
parents: 172
diff changeset
   757
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   758
    [mySensor hasEvents] whileTrue:[
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   759
	event := mySensor nextEvent.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   760
	event notNil ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   761
	    (views notNil or:[topViews notNil]) ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   762
		ignore := false.
172
claus
parents: 162
diff changeset
   763
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   764
		(preEventHook  notNil 
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   765
		and:[preEventHook processEvent:event]) ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   766
		    ignore := true.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   767
		].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   768
		ignore ifFalse:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   769
		    "/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   770
		    "/ FocusStepping is done right here
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   771
		    "/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   772
		    event isKeyPressEvent ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   773
			event key == #FocusNext ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   774
			    self focusNext.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   775
			    ignore := true
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   776
			].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   777
			event key == #FocusPrevious ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   778
			    self focusPrevious.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   779
			    ignore := true
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   780
			].
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   781
			event key == #Tab ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   782
			    focusView notNil ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   783
				focusView canTab ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   784
				    self focusNext.    
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   785
				    ignore := true
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   786
				]
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   787
			    ] ifFalse:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   788
				pointerView notNil ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   789
				    pointerView canTab ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   790
					self focusNext.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   791
					ignore := true.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   792
				    ]
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   793
				] ifFalse:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   794
				    self focusNext.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   795
				    ignore := true.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   796
				]
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   797
			    ]
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   798
			].
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   799
		    ].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   800
		    event isPointerEnterEvent ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   801
			pointerView := event view
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   802
		    ].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   803
		    event isPointerLeaveEvent ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   804
			pointerView := nil
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   805
		    ].
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   806
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   807
		    ignore ifFalse:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   808
			"/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   809
			"/  button events turn off explicit focus, and revert
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   810
			"/  to implicit focus control
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   811
			"/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   812
			(focusView notNil
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   813
			and:[event isButtonEvent]) ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   814
			    self focusView:nil
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   815
			].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   816
			"/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   817
			"/ let the event forward itself
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   818
			"/
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   819
			LastActiveGroup := self.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   820
			LastActiveProcess := Processor activeProcess.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   821
			event sendEventWithFocusOn:focusView.
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   822
		    ]
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   823
		].
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   824
		postEventHook notNil ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   825
		    postEventHook processEvent:event
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   826
		]
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   827
	    ]
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   828
	].
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   829
    ]
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   830
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   831
    "Modified: 9.1.1996 / 15:52:30 / cg"
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
   832
!
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
   833
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
   834
processExposeEvents
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   835
    "process only expose events from the damage queue"
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
   836
180
claus
parents: 172
diff changeset
   837
    |event view rect x y w h sensor thisProcess|
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   838
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   839
    (sensor := mySensor) isNil ifTrue:[^ self].
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
   840
180
claus
parents: 172
diff changeset
   841
    thisProcess := Processor activeProcess.
claus
parents: 172
diff changeset
   842
claus
parents: 172
diff changeset
   843
    [sensor hasDamage] whileTrue:[
claus
parents: 172
diff changeset
   844
	LastActiveGroup := self.
claus
parents: 172
diff changeset
   845
	LastActiveProcess := thisProcess.
claus
parents: 172
diff changeset
   846
claus
parents: 172
diff changeset
   847
	event := sensor nextDamage.
claus
parents: 172
diff changeset
   848
	event notNil ifTrue:[
claus
parents: 172
diff changeset
   849
	    (views notNil or:[topViews notNil]) ifTrue:[
claus
parents: 172
diff changeset
   850
		(preEventHook notNil 
claus
parents: 172
diff changeset
   851
		and:[preEventHook processEvent:event]) ifFalse:[
claus
parents: 172
diff changeset
   852
		    event isDamage ifTrue:[
claus
parents: 172
diff changeset
   853
			view := event view.
claus
parents: 172
diff changeset
   854
			"/
claus
parents: 172
diff changeset
   855
			"/ if the view is no longer shown (iconified or closed),
claus
parents: 172
diff changeset
   856
			"/ this is a leftover event and ignored.
claus
parents: 172
diff changeset
   857
			"/
claus
parents: 172
diff changeset
   858
			view shown ifTrue:[
claus
parents: 172
diff changeset
   859
			    rect := event rectangle.
claus
parents: 172
diff changeset
   860
			    x := rect left.
claus
parents: 172
diff changeset
   861
			    y := rect top.
claus
parents: 172
diff changeset
   862
			    w := rect width.
claus
parents: 172
diff changeset
   863
			    h := rect height.
claus
parents: 172
diff changeset
   864
			    LastActiveGroup := self.
claus
parents: 172
diff changeset
   865
			    LastActiveProcess := thisProcess.
claus
parents: 172
diff changeset
   866
			    view transformation notNil ifTrue:[
claus
parents: 172
diff changeset
   867
				view deviceExposeX:x y:y width:w height:h
claus
parents: 172
diff changeset
   868
			    ] ifFalse:[
claus
parents: 172
diff changeset
   869
				view exposeX:x y:y width:w height:h
172
claus
parents: 162
diff changeset
   870
			    ]
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   871
			]
180
claus
parents: 172
diff changeset
   872
		    ] ifFalse:[
claus
parents: 172
diff changeset
   873
			"
claus
parents: 172
diff changeset
   874
			 mhmh - could we possibly arrive here ?
claus
parents: 172
diff changeset
   875
			"
claus
parents: 172
diff changeset
   876
			LastActiveGroup := self.
claus
parents: 172
diff changeset
   877
			LastActiveProcess := thisProcess.
claus
parents: 172
diff changeset
   878
			event sendEvent.
78
1c9c22df3251 *** empty log message ***
claus
parents: 72
diff changeset
   879
		    ]
180
claus
parents: 172
diff changeset
   880
		].
claus
parents: 172
diff changeset
   881
		postEventHook notNil ifTrue:[
claus
parents: 172
diff changeset
   882
		    postEventHook processEvent:event
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   883
		]
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   884
	    ]
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   885
	]
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   886
    ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   887
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   888
28
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
   889
waitForExposeFor:aView
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
   890
    "wait for a noExpose on aView, then process all exposes.
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
   891
     To be used after a scroll"
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
   892
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
   893
    mySensor waitForExposeFor:aView.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   894
    AbortSignal catch:[
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   895
	self processExposeEvents
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   896
    ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   897
! !
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
   898
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   899
!WindowGroup methodsFor:'focus control'!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   900
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   901
focusNext
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   902
    "give focus to next view in focusSequence"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   903
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   904
    |index|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   905
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   906
    focusSequence size == 0 ifTrue:[^ self].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   907
    focusView notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   908
	index := (focusSequence indexOf:focusView) + 1.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   909
	index > focusSequence size ifTrue:[index := 1].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   910
    ] ifFalse:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   911
	index := 1.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   912
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   913
    self focusView:(focusSequence at:index)
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   914
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   915
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   916
     |top v1 v2|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   917
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   918
     top := StandardSystemView new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   919
     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
   920
     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
   921
     top open.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   922
     top windowGroup focusSequence:(Array with:v1 with:v2).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   923
     top windowGroup focusOn:v1.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   924
     (Delay forSeconds:10) wait.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   925
     top windowGroup focusNext.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   926
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   927
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   928
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   929
focusPrevious
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   930
    "give focus to previous view in focusSequence"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   931
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   932
    |index|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   933
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   934
    focusSequence size == 0 ifTrue:[^ self].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   935
    focusView notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   936
	index := (focusSequence indexOf:focusView) - 1.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   937
	index < 1 ifTrue:[index := focusSequence size].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   938
    ] ifFalse:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   939
	index := focusSequence size.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   940
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   941
    self focusView:(focusSequence at:index)
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   942
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   943
135
claus
parents: 121
diff changeset
   944
focusSequence
claus
parents: 121
diff changeset
   945
    "return the focus sequence for focusNext/focusPrevious.
claus
parents: 121
diff changeset
   946
     Focus is stepped in the order in which subviews occur in
claus
parents: 121
diff changeset
   947
     the sequence"
claus
parents: 121
diff changeset
   948
claus
parents: 121
diff changeset
   949
    ^ focusSequence
claus
parents: 121
diff changeset
   950
!
claus
parents: 121
diff changeset
   951
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   952
focusSequence:aSequenceableCollection
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   953
    "define the focus sequence for focusNext/focusPrevious.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   954
     Focus is stepped in the order in which subviews occur in
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   955
     the sequence"
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   956
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   957
    focusSequence := aSequenceableCollection
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   958
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   959
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   960
focusView
135
claus
parents: 121
diff changeset
   961
    "return the view which currently has the focus"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   962
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   963
    ^ focusView
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   964
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   965
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   966
focusView:aViewOrNil
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   967
    "give focus to aViewOrNil"
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   968
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   969
    focusView notNil ifTrue:[
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   970
	focusView showNoFocus:true. "/ focusOut.
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   971
    ] ifFalse:[
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   972
	pointerView notNil ifTrue:[
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   973
	    pointerView ~~ aViewOrNil ifTrue:[
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   974
		pointerView showNoFocus:false "/ focusOut
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   975
	    ]
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
   976
	].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   977
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   978
    focusView := aViewOrNil.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   979
    focusView notNil ifTrue:[
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   980
	focusView showFocus:true. "/ focusIn
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   981
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   982
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   983
    "
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   984
     |top v1 v2|
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   985
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   986
     top := StandardSystemView new.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   987
     v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   988
     v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   989
     top open.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   990
     top windowGroup focusView:v1.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
   991
    "
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   992
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   993
    "Modified: 27.1.1996 / 13:11:16 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   994
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   995
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   996
!WindowGroup methodsFor:'initialization'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   997
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   998
initialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   999
    "setup the windowgroup, by creating a new sensor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1000
     and an event semaphore"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1001
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1002
    mySensor := WindowSensor new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1003
    mySensor eventSemaphore:Semaphore new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1004
    isModal := false.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1005
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1006
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1007
reinitialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1008
    "reinitialize the windowgroup after an image restart"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1009
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1010
    "throw away old (zombie) process"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1011
    myProcess notNil ifTrue:[
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1012
	"careful: the old processes exitaction must be cleared
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1013
	 otherwise, it might do destroy or other actions when it
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1014
	 gets finalized ...
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1015
	"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1016
	myProcess exitAction:nil.
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1017
	myProcess suspendAction:nil.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1018
	myProcess := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1019
    ].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1020
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1021
    "throw away old events"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1022
    mySensor reinitialize
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1023
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1024
    "Modified: 13.12.1995 / 13:45:35 / stefan"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1025
! !
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1026
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1027
!WindowGroup methodsFor:'printing'!
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1028
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1029
printOn:aStream
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1030
    "return a printed representation;
144
claus
parents: 141
diff changeset
  1031
     just for more user friendlyness: add name of process."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1032
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1033
    myProcess isNil ifTrue:[
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1034
	(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1035
	    aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')').
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1036
	    ^ self.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1037
	].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1038
	^ super printOn:aStream
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1039
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1040
    aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')')
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1041
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1042
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1043
!WindowGroup methodsFor:'special'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1044
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1045
restoreCursors
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1046
    "restore the original cursors in all of my views"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1047
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1048
    self allViewsDo:[:aView |  
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1049
	|c dev id|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1050
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1051
	dev := aView device.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1052
	dev notNil ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1053
	    c := aView cursor on:dev.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1054
	    (id := aView id) notNil ifTrue:[
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1055
		dev setCursor:(c id) in:id.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1056
	    ]
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1057
	]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1058
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1059
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1060
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1061
showActivity:someMessage
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1062
    topViews notNil ifTrue:[
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1063
	topViews first showActivity:someMessage
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1064
    ]
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1065
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1066
    "Created: 16.12.1995 / 18:39:40 / cg"
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1067
!
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  1068
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1069
showCursor:aCursor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1070
    "change the cursor to aCursor in all of my views."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1071
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1072
    |c|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1073
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1074
    c := aCursor.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1075
    self allViewsDo:[:aView |  
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1076
	c := c on:(aView device).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1077
	aView device setCursor:c id in:aView id.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1078
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1079
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1080
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1081
withCursor:aCursor do:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1082
    "evaluate aBlock while showing aCursor in all
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1083
     my views (used to show wait-cursor while doing something).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1084
     Return the result as returned by aBlock."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1085
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1086
    |oldCursors dev|
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1087
383
a700611bb24b oops withCursorDo: failed in top-only views
ah
parents: 375
diff changeset
  1088
    dev := self device.   
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1089
    dev isNil ifTrue:[
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1090
	^ aBlock value
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1091
    ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1092
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1093
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1094
     get mapping of view->cursor for all of my subviews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1095
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1096
    oldCursors := IdentityDictionary new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1097
    self allViewsDo:[:aView |
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1098
	oldCursors at:aView put:(aView cursor).
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1099
	aView cursor:aCursor now:false
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1100
    ].
329
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1101
    "/
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1102
    "/ here sync looks better; flush leads to almost invisible cursors when accepting.
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1103
    "/ I dont really know why (maybe unix does not context-switch to the Xserver
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1104
    "/ early enough after the requests have been sent ?)
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1105
    "/
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1106
"/    dev flush. 
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1107
    dev sync.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1108
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1109
    ^ aBlock valueNowOrOnUnwindDo:[
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1110
	"
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1111
	 restore cursors from the mapping
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1112
	"
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1113
	oldCursors keysAndValuesDo:[:view :cursor |
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1114
	    view cursor:cursor now:false.
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1115
	].
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  1116
	dev flush "/ sync.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1117
    ]
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  1118
329
8a34deadc4ff sync (not flush) after a cursor change
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1119
    "Modified: 17.12.1995 / 15:45:49 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1120
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1121
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1122
!WindowGroup methodsFor:'special accessing'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1123
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1124
setModal:aBoolean
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1125
    "special entry for debugger: set the modal flag.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1126
     Not for public use"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1127
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1128
    isModal := aBoolean
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1129
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1130
    "Modified: 3.9.1995 / 14:51:04 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1131
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1132
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1133
setPreviousGroup:aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1134
    "special entry for debugger:
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1135
     set the windowgroup that started this group (for modal groups only).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1136
     This is not a public interface."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1137
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1138
    previousGroup := aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1139
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1140
    "Modified: 3.9.1995 / 14:55:40 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1141
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1142
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1143
setProcess:aProcess 
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1144
    "special entry for debugger: set the windowGroups process.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1145
     Not for public use."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1146
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1147
    myProcess := aProcess
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1148
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1149
    "Modified: 3.9.1995 / 14:25:38 / claus"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1150
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1151
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1152
!WindowGroup class methodsFor:'documentation'!
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1153
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1154
version
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1155
    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.57 1996-01-27 15:35:09 cg Exp $'
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  1156
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1157
WindowGroup initialize!