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