WindowGroup.st
author Claus Gittinger <cg@exept.de>
Wed, 13 Jun 2001 09:57:29 +0200
changeset 3438 8d3e56c417ce
parent 3436 0c0c8b88b669
child 3440 33d132092b22
permissions -rw-r--r--
oops - topViews may become empty after hideRequest.
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
3212
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
    13
"{ Package: 'stx:libview' }"
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
    14
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
    15
Object subclass:#WindowGroup
2857
b9bff260f854 cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
    16
	instanceVariableNames:'graphicsDevice views topViews myProcess mySensor isModal
b9bff260f854 cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
    17
		previousGroup focusView focusSequence preEventHook postEventHook
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    18
		pointerView isForModalSubview focusByTab groupHasFocus busyHook
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
    19
		busyHookTimeout inModalLoop'
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
    20
	classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    21
		WindowGroupQuerySignal LastEventQuerySignal BusyHookTime'
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
    22
	poolDictionaries:''
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
    23
	category:'Interface-Support'
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
    24
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
    25
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
    26
!WindowGroup class methodsFor:'documentation'!
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    27
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    28
copyright
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    29
"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    30
 COPYRIGHT (c) 1993 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
    31
	      All Rights Reserved
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    32
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    33
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    34
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    36
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    37
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    38
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    39
"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    40
!
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    41
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    42
documentation
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
    43
"
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    44
    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
    45
    extended (split) into a WindowGroup which handles process related stuff, 
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    46
    and the Controller, which only handles events for a view and defines the user interaction.
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    47
    The controller functionality might be (actually: often is) included in the view components.
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    48
    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
    49
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    50
    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
    51
    windows. All views in a windowGroup share a single windowSensor which holds the
1503
47c18026683d commentary
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    52
    event queue (therefore subviews all share the same input event queue).
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    53
    Actually, there are two separate event queues - one for damage and view-visibility-related events,
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    54
    another one for user interaction (such as mouse, keyboard etc.)
144
claus
parents: 141
diff changeset
    55
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    56
    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
    57
    This is done by a separate process (so called event-dispatcher) which runs at a higher
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    58
    priority. The event dispatcher determines the queue into which an event has to be placed,
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    59
    by asking the view for which the event is destined (via the views sensor).
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    60
    There may be multiple event dispatchers running (to support multiple displays);
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    61
    see the documentation/examples in DeviceWorkstation/XWorkstation on how this is done.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    62
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    63
    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
    64
    which waits for events to arrive and processes them, by sending corresponding
144
claus
parents: 141
diff changeset
    65
    event messages to the views controller or the view (*). 
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    66
    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
    67
    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
    68
    This allows for simple views to work without a controller.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    69
    (all of this is actually done in a WindowEvent method)
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    70
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    71
    Therefore, multiple applications run pseudo parallel.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    72
    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
    73
    and entered into the corresponding event queues (because the event dispatcher process
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    74
    runs at a higher priority). However, the actual processing of the event is only
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    75
    possibly if no other process is busy at the same or a higher priority (unless timeslicing is enabled).
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    76
    If timeslicing is off, it is possible to change a windowProcesses priority in order to give 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    77
    other windows a chance to execute (some views do this while performing longtime actions).
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    78
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    79
    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
    80
    box, but execute the event-processing loop for this new group in the original process - 
144
claus
parents: 141
diff changeset
    81
    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
    82
    interaction.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
    83
    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
    84
    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
    85
    the original group continues to get update/redraw events.
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    86
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
    87
    Normally, one windowgroup is associated to each topview (StandardSystemView)
144
claus
parents: 141
diff changeset
    88
    and all of its subviews. However, this is not strictly required; 
claus
parents: 141
diff changeset
    89
    it is possible to create extra windowgroups for subviews, which will let them
claus
parents: 141
diff changeset
    90
    run in parallel 
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    91
        (for example, the FileBrowsers kill-Button is created that 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    92
         way, to allow a kill of an executing unix command, while the browser 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    93
         itself reads the pipeStream for incoming text.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    94
         Even if the fileBrowser is busy reading the pipe, the killButton is still
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    95
         working and allows terminating the pipe-read action).
144
claus
parents: 141
diff changeset
    96
claus
parents: 141
diff changeset
    97
    On the other hand, multiple topviews can be placed into the same windowGroup;
claus
parents: 141
diff changeset
    98
    which allows for multiview applications, of which only one communicates with
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
    99
    the user at a time (for example: the GUI painters canvas and gallery are in the same group).
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   100
    Multiple topviews within a windowGropup can be configured to behave like one 
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   101
    unit with respect to iconification, deiconification and termination.
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   102
    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
   103
    or partner relation among them (see TopView>>beSlave and TopView>>bePartner).
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   104
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   105
    WindowGroups also support a focus window: this is the one that gets the
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   106
    keyboard input - even if the cursor is located in another subview.
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   107
    The sequence is defined by the topView or its model (typically an applicationModel).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   108
    It should return an orderedCollection of subviews when asked via #focusSequence.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   109
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   110
    For debugging or special event manipulations, windowGroups allow for hooks to be installed 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   111
    around the processing of events - preEventHook is sent a #procesEvent: message before an event is processed,
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   112
    postEventHook is informed after the event has been processed.
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   113
    The preEventHook should return a boolean - if it returns true, the event is considered
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   114
    being already processed by the hook and ignored.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   115
    This allows for event-tracing, timing or even filtering (if preEventHook returns true).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   116
    (notice: there is also an eventHook facility available in the sensor class.)
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   117
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   118
    Finally, windowgroups are the perfect place for things like defining a
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   119
    cursor for all associated views, flushing all input, waiting for expose events etc.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   120
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   121
    Late News:
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   122
      a busyHook and busyHookTimeout has been added; this hook-(block) gets invoked, whenever
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   123
      the process was busy handling an event for some time. This can be used to automatically install
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   124
      a busy cursor (hour-glass) in an application, if some processing takes some time
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   125
      (without a need for #withCursorDo: all over the place in the application)
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   126
297
9942b0660ae5 documentation update
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   127
    Dont get confused:
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   128
        You dont have to care for all those details in the normal case;
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   129
        a windowgroup is created for you automatically, when a view is opened.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   130
        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
   131
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   132
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   133
    [instance variables:]
144
claus
parents: 141
diff changeset
   134
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   135
        views                   collection of views of this group
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   136
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   137
        topViews                collection of topviews of this group
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   138
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   139
        myProcess               the process executing the events
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   140
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   141
        mySensor                my input sensor
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   142
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   143
        isModal                 true if this is for a modal box
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   144
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   145
        previousGroup           if modal, the group that started this one
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   146
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   147
        focusView               the one that has the keyboard focus (or nil)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   148
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   149
        focusByTab              if focus came via tabbing 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   150
                                (as opposed to an implicit focus change)
2485
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
   151
                                
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   152
        focusSequence           defines the focus sequence
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   153
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   154
        preEventHook            if non-nil, that one gets notified of incoming
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   155
                                events BEFORE an event is dispatched.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   156
                                May eat events (i.e. suppress dispatch)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   157
                                (hook for event filters or recorders)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   158
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   159
        postEventHook           if non-nil, that one gets notified
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   160
                                AFTER an event was dispatched.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   161
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   162
        isForModalSubView
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   163
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   164
        groupHasFocus           true, if this windowGroup has the focus
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
   165
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   166
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   167
    [class variables:]
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   168
        LeaveSignal             if raised, a modal box leaves (closes)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   169
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   170
        WindowGroupQuerySignal  to ask for the current windowGroup,
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   171
                                anywhere in the program, simply raise this
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   172
                                signal. The raise returns nil, for processes,
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   173
                                which are not under control of a windowGroup.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   174
                                (i.e. wg := WindowGroup windowGroupQuerySignal raise)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   175
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   176
        LastEventQuerySignal    to ask for the event which was responsible
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   177
                                for being where you are (whereever that is).
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   178
                                The raise returns nil, if you did not arrive
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   179
                                there due to an event.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   180
                                (i.e. ev := WindowGroup lastEventQuerySignal raise)
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   181
                                The event can be asked for the view, the type
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   182
                                of event, x/y position etc.
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
   183
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
   184
144
claus
parents: 141
diff changeset
   185
    (*) 
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   186
        due to historic reasons, many views have the controller functionality
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   187
        integrated, and handle events themself. The windowSensor takes care
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   188
        of this, by checking if a view has a controller, and, if so, forwarding 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   189
        the events to it. Otherwise, events are sent directly to the view.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   190
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   191
        In the future, all views will be rewritten to actually use a controller.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   192
        Currently (being in the middle of this migration), only some views
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   193
        (buttons, toggles and subclasses) do so.
144
claus
parents: 141
diff changeset
   194
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   195
    For more information, read 'introduction to view programming' in the
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
   196
    doc/online directory.
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   197
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   198
    [author:]
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   199
        Claus Gittinger
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   200
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   201
    [see also:]
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   202
        WindowSensor WindowEvent EventListener KeyboardForwarder
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   203
        DeviceWorkstation
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   204
        View StandardSystemView
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   205
        ApplicationModel
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   206
        Process ProcessorScheduler
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   207
        (``Working with processes (programmers manual)'': programming/processes.html#VIEWSNPROCS)
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   208
"
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   209
! !
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   210
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   211
!WindowGroup class methodsFor:'initialization'!
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   212
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   213
initialize
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   214
    LeaveSignal isNil ifTrue:[
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   215
	LeaveSignal := (Signal new) mayProceed:true.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   216
	LeaveSignal nameClass:self message:#leaveSignal.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   217
	LeaveSignal notifierString:'unhandled leave signal'.
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   218
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   219
	WindowGroupQuerySignal := QuerySignal new.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   220
	WindowGroupQuerySignal nameClass:self message:#windowGroupQuerySignal.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   221
	WindowGroupQuerySignal notifierString:'query for windowgroup'.
1111
13b350d13122 commentary
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   222
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   223
	LastEventQuerySignal := QuerySignal new.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   224
	LastEventQuerySignal nameClass:self message:#lastEventQuerySignal.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   225
	LastEventQuerySignal notifierString:'query for last event'.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   226
    ].
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   227
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   228
    "WindowGroup initialize"
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   229
1111
13b350d13122 commentary
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   230
    "Modified: 9.11.1996 / 17:00:53 / cg"
46
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   231
! !
7b331e9012fd *** empty log message ***
claus
parents: 28
diff changeset
   232
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   233
!WindowGroup class methodsFor:'instance creation'!
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   234
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   235
new
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   236
    "create and return a new WindowGroup object"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   237
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   238
    ^ self basicNew initialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   239
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   240
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   241
!WindowGroup class methodsFor:'Signal constants'!
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   242
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   243
lastEventQuerySignal
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   244
    "return the signal which is used to query for the last event"
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   245
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   246
    ^ LastEventQuerySignal
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   247
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   248
    "Created: 17.7.1996 / 20:36:04 / cg"
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   249
!
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   250
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   251
leaveSignal
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   252
    "return the signal which is used to exit a modal loop.
1752
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
   253
     This private signal, is always caught while a modalbox is active.
144
claus
parents: 141
diff changeset
   254
     Raising it will exit the modal loop and return from the views #openModal
claus
parents: 141
diff changeset
   255
     method."
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   256
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   257
    ^ LeaveSignal
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   258
!
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   259
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   260
windowGroupQuerySignal
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   261
    "return the signal which is used to query for the windowGroup"
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   262
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   263
    ^ WindowGroupQuerySignal
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   264
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   265
    "Created: 17.7.1996 / 20:36:04 / cg"
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   266
! !
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
   267
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
   268
!WindowGroup class methodsFor:'accessing'!
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   269
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   270
activeApplication
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   271
    "return the currently active application.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   272
     Notice: this may be a modal dialogs application - i.e. it is not
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   273
     always the main application."
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   274
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   275
    |activeGroup mainView|
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   276
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   277
    (activeGroup := self activeGroup) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   278
        (mainView := activeGroup mainView) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   279
            ^ mainView application
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   280
        ]
3173
1947c87324d5 oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   281
    ].
1947c87324d5 oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   282
    ^ nil
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   283
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   284
    "
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   285
     WindowGroup activeApplication 
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   286
    "
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   287
!
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   288
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   289
activeGroup
180
claus
parents: 172
diff changeset
   290
    "return the currently active windowGroup.
claus
parents: 172
diff changeset
   291
     The returned value may not be fully correct, in case the current process
1298
d070db2e4530 always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   292
     handles multiple windowGroups simultaneously. In this case, 
d070db2e4530 always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   293
     (usually) the first group is returned (prefering a modal if there is one). 
180
claus
parents: 172
diff changeset
   294
     (maybe we should return a collection of windowGroups here).
claus
parents: 172
diff changeset
   295
claus
parents: 172
diff changeset
   296
     This method is required to simulate the historic ST-80 single display
claus
parents: 172
diff changeset
   297
     behavior for Cursor>>show / Cursor>>showWhile and some others (raising the
claus
parents: 172
diff changeset
   298
     activeGroups topView when modalBoxes appear) on multiple display screens. 
claus
parents: 172
diff changeset
   299
     These methods should change the cursor for the currently 
claus
parents: 172
diff changeset
   300
     active windowGroup ONLY, instead of globally affecting the display or
claus
parents: 172
diff changeset
   301
     all views
claus
parents: 172
diff changeset
   302
     (since, depending on the priority, other views could be unaffacted by this 
claus
parents: 172
diff changeset
   303
      and an overall cursor change does not make sense.)"
claus
parents: 172
diff changeset
   304
claus
parents: 172
diff changeset
   305
    |activeProcess groups wg|
claus
parents: 172
diff changeset
   306
claus
parents: 172
diff changeset
   307
    Processor isNil ifTrue:[^ nil]. "/ only during very early init phase
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   308
180
claus
parents: 172
diff changeset
   309
    activeProcess := Processor activeProcess.
claus
parents: 172
diff changeset
   310
    " caching the last value ..."
565
6867f1a9a470 oops - leftover global LastActive
Claus Gittinger <cg@exept.de>
parents: 513
diff changeset
   311
    activeProcess == LastActiveProcess ifTrue:[
3212
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   312
        LastActiveGroup process == LastActiveProcess ifTrue:[
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   313
            ^ LastActiveGroup
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   314
        ]
180
claus
parents: 172
diff changeset
   315
    ].
1298
d070db2e4530 always handle a windowGroupQuery - use that first when being asked for a group
Claus Gittinger <cg@exept.de>
parents: 1273
diff changeset
   316
3212
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   317
    WindowGroupQuerySignal isNil ifTrue:[^ nil]. "/ only during very early init phase
2521
fe236fa74d5b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 2519
diff changeset
   318
    wg := WindowGroupQuerySignal query.
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   319
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   320
    wg isNil ifTrue:[
3212
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   321
        "/ mhmh - noone willing to answer that question ...
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   322
        "/ (how can this happen ?)
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   323
        groups := self scheduledWindowGroups 
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   324
                    select:[:wg | wg process == activeProcess].
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   325
        groups size == 1 ifTrue:[
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   326
            wg := groups anElement
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   327
        ] ifFalse:[
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   328
            wg := groups detect:[:wg | wg isModal] ifNone:nil.
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   329
            wg isNil ifTrue:[
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   330
                wg := groups anElement
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   331
            ]
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   332
        ].
956
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   333
    ].
32a642b5dcd3 when asking for the active windowGroup, ask the windowGroupQuerySignal
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   334
180
claus
parents: 172
diff changeset
   335
    wg notNil ifTrue:[
3212
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   336
        LastActiveProcess := activeProcess.
bdefd01df684 rel5 migration
Claus Gittinger <cg@exept.de>
parents: 3173
diff changeset
   337
        LastActiveGroup := wg.
180
claus
parents: 172
diff changeset
   338
    ].
claus
parents: 172
diff changeset
   339
    ^ wg
claus
parents: 172
diff changeset
   340
claus
parents: 172
diff changeset
   341
    "
claus
parents: 172
diff changeset
   342
     WindowGroup activeGroup 
claus
parents: 172
diff changeset
   343
    "
claus
parents: 172
diff changeset
   344
2089
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   345
    "Modified: / 3.9.1995 / 14:49:53 / claus"
07ed201c592e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
   346
    "Modified: / 17.4.1998 / 11:49:28 / cg"
2521
fe236fa74d5b Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 2519
diff changeset
   347
    "Modified: / 18.3.1999 / 18:30:33 / stefan"
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   348
!
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   349
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   350
activeMainApplication
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   351
    "return the currently active main application.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   352
     Notice: 
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   353
        if invoked by a modal application, this returns the main (non-modal)
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   354
        application."
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   355
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   356
    |activeGroup mainView|
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   357
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   358
    (activeGroup := self activeGroup) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   359
        (mainView := activeGroup mainGroup mainView) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   360
            ^ mainView application
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   361
        ]
3173
1947c87324d5 oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   362
    ].
1947c87324d5 oops - the active* queries should return nil sometimes
Claus Gittinger <cg@exept.de>
parents: 3172
diff changeset
   363
    ^ nil
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   364
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   365
    "
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   366
     WindowGroup activeMainApplication 
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   367
    "
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   368
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   369
!
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   370
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   371
scheduledWindowGroups
180
claus
parents: 172
diff changeset
   372
    "return a collection of all windowGroups (possibly for different
claus
parents: 172
diff changeset
   373
     display devices) which are scheduled (i.e. which have a process 
claus
parents: 172
diff changeset
   374
     running, handling events)."
claus
parents: 172
diff changeset
   375
claus
parents: 172
diff changeset
   376
    |set screens|
claus
parents: 172
diff changeset
   377
claus
parents: 172
diff changeset
   378
    screens := Screen allScreens.
1869
24813440013f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   379
    screens size == 0 ifTrue:[^ #()].
180
claus
parents: 172
diff changeset
   380
claus
parents: 172
diff changeset
   381
    set := IdentitySet new.
claus
parents: 172
diff changeset
   382
    screens do:[:aDevice |
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   383
	aDevice allViewsDo:[:aView |
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   384
	    |wg|
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   385
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   386
	    (wg := aView windowGroup) notNil ifTrue:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   387
		wg process notNil ifTrue:[
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   388
		    set add:wg
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   389
		]
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   390
	    ].
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   391
	].
180
claus
parents: 172
diff changeset
   392
    ].
claus
parents: 172
diff changeset
   393
    ^ set asArray
claus
parents: 172
diff changeset
   394
claus
parents: 172
diff changeset
   395
    "
claus
parents: 172
diff changeset
   396
     WindowGroup scheduledWindowGroups   
claus
parents: 172
diff changeset
   397
    "
claus
parents: 172
diff changeset
   398
claus
parents: 172
diff changeset
   399
    "Modified: 1.9.1995 / 13:43:09 / claus"
1869
24813440013f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   400
    "Modified: 18.8.1997 / 18:44:29 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   401
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   402
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   403
setActiveGroup:aGroup
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   404
    "set the currently active windowGroup.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   405
     Temporary; do not use this interface, it will vanish."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   406
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   407
    LastActiveProcess := Processor activeProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   408
    LastActiveGroup := aGroup
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   409
! !
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   410
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   411
!WindowGroup class methodsFor:'focus control support'!
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   412
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   413
takeFocusFromDevice:aDevice
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   414
    |prevFocusView prevFocusGroup prevFocusCameViaTab sensor|
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   415
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   416
    "/
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   417
    "/ take the focus from whichEver view had it previously
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   418
    "/
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   419
    prevFocusView := aDevice focusView.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   420
    prevFocusView notNil ifTrue:[
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   421
        (prevFocusView notNil
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   422
        and:[(prevFocusGroup := prevFocusView windowGroup) notNil]) ifTrue:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   423
            prevFocusCameViaTab := prevFocusGroup focusCameByTab.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   424
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   425
            prevFocusView showNoFocus:prevFocusCameViaTab. "/ true is bad - see pullDownMenu.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   426
            self sendKeyboardFocusEventTo:prevFocusView withArgument:false.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   427
        ].
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   428
    ].
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   429
    aDevice focusView:nil.
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   430
! !
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   431
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   432
!WindowGroup class methodsFor:'others'!
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   433
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   434
sendKeyboardFocusEventTo:aView withArgument:arg
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   435
    |sensor ev|
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   436
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   437
    aView isNil ifTrue:[^ self].
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   438
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   439
    (sensor := aView sensor) notNil ifTrue:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   440
        ev := WindowEvent::KeyboardFocusEvent    
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   441
                              for:aView type:#hasKeyboardFocus: arguments:(Array with:arg).
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   442
        sensor notifyEventListenersAbout:ev.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   443
        sensor pushEvent:ev.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   444
    ] ifFalse:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   445
        aView hasKeyboardFocus:arg
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   446
    ].
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   447
! !
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
   448
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   449
!WindowGroup methodsFor:'accessing'!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   450
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   451
device
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   452
    "return the device, we receive our events from"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   453
3436
0c0c8b88b669 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 3400
diff changeset
   454
    <resource:#obsolete>
0c0c8b88b669 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 3400
diff changeset
   455
926
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   456
    self obsoleteMethodWarning:'use #graphicsDevice'.
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   457
    ^ self graphicsDevice
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   458
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   459
    "Modified: 5.7.1996 / 17:53:58 / cg"
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   460
!
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   461
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   462
graphicsDevice
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   463
    "return the device, we receive our events from"
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   464
1311
0746d3fe9a62 changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   465
    |dev|
0746d3fe9a62 changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   466
2857
b9bff260f854 cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   467
    graphicsDevice notNil ifTrue:[^ graphicsDevice].
b9bff260f854 cache graphicsDevice - its called often
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   468
1311
0746d3fe9a62 changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   469
    topViews notNil ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   470
	topViews do:[:v |
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   471
	    |app|
1116
c04e4739b42c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1111
diff changeset
   472
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   473
	    v notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   474
		(app := v application) notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   475
		    "/
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   476
		    "/ ok, it has an application;
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   477
		    "/ ask it for preferences.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   478
		    "/
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   479
		    (dev := app graphicsDevice) notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   480
			^ (graphicsDevice := dev)
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   481
		    ]
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   482
		].
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   483
		(dev := v graphicsDevice) notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   484
		    ^ (graphicsDevice := dev)
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   485
		]
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   486
	    ]
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   487
	]
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   488
    ].
1311
0746d3fe9a62 changed (fixed ?) graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   489
    views notNil ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   490
	views do:[:v |
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   491
	    v notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   492
		(dev := v graphicsDevice) notNil ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   493
		    ^ (graphicsDevice := dev)
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   494
		]
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   495
	    ]
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   496
	]
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   497
    ].
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   498
    "/ ask the previousGroup; I could be a popUp-views group,
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   499
    "/ which has already closed its views (and is performing its action)
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   500
    previousGroup notNil ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
   501
	^ previousGroup graphicsDevice
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   502
    ].
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   503
    ^ nil
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   504
2170
44b86a4cc0d5 in #graphicsDevice: if there are no views, ask previousGroup if there is one.
Claus Gittinger <cg@exept.de>
parents: 2168
diff changeset
   505
    "Modified: / 9.7.1998 / 18:18:08 / cg"
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   506
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   507
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   508
isModal
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   509
    "return true, if the receiver is in a modal mode
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   510
     (i.e. for a modal box)"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   511
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   512
    ^ isModal
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   513
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   514
    "Modified: 7.3.1996 / 14:29:46 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   515
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   516
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   517
isPopUp
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   518
    "return true, if the receiver is for a popUp view"
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   519
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   520
    isModal ifFalse:[^ false].
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   521
    topViews isNil ifTrue:[^ true]. "/ a closed popup ...
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   522
    ^ topViews first isPopUpView
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   523
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   524
    "Created: / 9.7.1998 / 01:13:01 / cg"
3373
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
   525
    "Modified: / 9.7.1998 / 01:17:11 / cg"
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
   526
!
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
   527
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   528
mainGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   529
    "return the main windowgroup (for modal groups only) 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   530
     that is the top one, which is not modal.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   531
     NonModal groups return themSelf.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   532
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   533
     There is one exception to this: the debugger (which is sort of modal)
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   534
     returns itself as mainGroup (not its debuggee)."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   535
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   536
    |g prev|
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   537
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   538
    g := self.
3354
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   539
    [g notNil 
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   540
     and:[(g isModal or:[g isPopUp])
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   541
     and:[(prev := g previousGroup) notNil]]] whileTrue:[
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   542
        g := prev
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   543
    ].
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   544
    ^ g
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   545
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   546
    "Modified: 3.9.1995 / 14:57:20 / claus"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   547
    "Modified: 7.3.1996 / 14:29:28 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   548
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   549
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   550
mainGroup:aWindowGroup
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   551
    "set the main windowgroup (for modal/autonomous groups only) 
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   552
     Exposeevents for that windowGroup will be handled by this group
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   553
     as well."
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   554
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   555
    previousGroup := aWindowGroup
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   556
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   557
    "Created: 20.8.1997 / 17:57:35 / cg"
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   558
!
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   559
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   560
previousGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   561
    "return the windowgroup that started this group. (for modal groups only).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   562
     This may be another modalGroup (for boxes opened by boxes).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   563
     NonModal groups return nil."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   564
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   565
    ^ previousGroup
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   566
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   567
    "Modified: 7.3.1996 / 14:28:46 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   568
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   569
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   570
process 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   571
    "return the windowGroups process"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   572
2250
281f9fafdbe0 follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents: 2221
diff changeset
   573
    myProcess isNil ifTrue:[
2363
e456e5040a57 care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents: 2353
diff changeset
   574
	previousGroup notNil ifTrue:[
e456e5040a57 care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents: 2353
diff changeset
   575
	    ^ previousGroup process
e456e5040a57 care for homeless (non-top) views when assigning the focus
Claus Gittinger <cg@exept.de>
parents: 2353
diff changeset
   576
	]
2250
281f9fafdbe0 follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents: 2221
diff changeset
   577
    ].
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   578
    ^ myProcess
2250
281f9fafdbe0 follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents: 2221
diff changeset
   579
281f9fafdbe0 follow parentGroup in #process-query
Claus Gittinger <cg@exept.de>
parents: 2221
diff changeset
   580
    "Modified: / 17.8.1998 / 10:21:29 / cg"
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   581
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   582
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   583
sensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   584
    "return the windowGroups sensor.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   585
     All events for any of the groups views is handled by that sensor."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   586
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   587
    ^ mySensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   588
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   589
    "Modified: 7.3.1996 / 14:30:21 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   590
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   591
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   592
sensor:aSensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   593
    "set the windowGroups sensor"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   594
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   595
    mySensor := aSensor
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   596
! !
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   597
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   598
!WindowGroup methodsFor:'accessing-hooks'!
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   599
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   600
busyHook 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   601
    "return the busyHook if any"
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   602
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   603
    ^ busyHook
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   604
!
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   605
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   606
busyHook:anObject 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   607
    "set the busyHook - this one will be invoked when the event-handling action
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   608
     takes some time."
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   609
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   610
    busyHook := anObject
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   611
!
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   612
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   613
busyHookTimeout
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   614
    "return the busyHooks timeout if any"
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   615
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   616
    ^ busyHookTimeout
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   617
!
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   618
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   619
busyHookTimeout:anObject 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   620
    "set the busyHooks timeout - the busyHook will be invoked when the event-handling action
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   621
     takes longer than this time."
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   622
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   623
    busyHookTimeout := anObject
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
   624
!
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   625
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   626
postEventHook 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   627
    "return the postEventHook if any"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   628
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   629
    ^ postEventHook
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   630
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   631
    "Created: 7.3.1996 / 14:42:46 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   632
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   633
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   634
postEventHook:anObject 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   635
    "set the postEventHook - this one will get all events
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   636
     passed after being processed here (via #processEvent:)."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   637
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   638
    postEventHook := anObject
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   639
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   640
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   641
preEventHook 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   642
    "return the preEventHook if any"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   643
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   644
    ^ preEventHook
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   645
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   646
    "Created: 7.3.1996 / 14:42:42 / cg"
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   647
!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   648
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   649
preEventHook:anObject 
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   650
    "set the preEventHook - this one will get all events
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   651
     passed before being processed here (via #processEvent:).
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   652
     If this returns true, the event is supposed to be already
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   653
     processed and ignored here.
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   654
     Otherwise, it is processed as usual."
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   655
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   656
    preEventHook := anObject
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   657
!
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   658
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   659
showWaitCursorWhenBusyForMillis:millis
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   660
    "setup a busyHook, which automatically shows a waitCursor, 
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   661
     whenever some action takes longer than millis"
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   662
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
   663
    self busyHookTimeout:millis.
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   664
    self 
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   665
        busyHook:[:isBusy | 
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   666
            isBusy ifTrue:[
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   667
                self showCursor:(Cursor wait).
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   668
            ] ifFalse:[
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   669
                self restoreCursors
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   670
            ]
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   671
        ].
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
   672
512
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   673
! !
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   674
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   675
!WindowGroup methodsFor:'accessing-views'!
e8bc1216a254 commentary & hook access
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   676
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   677
addTopView:aView
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   678
    "add a topview to the group"
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   679
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   680
    topViews isNil ifTrue:[
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   681
	topViews := OrderedCollection with:aView.
2445
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   682
    ] ifFalse:[
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   683
	(topViews includesIdentical:aView) ifFalse:[
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   684
	    topViews add:aView
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   685
	]
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   686
    ]
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   687
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
   688
    "Modified: 6.3.1996 / 15:35:15 / cg"
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   689
!
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   690
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   691
addView:aView
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   692
    "add aView to the windowGroup"
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   693
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   694
    views isNil ifTrue:[
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   695
        views := OrderedCollection with:aView.
2445
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   696
    ] ifFalse:[
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   697
        (views includesIdentical:aView) ifFalse:[
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   698
            views add:aView
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   699
        ]
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
   700
    ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   701
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   702
2445
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   703
mainView
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   704
    "return the mainview. Thats the first topView by default"
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   705
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   706
    topViews size == 0 ifTrue:[ ^ nil].
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   707
    ^ topViews first
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   708
!
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   709
26
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   710
removeView:aView
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   711
    "remove aView from the windowGroup;
ac9f66dc8f53 *** empty log message ***
claus
parents: 23
diff changeset
   712
     if this was the last view in this group, 
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   713
     also shut down the corresponding process 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   714
     (actually, only wake it up here - it will terminate itself 
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   715
      when finding out that all views are gone)"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   716
263
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   717
    |sema|
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   718
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
   719
    focusView == aView ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
   720
        focusView := nil
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
   721
    ].
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   722
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   723
    views notNil ifTrue:[
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   724
        views removeIdentical:aView ifAbsent:nil.
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   725
        views isEmpty ifTrue:[
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   726
            views := nil
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   727
        ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   728
    ].
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   729
    topViews notNil ifTrue:[
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   730
        topViews removeIdentical:aView ifAbsent:nil.
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   731
        topViews isEmpty ifTrue:[
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   732
            topViews := nil
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   733
        ]
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   734
    ].
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   735
    "
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   736
     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
   737
     removed (modalBoxes terminate their modalLoop if so)
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   738
    "
262
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   739
    mySensor notNil ifTrue:[
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   740
        (sema := mySensor eventSemaphore) notNil ifTrue:[
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   741
            sema signal
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
   742
        ]
262
546f42586e3c only signal sema if there is one (when views are removed)
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   743
    ]
1304
d914bfc99b49 use #removeIdentical
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
   744
d914bfc99b49 use #removeIdentical
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
   745
    "Modified: 1.2.1997 / 12:13:26 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   746
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
   747
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   748
topViews
2445
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   749
    "return the topviews associated to this windowGroup"
172
claus
parents: 162
diff changeset
   750
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   751
    ^ topViews
172
claus
parents: 162
diff changeset
   752
!
claus
parents: 162
diff changeset
   753
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   754
views
2445
a51931237c01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
   755
    "return the views associated to this windowGroup"
172
claus
parents: 162
diff changeset
   756
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   757
    ^ views
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   758
! !
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
   759
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   760
!WindowGroup methodsFor:'activation / deactivation'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   761
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   762
closeDownViews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   763
    "destroy all views associated to this window group"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   764
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   765
    topViews notNil ifTrue:[
3130
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   766
        topViews copy do:[:aTopView | 
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   767
            aTopView notNil ifTrue:[
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   768
                aTopView destroy
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   769
            ]
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   770
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   771
    ].
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   772
    views := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   773
    topViews := nil.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   774
    mySensor := nil.
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   775
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   776
    "Modified: / 6.5.1999 / 09:47:18 / cg"
3130
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   777
d489adbd1fd2 enumerate a copy of the collection, when closing down views
Claus Gittinger <cg@exept.de>
parents: 3103
diff changeset
   778
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   779
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   780
3286
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   781
modalDialogFinished
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   782
    "invoked, when a modal dialog is closed"
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   783
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   784
    inModalLoop := false.
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   785
!
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   786
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   787
modalDialogStarts
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   788
    "invoked, when a modal dialog is opened"
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   789
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   790
    inModalLoop := true.
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   791
!
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
   792
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   793
realizeTopViews
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   794
    "realize all topViews associated to this windowGroup."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   795
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   796
    topViews notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   797
	topViews do:[:aView |
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   798
	    aView realize.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   799
	].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   800
    ].
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   801
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   802
    "Created: 24.7.1997 / 12:56:09 / cg"
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   803
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   804
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   805
restart
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   806
    "restart after a snapin.
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   807
     This re-creates the windowGroup process and informs
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   808
     my views."
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   809
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   810
    topViews notNil ifTrue:[
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   811
	"
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   812
	 need a new semaphore, since obsolete processes 
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   813
	 (from our previous live) may still sit on the current semaphore
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   814
	"
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   815
	mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema').
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   816
	isModal ifFalse:[
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   817
	    self startupWith:[self restartTopViews].
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   818
	]
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   819
    ]
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   820
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   821
    "Modified: / 6.5.1999 / 09:46:08 / cg"
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   822
!
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   823
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   824
restartTopViews
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   825
    "inform all topViews associated to this windowGroup.
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   826
     about the restart."
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   827
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   828
    topViews notNil ifTrue:[
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   829
	topViews do:[:aView |
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   830
	    aView isPopUpView ifFalse:[
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   831
"/                aView realize.
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   832
		aView restarted
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   833
	    ].
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
   834
	].
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   835
    ].
180
claus
parents: 172
diff changeset
   836
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   837
    "Modified: / 6.5.1999 / 09:42:37 / cg"
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   838
    "Created: / 6.5.1999 / 09:46:33 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   839
!
180
claus
parents: 172
diff changeset
   840
582
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   841
shutDown
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   842
    "shutdown the window group; close all views and
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   843
     terminate the process"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   844
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   845
    |p|
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   846
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   847
    self closeDownViews.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   848
    myProcess notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   849
	p := myProcess.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   850
	myProcess := nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
   851
	p terminate.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   852
    ]
582
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   853
dbb1d19a1065 obsolete shutdown (use shutDown)
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
   854
    "Created: 22.4.1996 / 17:58:37 / cg"
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   855
    "Modified: 8.2.1997 / 16:46:31 / cg"
180
claus
parents: 172
diff changeset
   856
!
claus
parents: 172
diff changeset
   857
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   858
startupModal:checkBlock
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   859
    "startup the window-group in a modal loop 
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   860
     (i.e. under the currently running process);
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   861
     checkBlock is evaluated and the modal loop is left, 
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   862
     whenever false is returned."
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   863
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   864
    ^ self startupModal:checkBlock forGroup:(WindowGroup activeGroup).
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   865
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   866
    "Created: 10.12.1995 / 14:15:11 / cg"
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   867
    "Modified: 20.8.1997 / 17:54:33 / cg"
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   868
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   869
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   870
startupModal:checkBlock forGroup:mainGroup
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   871
    "startup the window-group in a modal loop 
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   872
     (i.e. under the currently running process);
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   873
     checkBlock is evaluated and loop is left, when false is
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   874
     returned.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   875
     The mainGroup info is required to allow peeking into its
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   876
     event queue in order for its expose/redraws to be handled."
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   877
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   878
    |prevActiveKeyboardGrab prevActivePointerGrab prevFocus device tops prevGroup|
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   879
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   880
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   881
    "set previousGroup to the main (non-modal) group"
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   882
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   883
    previousGroup isNil ifTrue:[previousGroup := mainGroup].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   884
    prevGroup := previousGroup.
3354
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   885
    prevGroup notNil ifTrue:[
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   886
        "/ remember current grab, in case I am opened by
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   887
        "/ a popup (such as an extendedComboBox) ...
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   888
        device := prevGroup graphicsDevice.
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   889
        prevActiveKeyboardGrab := device activeKeyboardGrab.
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   890
        prevActivePointerGrab := device activePointerGrab.
9c5bc350dec4 application fetch fix
Claus Gittinger <cg@exept.de>
parents: 3352
diff changeset
   891
    ].
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   892
    isModal := true.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   893
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   894
    mainGroup notNil ifTrue:[
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   895
        "/ tell the other group, that some modal dialog has started.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   896
        mainGroup modalDialogStarts
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   897
    ].
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   898
3352
47697e8eb891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
   899
    previousGroup notNil ifTrue:[
47697e8eb891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
   900
        prevFocus := previousGroup focusView.
47697e8eb891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
   901
    ].
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   902
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   903
    WindowGroupQuerySignal handle:[:ex |
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   904
        ex proceedWith:self
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   905
    ] do:[
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   906
        self realizeTopViews.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   907
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   908
        self 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   909
            eventLoopWhile:checkBlock 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   910
            onLeave:[
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   911
                "
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   912
                 cleanup, in case of a terminate
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   913
                "
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   914
                previousGroup := nil.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   915
                topViews := nil.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   916
                views := nil.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   917
                "
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   918
                 the following is rubbish;
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   919
                 the views could be reused ..
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   920
                "
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   921
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   922
"/                topViews notNil ifTrue:[
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   923
"/                    topViews do:[:aView |
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   924
"/                        aView destroy
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   925
"/                    ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   926
"/                    topViews := nil.
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   927
"/                ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   928
"/                views notNil ifTrue:[
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   929
"/                    views do:[:aView |
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   930
"/                        aView destroy
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   931
"/                    ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   932
"/                    views := nil.
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   933
"/                ].
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   934
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   935
        ]
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   936
    ].
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   937
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   938
    "/ restore current grab, in case was opened by
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   939
    "/ a popup (such as an extendedComboBox) ...
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   940
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   941
    mainGroup notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   942
        (prevGroup isModal or:[prevGroup isPopUp]) ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   943
            "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   944
             return input focus to previously active groups top.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   945
            "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   946
            tops := mainGroup topViews.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   947
            (tops notNil and:[tops notEmpty]) ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   948
                tops first getKeyboardFocus.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   949
            ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   950
        ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   951
    ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   952
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   953
    prevActivePointerGrab notNil ifTrue:[ device grabPointerInView:prevActivePointerGrab ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   954
    prevActiveKeyboardGrab notNil ifTrue:[ device grabKeyboardInView:prevActiveKeyboardGrab ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   955
    prevFocus notNil ifTrue:[ prevFocus requestFocus ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
   956
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   957
    mainGroup notNil ifTrue:[
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   958
        "/ tell the other group, that some modal dialog has closed down.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   959
        mainGroup modalDialogFinished
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   960
    ]
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   961
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   962
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   963
    "Created: 10.12.1995 / 14:14:26 / cg"
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   964
    "Modified: 20.8.1997 / 18:12:20 / cg"
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   965
!
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   966
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   967
startupWith:startupAction
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   968
    "startup the window-group;
1822
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   969
     this creates a new window group process, which does the event processing.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   970
     The startupAction arg is evaluated by the windowGroup process,
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   971
     before the eventLoop is entered, and is used to realize any views.
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   972
     [this is done to have the new process realize its views, instead of
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   973
      the caller - which may make a difference in case of errors and/or
38f24dca2eb2 changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
   974
      blocking operations ...]"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   975
2958
128f33a77fb1 added a hook to allow interception of new-sub-application
ca
parents: 2957
diff changeset
   976
    |top nm dev devNm invokingApp|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   977
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   978
    previousGroup := nil.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   979
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   980
    myProcess isNil ifTrue:[
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   981
        isModal := false.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
   982
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   983
        "/
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   984
        "/ this is the windowGroup process;
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   985
        "/ realize all views, then handle events forever
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   986
        "/ (well, not really forever ... ;-)
2878
477c46142b9f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2870
diff changeset
   987
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   988
        myProcess := [
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   989
            WindowGroupQuerySignal handle:[:ex |
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   990
                ex proceedWith:self
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   991
            ] do:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   992
                [
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   993
                    startupAction value.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   994
                    self eventLoopWhile:[true] onLeave:[]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   995
                ] valueNowOrOnUnwindDo:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   996
                    |dev|
180
claus
parents: 172
diff changeset
   997
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   998
                    (dev := self graphicsDevice) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
   999
                        dev deviceIOErrorSignal handle:[:ex |
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1000
                        ] do:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1001
                            self closeDownViews
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1002
                        ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1003
                    ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1004
                ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1005
            ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1006
        ] newProcess.
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1007
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1008
        (topViews size > 0) ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1009
            "/
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1010
            "/ give the windowGroup process a user friendly name
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1011
            "/ ask its topView for the processName, and
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1012
            "/ optionally append the displayName (if its not the default)
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1013
            "/
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1014
            top := topViews first.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1015
            nm := top processName.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1016
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1017
            (dev := top graphicsDevice) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1018
                devNm := dev displayName.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1019
                (devNm notNil and:[Display isNil or:[devNm ~= Display displayName]]) ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1020
                    nm := nm , ' (' , devNm , ')'
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1021
                ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1022
            ]
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1023
        ] ifFalse:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1024
            nm := 'window handler'.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1025
        ].
3341
222b9d88fb04 Fix comment
Stefan Vogel <sv@exept.de>
parents: 3335
diff changeset
  1026
        myProcess name:nm;
222b9d88fb04 Fix comment
Stefan Vogel <sv@exept.de>
parents: 3335
diff changeset
  1027
                  priority:(Processor userSchedulingPriority);
222b9d88fb04 Fix comment
Stefan Vogel <sv@exept.de>
parents: 3335
diff changeset
  1028
                  beGroupLeader;
222b9d88fb04 Fix comment
Stefan Vogel <sv@exept.de>
parents: 3335
diff changeset
  1029
                  beGUIProcess.
180
claus
parents: 172
diff changeset
  1030
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1031
        "/
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1032
        "/ when the process gets suspended, 
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1033
        "/ there maybe still buffered draw requests.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1034
        "/ Arrange for them to be flushed then.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1035
        "/ (otherwise, you would not see the output of a process,
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1036
        "/  which suspends and waits - or we had to add buffer flushes
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1037
        "/  all over the place)
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1038
        "/
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1039
        myProcess addSuspendAction:[ 
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1040
            |dev|
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  1041
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1042
            dev := self graphicsDevice.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1043
            dev notNil ifTrue:[dev flush].
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1044
        ].
2851
c43fdd39d2e5 startupWith:startupAction
Claus Gittinger <cg@exept.de>
parents: 2815
diff changeset
  1045
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1046
        "/ allow for the currently active application,
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1047
        "/ to hook on new-application process creation.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1048
        (invokingApp := WindowGroup activeMainApplication) notNil ifTrue:[
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1049
            invokingApp postApplicationProcessCreate:myProcess windowGroup:self.
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1050
        ].
2959
a7969f737425 care for mainGroup/view/app being nil before accessing
ca
parents: 2958
diff changeset
  1051
3172
9dbb035935b6 Define #activeApplication and #activeMainApplication (cg)
Stefan Vogel <sv@exept.de>
parents: 3156
diff changeset
  1052
        myProcess resume.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1053
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1054
1965
765f9e696b42 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  1055
    "Modified: / 13.12.1995 / 14:04:53 / stefan"
765f9e696b42 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1946
diff changeset
  1056
    "Created: / 24.7.1997 / 12:52:04 / cg"
3373
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1057
    "Modified: / 4.12.1997 / 14:13:35 / cg"
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1058
! !
180
claus
parents: 172
diff changeset
  1059
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1060
!WindowGroup methodsFor:'enumerating'!
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
  1061
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1062
allNonTopViewsDo:aBlock
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1063
    "evaluate aBlock for all nonTopviews (i.e. subviews) in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1064
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1065
     destroy and other collection changing operations to be performed in the loop."
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1066
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1067
    views notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1068
	views copy nonNilElementsDo:aBlock
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1069
    ]
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1070
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1071
    "Modified: 12.2.1997 / 12:20:25 / cg"
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1072
!
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1073
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1074
allTopViewsDo:aBlock
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1075
    "evaluate aBlock for all topviews in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1076
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1077
     destroy and other collection changing operations to be performed in the loop."
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1078
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1079
    topViews notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1080
	topViews copy nonNilElementsDo:aBlock
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1081
    ]
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1082
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1083
    "Modified: 12.2.1997 / 12:20:30 / cg"
1153
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1084
!
9a10a934c137 commentary
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  1085
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
  1086
allTopViewsExcept:aView do:aBlock
157
claus
parents: 152
diff changeset
  1087
    "evaluate aBlock for all topviews except aView in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1088
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1089
     destroy and other collection changing operations to be performed in the loop."
157
claus
parents: 152
diff changeset
  1090
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1091
    self allTopViewsDo:[:v |
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1092
	v ~~ aView ifTrue:[aBlock value:v]
157
claus
parents: 152
diff changeset
  1093
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1094
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1095
    "Modified: 12.2.1997 / 12:22:10 / cg"
157
claus
parents: 152
diff changeset
  1096
!
claus
parents: 152
diff changeset
  1097
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1098
allViewsDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1099
    "evaluate aBlock for all views & topviews in this group.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1100
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1101
     destroy and other collection changing operations to be performed in the loop."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1102
1117
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1103
    self allTopViewsDo:aBlock.
a4eb82737146 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  1104
    self allNonTopViewsDo:aBlock.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1105
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1106
    "Modified: 12.2.1997 / 12:20:20 / cg"
244
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
partnersDo:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1110
    "evaluate aBlock for all partnerViews.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1111
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1112
     destroy and other collection changing operations to be performed in the loop."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1113
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1114
    self allTopViewsDo:[:v |
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1115
	(v type == #partner) ifTrue:[aBlock value:v].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1116
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1117
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1118
    "Modified: 12.2.1997 / 12:21:41 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1119
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1120
157
claus
parents: 152
diff changeset
  1121
slavesDo:aBlock
claus
parents: 152
diff changeset
  1122
    "evaluate aBlock for all slaveViews.
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1123
     This enumerates a copy of the view collection, to allow for
1240
1dc8c6d791fd comment
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  1124
     destroy and other collection changing operations to be performed in the loop."
54
29a6b2f8e042 *** empty log message ***
claus
parents: 48
diff changeset
  1125
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1126
    self allTopViewsDo:[:v |
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1127
	(v type == #slave) ifTrue:[aBlock value:v].
157
claus
parents: 152
diff changeset
  1128
    ].
1334
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1129
4d1065c38970 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1130
    "Modified: 12.2.1997 / 12:21:46 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1131
! !
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1132
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1133
!WindowGroup methodsFor:'event debugging'!
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1134
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1135
traceEvents:trueOrFalse
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1136
    |hook|
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1137
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1138
    trueOrFalse ifFalse:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1139
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1140
	"/ remove any eventHook on the receiver
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1141
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1142
	self preEventHook:nil.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1143
	"/ Transcript showCR:'removed eventHook'.
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1144
    ] ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1145
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1146
	"/ set an eventHook on its windowGroup
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1147
	"/
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1148
	hook := Plug new.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1149
	hook respondTo:#processEvent:
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1150
		  with:[:ev | ev displayString printCR. false].
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1151
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1152
	self preEventHook:hook.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  1153
	"/ Transcript showCR:'set eventHook for tracing'.
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1154
    ]
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1155
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1156
    "Created: 24.4.1996 / 10:25:21 / cg"
698
3be775ccac3c printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 697
diff changeset
  1157
    "Modified: 20.5.1996 / 10:30:00 / cg"
605
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1158
! !
20f960026796 convenient interface for eventTracing ; comments & docu
Claus Gittinger <cg@exept.de>
parents: 598
diff changeset
  1159
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1160
!WindowGroup methodsFor:'event handling'!
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1161
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1162
eventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1163
    "loop executed by windowGroup process;
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1164
     wait-for and process events forever"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1165
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1166
   self eventLoopWhile:[true] onLeave:[]
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1167
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1168
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1169
eventLoopWhile:aBlock onLeave:cleanupActions
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1170
    "wait-for and process events.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1171
     Stay in this loop while there are still any views to dispatch for,
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1172
     and aBlock evaluates to true.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1173
1752
Claus Gittinger <cg@exept.de>
parents: 1652
diff changeset
  1174
     Some signals are caught & handled: 
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1175
        LeaveSignal forces an exit from the eventLoop;
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1176
        AbortSignal brings us back into the loop, processing the next event;
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1177
        ActivityNotifications send a #showActivity: if nonModal, 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1178
        otherwise they are ignored."
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1179
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1180
    |thisProcess sigs mainSema prevSema|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1181
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1182
    thisProcess := Processor activeProcess.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1183
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1184
    sigs := SignalSet 
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1185
                with:AbortSignal 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1186
                with:LeaveSignal 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1187
                with:(self class activityNotificationSignal).
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1188
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1189
    [
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1190
        |p g s mainGroup mySema waitSema groupForSema|
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1191
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1192
        waitSema := mySema := mySensor eventSemaphore.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1193
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1194
        isModal ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1195
            mainGroup := self mainGroup.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1196
            mainGroup == self ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1197
                mainGroup := nil
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1198
            ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1199
        ] ifFalse:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1200
            mainGroup := previousGroup
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1201
        ].
1876
6b5a5931a2b9 allow autonomous windowGroup processes to
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1202
        
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1203
        mainGroup notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1204
            mainSema := mainGroup sensor eventSemaphore.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1205
            waitSema := SemaphoreSet with:mySema with:mainSema.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1206
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1207
            "/ must also care for all other groups in between
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1208
            "/ (in case its a modal dialog opened from a modal dialog)
2168
83571b3cde37 fixed modal group handling when started from another modal group
Claus Gittinger <cg@exept.de>
parents: 2154
diff changeset
  1209
        
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1210
            g := previousGroup.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1211
            g ~~ mainGroup ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1212
                groupForSema := IdentityDictionary new.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1213
                [g ~~ mainGroup] whileTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1214
                    s := g sensor eventSemaphore.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1215
                    waitSema add:s.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1216
                    groupForSema at:s put:g.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1217
                    g := g previousGroup.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1218
                ]
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1219
            ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1220
        ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1221
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1222
        [aBlock value] whileTrue:[ 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1223
            LastActiveGroup := self.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1224
            LastActiveProcess := thisProcess.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1225
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1226
            (views isNil and:[topViews isNil]) ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1227
                myProcess notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1228
                    p := myProcess.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1229
                    myProcess := nil.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1230
                    p terminate.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1231
                    "not reached - there is no life after death"
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1232
                ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1233
                "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1234
                 this is the end of a modal loop
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1235
                 (not having a private process ...)
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1236
                "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1237
                ^ self
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1238
            ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1239
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1240
            sigs handle:[:ex |
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1241
                |theSig|
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1242
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1243
                (theSig := ex signal) == AbortSignal ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1244
                    "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1245
                    "/ on abort, stay in loop
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1246
                    "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1247
                    ex return
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1248
                ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1249
                theSig == LeaveSignal ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1250
                    "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1251
                    "/ on leave, exit the event loop
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1252
                    "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1253
                    ^ self
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1254
                ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1255
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1256
                "/ ActivityNotification
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1257
                "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1258
                "/ if I am a modal-group, let it be handled
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1259
                "/ by the outer main-groups handler
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1260
                "/ otherwise show the activityMessage and continue.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1261
                "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1262
                isModal ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1263
                    ex reject
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1264
                    "never reached"
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1265
                ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1266
                self showActivity:(ex errorString).
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1267
                ex proceedWith:nil.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1268
            ] do:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1269
                |dev gotSema mainView|
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1270
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1271
                (mainGroup notNil or:[mySensor hasEvents not]) ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1272
                    "/ now, wait for an event to arrive
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1273
                    waitSema isNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1274
                        "/ oops - how can this happen ....
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1275
                        ^ self.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1276
                    ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1277
                    "/ Flush device output before going to sleep. 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1278
                    "/ This may produce more events to arrive.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1279
                    "/ Q: is this still needed (see suspendAction) ?
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1280
                    self graphicsDevice flush.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1281
                    thisProcess setStateTo:#eventWait if:#active.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1282
                    gotSema := waitSema wait.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1283
                ] ifFalse:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1284
                    gotSema := mySema
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1285
                ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1286
                LastActiveGroup := self.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1287
                LastActiveProcess := thisProcess.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1288
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1289
                "/ some bad guy ;-) could have closed all down
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1290
                "/ in the meanwhile ...
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1291
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1292
                mySensor notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1293
                    gotSema == mySema ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1294
                        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1295
                        "/ an event for me 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1296
                        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1297
                        self processEventsWithModalGroup:nil
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1298
                    ] ifFalse:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1299
                        groupForSema notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1300
                            g := groupForSema at:gotSema ifAbsent:nil.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1301
                            g := g ? mainGroup.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1302
                        ] ifFalse:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1303
                            g := mainGroup
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1304
                        ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1305
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1306
                        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1307
                        "/ an event for my mainGroup 
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1308
                        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1309
                        g topViews notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1310
                            mainView := g topViews first
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1311
                        ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1312
                        mainView notNil ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1313
                            "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1314
                            "/ if anything happened to the mainGroup
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1315
                            "/ bring my own topView back to the front
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1316
                            "/ This keeps modalBoxes visible
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1317
                            "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1318
                            (g sensor hasConfigureEventFor:mainView) ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1319
                                topViews size > 0 ifTrue:[
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1320
                                    topViews first raiseDeiconified
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1321
                                ]
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1322
                            ]
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1323
                        ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1324
                        "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1325
                         if modal, also check for redraw events in my maingroup
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1326
                         (we arrive here after we woke up on maingroup sensor eventSemaphore)
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1327
                        "
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1328
                        g processEventsWithModalGroup:self.
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1329
                    ]
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1330
                ]
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1331
            ].
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1332
        ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1333
    ] valueNowOrOnUnwindDo:[
3348
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1334
        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1335
        "/ perform any cleanupActions
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1336
        "/
7049f1baa6de remember focus and grab, when starting a modal loop;
ca
parents: 3341
diff changeset
  1337
        cleanupActions notNil ifTrue:[cleanupActions value]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1338
    ]
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  1339
2116
b389262e58b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2097
diff changeset
  1340
    "Modified: / 14.12.1995 / 11:12:24 / stefan"
3373
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1341
    "Modified: / 5.2.1999 / 22:32:07 / cg"
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1342
!
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1343
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1344
leaveEventLoop
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1345
    "immediately leave the event loop, returning way back.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1346
     This can be used to leave (and closedown) a modal group.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1347
     (for normal views, this does not make sense)"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1348
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1349
    ^ LeaveSignal raise
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1350
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1351
103
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1352
processEvents
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1353
    "process events from either the damage- or user input queues.
6156d12a414d *** empty log message ***
claus
parents: 90
diff changeset
  1354
     Abort is assumed to be handled elsewhere."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1355
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1356
    self processEventsWithModalGroup:nil
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1357
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1358
    "Modified: 5.3.1997 / 11:33:51 / cg"
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1359
!
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1360
1419
a40a4f3ad589 while blocked by a modal view, forward key events to
Claus Gittinger <cg@exept.de>
parents: 1411
diff changeset
  1361
processEventsWithModalGroup:modalGroup
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1362
    "process events from either the damage- or user input queues.
1868
484e0fca2cf6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1363
     Abort is assumed to be handled elsewhere."
1328
99ffa52743c5 in modalGroup: only ignore key- and buttonEvents;
ca
parents: 1317
diff changeset
  1364
513
47b0f4bf4d89 use a single handler for handled signals
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  1365
    <resource: #keyboard (#Escape )>
496
71ecf6bfdff2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
  1366
2493
6de86b4cc4f6 pass keyEvents to keyboardProcessor - if there is one.
Claus Gittinger <cg@exept.de>
parents: 2487
diff changeset
  1367
    |event ignore focus firstTop evView evType evArgs
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1368
     modalTops modalTop modalDelegate syntheticEvent keyboardProcessor
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1369
     busyHookBlock busyHookCalled|
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1370
72
3e84121988c3 *** empty log message ***
claus
parents: 65
diff changeset
  1371
    self processExposeEvents.
180
claus
parents: 172
diff changeset
  1372
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1373
    [
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1374
        LastEventQuerySignal handle:[:ex |
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1375
            ex proceedWith:event
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1376
        ] do:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1377
            [mySensor notNil
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1378
             and:[(event := mySensor nextEvent) notNil]] whileTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1379
                ignore := false.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1380
                focus := focusView.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1381
                modalDelegate := false.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1382
                modalTop := nil.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1383
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1384
                modalGroup notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1385
                    "/ an incoming event for a masterView, 
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1386
                    "/ while being blocked by some other modalView.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1387
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1388
                    modalTops := modalGroup topViews.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1389
                    modalTops size > 0 ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1390
                        modalTop := modalTops first.
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1391
                    ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1392
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1393
                    event isKeyEvent ifTrue:[
3373
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1394
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1395
                        "/ forward keyboard events to my modal
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1396
                        "/ groups first topView ...
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1397
                        modalTop notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1398
                            focus := modalTop.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1399
                            modalDelegate := true.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1400
                        ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1401
                        modalGroup focusView notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1402
                            focus := modalGroup focusView
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1403
                        ]
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1404
                    ] ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1405
                        event isFocusEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1406
                            event isFocusInEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1407
                                "/ move focus over to modalBox
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1408
                                modalTop notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1409
                                    modalTop getKeyboardFocus.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1410
                                    "/ focusIn is forwarded to the modalGroup
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1411
                                    "/ (since keyboard is forwarded)
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1412
                                    event view:modalTop.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1413
                                    focus := modalTop.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1414
                                ]
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1415
                            ] ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1416
                                "/ focusOut goes to both the modal and
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1417
                                "/ the blocked main-group
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1418
                                "/ (actually, only the very first focusOut
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1419
                                "/  is needed in the mainGroup (to turn off the cursor)
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1420
                                "/  all others are only needed in the modalGroup)
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1421
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1422
    "/                            syntheticEvent := event copy.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1423
    "/                            syntheticEvent view:modalTop.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1424
    "/                            LastEventQuerySignal handle:[:ex |
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1425
    "/                                ex proceedWith:syntheticEvent
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1426
    "/                            ] do:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1427
    "/                                syntheticEvent sendEventWithFocusOn:nil.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1428
    "/                            ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1429
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1430
                                "/ event view:modalTop.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1431
                            ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1432
                            modalDelegate := true.
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1433
                        ] ifFalse:[
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1434
                            event isPointerLeaveEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1435
                            ] ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1436
                                event isUserEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1437
                                    ignore := true
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1438
                                ]
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1439
                            ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1440
                        ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1441
                    ]
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1442
                ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1443
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1444
                ignore ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1445
                    (views notNil or:[topViews notNil]) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1446
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1447
                        "/ give eventRecorders, catchers etc. 
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1448
                        "/ a chance to eat or modify that event
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1449
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1450
                        (preEventHook  notNil 
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1451
                        and:[preEventHook processEvent:event]) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1452
                            ignore := true.
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1453
                        ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1454
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1455
                        ignore ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1456
                            evView := event view.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1457
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1458
                            (event isKeyEvent 
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1459
                            and:[(keyboardProcessor := (modalTop ? evView topView) keyboardProcessor) notNil]) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1460
                                ignore := keyboardProcessor processEvent:event forModalView:modalTop
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1461
                            ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1462
                        ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1463
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1464
                        ignore ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1465
                            "/ event handling below will vanish ...
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1466
                            "/ (keyboardProcessor will do it)
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1467
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1468
                            event isKeyPressEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1469
                                event key == #Escape ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1470
                                    modalDelegate ifTrue:[
3349
ba099abb6b5c do not pass an Escape, which closes a modalBox
ca
parents: 3348
diff changeset
  1471
                                        modalTop hideRequest. ignore := true.
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1472
                                    ] ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1473
                                        isModal ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1474
                                            topViews size > 0 ifTrue:[
3438
8d3e56c417ce oops - topViews may become empty after hideRequest.
Claus Gittinger <cg@exept.de>
parents: 3436
diff changeset
  1475
                                                firstTop := topViews first.
8d3e56c417ce oops - topViews may become empty after hideRequest.
Claus Gittinger <cg@exept.de>
parents: 3436
diff changeset
  1476
                                                firstTop hideRequest.  
8d3e56c417ce oops - topViews may become empty after hideRequest.
Claus Gittinger <cg@exept.de>
parents: 3436
diff changeset
  1477
                                                firstTop realized ifFalse:[ ignore := true ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1478
                                            ]
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1479
                                        ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1480
                                    ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1481
                                ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1482
                            ] ifFalse:[
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1483
                                "/
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1484
                                "/ keep track of which view has the pointer
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1485
                                "/
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1486
                                event isPointerEnterEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1487
                                    pointerView := evView
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1488
                                ] ifFalse:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1489
                                    event isPointerLeaveEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1490
                                        pointerView := nil
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1491
                                    ]
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1492
                                ]
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1493
                            ].
3349
ba099abb6b5c do not pass an Escape, which closes a modalBox
ca
parents: 3348
diff changeset
  1494
                        ].
ba099abb6b5c do not pass an Escape, which closes a modalBox
ca
parents: 3348
diff changeset
  1495
ba099abb6b5c do not pass an Escape, which closes a modalBox
ca
parents: 3348
diff changeset
  1496
                        ignore ifFalse:[
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1497
                            "/
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1498
                            "/ buttonPress events turn off explicit focus, and reverts
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1499
                            "/ to implicit focus control
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1500
                            "/ This used to be done for every click -
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1501
                            "/ but behaved ugly if clicking in a scrollbar ...
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1502
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1503
                            "/ XXX: move to dispatchEvent
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1504
                            event isButtonPressEvent ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1505
                                (evView wantsFocusWithButtonPress) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1506
                                    "/ cannot use 'evView requestFocus' here,
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1507
                                    "/ since we want to enforce it without giving the
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1508
                                    "/ view a chance to circumvent this.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1509
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1510
                                    "/ evView requestFocus.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1511
                                    self focusView:evView.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1512
                                ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1513
                            ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1514
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1515
                            LastActiveGroup := self.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1516
                            LastActiveProcess := Processor activeProcess.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1517
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1518
                            (busyHook notNil and:[busyHookBlock isNil]) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1519
                                (event isKeyEvent or:[event isButtonPressEvent]) ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1520
                                    "/ start a timeout action - to invoke the busyHook after some time
3298
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1521
                                    busyHookCalled := false.
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1522
                                    busyHookBlock := [ 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1523
                                                        (inModalLoop ~~ true and:[busyHookCalled not]) ifTrue:[ 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1524
                                                            busyHook value:true. 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1525
                                                            busyHookCalled := true 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1526
                                                        ] 
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1527
                                                     ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1528
                                    Processor addTimedBlock:busyHookBlock afterMilliseconds:(busyHookTimeout ? BusyHookTime ? 150).
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1529
                                ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1530
                            ].
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1531
                            "
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1532
                             if there is no view information in the event,
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1533
                             it must have been sent directly to the sensor.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1534
                             Send it to the first topView.
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1535
                            "
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1536
                            evView isNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1537
                                (firstTop := topViews first) notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1538
                                    "/ XXX: fix to dispatchEvent
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1539
                                    firstTop perform:event type withArguments:event arguments
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1540
                                ]
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1541
                            ] ifFalse:[
3298
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1542
                                event isMessageSendEvent ifTrue:[
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1543
                                    event value
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1544
                                ] ifFalse:[
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1545
                                    evView dispatchEvent:event withFocusOn:focus delegate:true
88ac22e6a249 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3293
diff changeset
  1546
                                ]
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1547
                            ].
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1548
                        ].
2494
792881c4d938 slight change in keyboardProcessorHandling
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  1549
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1550
                        "/ give eventRecorders, postProcessors 
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1551
                        "/ a chance to see that event
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1552
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1553
                        postEventHook notNil ifTrue:[
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1554
                            postEventHook processEvent:event
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1555
                        ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1556
                    ]
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1557
                ].
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1558
            ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1559
        ]
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1560
    ] valueNowOrOnUnwindDo:[
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1561
        busyHookBlock notNil ifTrue:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1562
            Processor removeTimedBlock:busyHookBlock.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1563
            busyHookBlock := nil.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1564
            busyHookCalled ifTrue:[
3281
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1565
                busyHook value:false.
95e6d0e98f92 care for modal dialogs in automatic busy cursor handling
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
  1566
                busyHookCalled := false.
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1567
            ]
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1568
        ].
3279
9d7a9a94bec0 unwind-protect busyBlock evaluation
Claus Gittinger <cg@exept.de>
parents: 3278
diff changeset
  1569
    ].
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  1570
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
  1571
    "Created: / 5.3.1997 / 11:33:11 / cg"
3373
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1572
    "Modified: / 4.8.1998 / 18:18:55 / cg"
3585120d4d58 only eat a modal Escape-key event, if the modalView did unmap
Claus Gittinger <cg@exept.de>
parents: 3372
diff changeset
  1573
!
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1574
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1575
processExposeEvents
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1576
    "process only expose events from the damage queue.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1577
     This also handles resize, mapped and unmap events."
48
9e584329a6da last version with separate queue
claus
parents: 46
diff changeset
  1578
2407
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1579
    self processExposeEventsFor:nil
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1580
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1581
    "Modified: / 3.12.1998 / 14:01:57 / cg"
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1582
!
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1583
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1584
processExposeEventsFor:aViewOrNil
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1585
    "process only expose events from the damage queue.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1586
     This also handles resize, mapped and unmap events."
2407
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1587
180
claus
parents: 172
diff changeset
  1588
    |event view rect x y w h sensor thisProcess|
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
  1589
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
  1590
    (sensor := mySensor) isNil ifTrue:[^ self].
2154
4b2a478e59b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1591
    (sensor damageCount ~~ 0) ifTrue:[
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1592
        thisProcess := Processor activeProcess.
180
claus
parents: 172
diff changeset
  1593
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1594
        [(event := sensor nextDamageEventFor:aViewOrNil) notNil] whileTrue:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1595
            LastActiveGroup := self.
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1596
            LastActiveProcess := thisProcess.
180
claus
parents: 172
diff changeset
  1597
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1598
            (views notNil or:[topViews notNil]) ifTrue:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1599
                view := event view.
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1600
                (aViewOrNil isNil or:[aViewOrNil == view]) ifTrue:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1601
                    LastEventQuerySignal handle:[:ex |
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1602
                        ex proceedWith:event
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1603
                    ] do:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1604
                        (preEventHook notNil 
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1605
                        and:[preEventHook processEvent:event]) ifFalse:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1606
                            "/
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1607
                            "/ if the view is no longer shown (iconified or closed),
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1608
                            "/ this is a leftover event and ignored.
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1609
                            "/
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1610
                            "/ could this ever be a non-damage ?
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1611
                            "/
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1612
                            (view shown or:[event isDamage not]) ifTrue:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1613
                                LastActiveGroup := self.
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1614
                                LastActiveProcess := thisProcess.
2440
a0002dc34d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  1615
3096
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1616
                                view dispatchEvent:event withFocusOn:nil delegate:true. 
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1617
                            ].
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1618
                        ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1619
                    ].
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1620
                    postEventHook notNil ifTrue:[
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1621
                        postEventHook processEvent:event
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1622
                    ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1623
                ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1624
            ]
6ee19dabbba1 always use the same dispatch methods
ca
parents: 3077
diff changeset
  1625
        ]
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1626
    ]
1157
ffcb958058ad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1153
diff changeset
  1627
2407
bff2063d865a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2363
diff changeset
  1628
    "Created: / 3.12.1998 / 14:01:39 / cg"
2440
a0002dc34d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2438
diff changeset
  1629
    "Modified: / 5.2.1999 / 22:26:44 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1630
!
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1631
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1632
processRealExposeEvents
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1633
    "process only expose events from the damage queue
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1634
     (for any of my views).
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1635
     This only handles true expose events - leaving map, unmap etc. in the queue.
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1636
     This is required after a scroll operation,
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1637
     to wait for either a noExpose or a real expose."
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1638
2093
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1639
    self processRealExposeEventsFor:nil
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1640
!
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1641
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1642
processRealExposeEventsFor:someViewOrNil
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1643
    "process only expose events from the damage queue
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1644
     (for any of my views if the arg is nil).
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1645
     This only handles true expose events - leaving map, unmap etc. in the queue.
2093
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1646
     This is required after a scroll operation,
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1647
     to wait for either a noExpose or a real expose."
955072f08466 checkin from browser
ca
parents: 2089
diff changeset
  1648
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1649
    |event view rect x y w h sensor thisProcess|
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1650
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1651
    (sensor := mySensor) isNil ifTrue:[^ self].
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1652
    sensor damageCount == 0 ifTrue:[^ self].
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1653
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1654
    thisProcess := Processor activeProcess.
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1655
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1656
    [true] whileTrue:[
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1657
        LastActiveGroup := self.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1658
        LastActiveProcess := thisProcess.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1659
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1660
        "/ event := aView nextDamage.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1661
        event := sensor nextExposeEventFor:someViewOrNil.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1662
        event isNil ifTrue:[^ self].
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1663
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1664
        (views notNil or:[topViews notNil]) ifTrue:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1665
            LastEventQuerySignal handle:[:ex |
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1666
                ex proceedWith:event
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1667
            ] do:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1668
                (preEventHook notNil 
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1669
                and:[preEventHook processEvent:event]) ifFalse:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1670
                    view := event view.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1671
                    "/
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1672
                    "/ if the view is no longer shown (iconified or closed),
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1673
                    "/ this is a leftover event and ignored.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1674
                    "/
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1675
                    view shown ifTrue:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1676
                        rect := event rectangle.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1677
                        x := rect left.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1678
                        y := rect top.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1679
                        w := rect width.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1680
                        h := rect height.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1681
                        LastActiveGroup := self.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1682
                        LastActiveProcess := thisProcess.
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1683
                        view transformation notNil ifTrue:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1684
                            view deviceExposeX:x y:y width:w height:h
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1685
                        ] ifFalse:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1686
                            view exposeX:x y:y width:w height:h
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1687
                        ]
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1688
                    ]
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1689
                ].
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1690
                postEventHook notNil ifTrue:[
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1691
                    postEventHook processEvent:event
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1692
                ]
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1693
            ]
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1694
        ]
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1695
    ]
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1696
2086
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1697
    "Created: / 2.7.1997 / 14:32:19 / cg"
069a179b1849 dont yield when asking for pending events.
Claus Gittinger <cg@exept.de>
parents: 2051
diff changeset
  1698
    "Modified: / 5.4.1998 / 11:35:43 / cg"
1806
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1699
!
16c958be35d8 fixed no-deviceID error with destroy arriving while waiting for
Claus Gittinger <cg@exept.de>
parents: 1752
diff changeset
  1700
2444
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1701
repairDamage
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1702
    "repair all damaged areas for any of my views right now."
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1703
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1704
    self processExposeEvents
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1705
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1706
!
6b4c26e1949c added #repairDamage
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
  1707
28
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1708
waitForExposeFor:aView
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1709
    "wait for an expose or noExpose event for aView, then process all exposes.
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1710
     To be used after a scroll.
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1711
     This is very X-specific and not needed with other systems
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1712
     (i.e. a synthetic noExpose may be generated there)."
28
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1713
3879ff2138f1 *** empty log message ***
claus
parents: 26
diff changeset
  1714
    mySensor waitForExposeFor:aView.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1715
    AbortSignal catch:[
3278
ecdd26a9d003 added busy hook (to support automatic hour-glass cursor)
Claus Gittinger <cg@exept.de>
parents: 3276
diff changeset
  1716
        self processRealExposeEventsFor:aView
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1717
    ]
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1718
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1822
diff changeset
  1719
    "Modified: 6.8.1997 / 19:50:24 / cg"
11
bc3949e465a0 Initial revision
claus
parents:
diff changeset
  1720
! !
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  1721
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1722
!WindowGroup methodsFor:'focus control'!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  1723
2691
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1724
defaultKeyboardConsumer
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1725
    ^ nil
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1726
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1727
    "Created: / 20.5.1999 / 18:17:07 / cg"
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1728
!
26dd87552563 provide a hook for a defaultFocusWidget (not yet implemented)
Claus Gittinger <cg@exept.de>
parents: 2686
diff changeset
  1729
2519
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1730
explicitFocusView
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1731
    "return the view which currently has the explicit (i.e. tabbed) focus"
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1732
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1733
    focusByTab == true ifFalse:[^ nil].
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1734
    ^ focusView
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1735
!
97a5b44f150c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
  1736
2517
9abe2b73c605 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  1737
focusCameByTab
9abe2b73c605 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  1738
    ^ focusByTab 
9abe2b73c605 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  1739
!
9abe2b73c605 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  1740
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1741
focusNext
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1742
    "give focus to next view from focusView or topView
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1743
    "
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1744
    |curView oldView nxtView subViews index sequence size|
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1745
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1746
    oldView := focusView.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1747
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1748
    (curView := focusView) isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1749
        topViews notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1750
            focusView := curView := topViews detect:[:aView|aView shown] ifNone:nil.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1751
        ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1752
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1753
        focusView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1754
            ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1755
        ]
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1756
    ] ifFalse:[
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1757
        focusView := nil
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1758
    ].
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1759
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1760
    "/ SUPPORT OLD STUFF
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1761
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1762
    sequence := curView topView focusSequence.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1763
    size := sequence size.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1764
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1765
    size ~~ 0 ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1766
        oldView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1767
            index := 0
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1768
        ] ifFalse:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1769
            index := sequence identityIndexOf:oldView
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1770
        ].
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1771
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1772
        sequence from:(index + 1) do:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1773
            (v shown and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1774
                ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1775
            ]
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1776
        ].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1777
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1778
        sequence from:1 to:(index - 1) do:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1779
            (v shown and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1780
                ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1781
            ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1782
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1783
    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1784
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1785
    "/ NEW STUFF
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1786
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1787
    (nxtView := curView focusNext) notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1788
        ^ self focusView:nxtView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1789
    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1790
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1791
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1792
    [true] whileTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1793
        oldView := curView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1794
        curView := curView superView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1795
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1796
        curView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1797
            focusView notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1798
                ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1799
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1800
            ^ self focusNext
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1801
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1802
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1803
        curView shown ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1804
            subViews := curView subViews.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1805
            index    := subViews identityIndexOf:oldView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1806
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1807
            index == 0 ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1808
                "/ should not happen; but who guarantees
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1809
                ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1810
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1811
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1812
            subViews from:(index + 1) do:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1813
                v shown ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1814
                    (v canTab and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1815
                        ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1816
                    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1817
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1818
                    (nxtView := v focusNext) notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1819
                        ^ self focusView:nxtView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1820
                    ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1821
                ]
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1822
            ]
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1823
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1824
    ].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1825
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1826
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1827
2219
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1828
focusNextFrom:aView
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1829
    "give focus to the view after aView in the focusSequence"
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1830
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1831
    focusView := aView.
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1832
    self focusNext
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1833
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1834
    "Created: / 4.8.1998 / 02:43:17 / cg"
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1835
!
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1836
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1837
focusPrevious
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1838
    "give focus to previous view from focusView or topView
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1839
    "
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1840
    |curView oldView nxtView subViews index done sequence size|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1841
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1842
    (curView := focusView) isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1843
        topViews notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1844
            curView := topViews detect:[:aView|aView shown] ifNone:nil.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1845
        ]
2479
2dbe1821533b care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1846
    ].
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1847
    curView isNil ifTrue:[^ self].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1848
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1849
    "/ SUPPORT OLD STUFF
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1850
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1851
    sequence := curView topView focusSequence.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1852
    size := sequence size.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1853
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1854
    size ~~ 0 ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1855
        focusView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1856
            index := size + 1
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1857
        ] ifFalse:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1858
            index := sequence identityIndexOf:focusView.
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1859
        ].
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1860
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1861
        sequence from:1 to:(index - 1) reverseDo:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1862
            (v shown and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1863
                ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1864
            ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1865
        ].
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  1866
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1867
        sequence from:size to:(index + 1) reverseDo:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1868
            (v shown and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1869
                ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1870
            ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1871
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1872
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1873
        sequence from:1 to:(index - 1) do:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1874
            (v shown and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1875
                ^ self focusView:v byTab:true
3151
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1876
            ]
7a79503e33fd register/ deregister views in focusSequence
ca
parents: 3130
diff changeset
  1877
        ].
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1878
    ].
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1879
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1880
    "/ NEW STUFF
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1881
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1882
    focusView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1883
        subViews := curView subViews.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1884
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1885
        subViews size ~~ 0 ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1886
            curView := subViews detectLast:[:v|v shown] ifNone:nil
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1887
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1888
        curView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1889
            ^ self focusToView:nil
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1890
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1891
        done := false.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1892
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1893
        [done not and:[(subViews := curView subViews) size ~~ 0]] whileTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1894
            nxtView := subViews detectLast:[:v|v shown] ifNone:nil.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1895
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1896
            nxtView notNil ifTrue:[curView := nxtView]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1897
                          ifFalse:[done    := true].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1898
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1899
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1900
        (curView canTab and:[curView enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1901
            ^ self focusView:curView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1902
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1903
        focusView := curView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1904
    ] ifFalse:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1905
        nxtView := focusView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1906
        "/ check whether all superView's are shown
949
3894d442e895 care for invisible views when stepping the focus
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
  1907
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1908
        [(nxtView := nxtView superView) notNil] whileTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1909
            nxtView shown ifFalse:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1910
                curView := nxtView superView
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1911
            ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1912
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1913
        curView ~~ focusView ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1914
            curView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1915
                focusView := nil.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1916
                self focusPrevious.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1917
            ] ifFalse:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1918
                self focusView:curView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1919
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1920
            ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1921
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1922
        focusView := nil.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1923
    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1924
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1925
    [true] whileTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1926
        oldView := curView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1927
        curView := curView superView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1928
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1929
        curView isNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1930
            focusView notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1931
                ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1932
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1933
            ^ self focusPrevious
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1934
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1935
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1936
        curView shown ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1937
            subViews := curView subViews.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1938
            index    := subViews identityIndexOf:oldView.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1939
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1940
            index == 0 ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1941
                "/ should not happen; but who guarantees
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1942
                ^ self
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1943
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1944
            subViews from:1 to:(index - 1) reverseDo:[:v|
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1945
                v shown ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1946
                    nxtView := v focusPrevious.
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1947
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1948
                    nxtView notNil ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1949
                        ^ self focusView:nxtView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1950
                    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1951
                    (v canTab and:[v enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1952
                        ^ self focusView:v byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1953
                    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1954
                ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1955
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1956
            (curView canTab and:[curView enabled]) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1957
                ^ self focusView:curView byTab:true
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1958
            ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1959
        ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1960
    ].
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1961
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  1962
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1963
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1964
2219
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1965
focusPreviousFrom:aView
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1966
    "give focus to the view before aView in the focusSequence"
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1967
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1968
    focusView := aView.
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1969
    self focusPrevious
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1970
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1971
    "Created: / 4.8.1998 / 02:43:08 / cg"
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1972
!
8dcff419009d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2213
diff changeset
  1973
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  1974
focusRequestFrom:aView
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  1975
    "aView requests focus. I will grant it, if I have no explicit
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  1976
     focusView (i.e. not tabbed)"
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  1977
2686
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1978
    |prevFocusView myDisplay i|
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1979
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1980
"/    'focusRequest:' print. aView print. 
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1981
2686
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1982
    myDisplay := self graphicsDevice.
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1983
    (myDisplay notNil 
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1984
    and:[myDisplay activateOnClick:nil]) ifTrue:[
3400
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1985
        prevFocusView := myDisplay focusView.
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1986
        (prevFocusView notNil 
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1987
        and:[prevFocusView windowGroup ~~ aView windowGroup]) ifTrue:[
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1988
            "/ a view from another windowGroup requests the focus.
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1989
            "/ Do not grant this, if in windows-activateOnClick mode.
2686
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1990
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1991
"/            ' not granted' printCR.
3400
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1992
            myDisplay setInputFocusTo:prevFocusView.
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1993
            ^ false
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  1994
        ].
2686
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1995
    ].
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  1996
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1997
"/    ' granted' printCR.
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1998
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  1999
    (focusView isNil or:[focusByTab not]) ifTrue:[
3400
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  2000
        (aView isNil or:[aView ~~ focusView]) ifTrue:[
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  2001
            self focusView:aView byTab:false.
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  2002
        ].
ff43dd6a2148 fixed focusRequestFrom:aView.
tm
parents: 3391
diff changeset
  2003
        ^ true
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2004
    ].
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2005
    ^ false
2686
f074aa7d0748 care for activateOnClick mode when granting a focusRequest.
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
  2006
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  2007
    "Modified: / 20.5.1999 / 18:30:31 / cg"
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2008
!
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2009
135
claus
parents: 121
diff changeset
  2010
focusSequence
500
a313e9fda9f0 ask topView for focusSequence; focusKey handling now done in TopView/Controller
Claus Gittinger <cg@exept.de>
parents: 496
diff changeset
  2011
    "return my focus sequence for focusNext/focusPrevious.
135
claus
parents: 121
diff changeset
  2012
     Focus is stepped in the order in which subviews occur in
claus
parents: 121
diff changeset
  2013
     the sequence"
claus
parents: 121
diff changeset
  2014
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2015
    ^ nil
135
claus
parents: 121
diff changeset
  2016
!
claus
parents: 121
diff changeset
  2017
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2018
focusSequence:aSequenceableCollection
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2019
    "define the focus sequence for focusNext/focusPrevious.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2020
     Focus is stepped in the order in which subviews occur in
1946
17a52204481e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
  2021
     the sequence."
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2022
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2023
2353
e04098201f7c added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents: 2250
diff changeset
  2024
focusToView:aViewOrNil
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2025
    "give focus to aViewOrNil"
2353
e04098201f7c added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents: 2250
diff changeset
  2026
e04098201f7c added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents: 2250
diff changeset
  2027
    focusView == aViewOrNil ifFalse:[
3156
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2028
        (    aViewOrNil isNil
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2029
         or:[(aViewOrNil canTab and:[aViewOrNil enabled])]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2030
        ) ifTrue:[
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2031
            self focusView:aViewOrNil
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2032
        ]
38b73e5c08aa focusNext and focusPrevious reimplemented; abwärts compatible
ca
parents: 3151
diff changeset
  2033
    ].
2353
e04098201f7c added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents: 2250
diff changeset
  2034
!
e04098201f7c added #focusToView: - checks if its a valid view in the focusSequence.
Claus Gittinger <cg@exept.de>
parents: 2250
diff changeset
  2035
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2036
focusView
135
claus
parents: 121
diff changeset
  2037
    "return the view which currently has the focus"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2038
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2039
    ^ focusView
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2040
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2041
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2042
focusView:aViewOrNil
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2043
    "give focus to aViewOrNil"
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2044
2485
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2045
    self focusView:aViewOrNil byTab:false
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2046
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2047
    "
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2048
     |top v1 v2|
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2049
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2050
     top := StandardSystemView new.
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2051
     v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top.
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2052
     v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top.
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2053
     top open.
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2054
     top windowGroup focusView:v1.
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2055
    "
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2056
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2057
    "Modified: 31.5.1996 / 21:13:25 / cg"
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2058
!
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2059
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2060
focusView:aViewOrNil byTab:focusCameViaTab
2507
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2061
    "give focus to aViewOrNil.
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2062
     The focusCameViaTab argument specifies if the focus came via
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2063
     tabbing or by pointer-movement/automatic.
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2064
     If it came via tabbing, the view is notified differently, to allow
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2065
     for special highlighting (i.e. drawing a focus-border around itself)"
2485
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2066
2723
3e54762a7840 new focus mechanism
Claus Gittinger <cg@exept.de>
parents: 2692
diff changeset
  2067
    |i prevFocusView myDisplay|
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2068
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2069
"/ 'focusToView:' print. aViewOrNil printCR. 
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  2070
2507
daaf44f27cdd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2506
diff changeset
  2071
    myDisplay := self graphicsDevice.
2522
a6a84d36b161 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2521
diff changeset
  2072
    myDisplay notNil ifTrue:[
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2073
        "/
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2074
        "/ take the focus from whichEver view had it previously
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2075
        "/
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2076
        prevFocusView := myDisplay focusView.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2077
        prevFocusView ~~ aViewOrNil ifTrue:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2078
"/ 'take focus from ' print. prevFocusView printCR. 
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2079
            self class takeFocusFromDevice:myDisplay.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2080
        ].
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2081
        myDisplay focusView:aViewOrNil.
2506
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2082
    ].
221b75206a75 focus handling changed.
Claus Gittinger <cg@exept.de>
parents: 2497
diff changeset
  2083
2485
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2084
    focusView == aViewOrNil ifTrue:[
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2085
        focusView notNil ifTrue:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2086
            "/ this is the case when the mouse-pointer reenters
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2087
            "/ into a topView which had a focusView
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2088
            focusByTab := focusCameViaTab or:[focusByTab].
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2089
            focusView showFocus:focusByTab.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2090
"/ 'give focus to ' print. aViewOrNil printCR. 
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2091
            self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2092
            myDisplay focusView:aViewOrNil.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2093
        ].
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2094
        ^ self
2485
410e810ccbcc remember if focus came by tabbing or clicking into the focusView
Claus Gittinger <cg@exept.de>
parents: 2479
diff changeset
  2095
    ].
410
9d9d03fa5d82 moved Tab handling to topView (which sends #focusNext if no subview handled it)
Claus Gittinger <cg@exept.de>
parents: 408
diff changeset
  2096
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2097
    focusView notNil ifTrue:[
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2098
        "/ lost explicit focus
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2099
        focusView == aViewOrNil ifTrue:[
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2100
"/ 'give focus to ' print. aViewOrNil printCR. 
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2101
            self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2102
            myDisplay focusView:aViewOrNil.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2103
            ^ self
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2104
        ].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2105
    ].
387
aa80487842b8 compile event classes with optSpace;
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  2106
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2107
    focusView := aViewOrNil.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2108
    focusView notNil ifTrue:[
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2109
        "/ got explicit focus
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2110
        aViewOrNil showFocus:focusCameViaTab.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2111
"/ 'give focus to ' print. aViewOrNil printCR. 
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2112
        self class sendKeyboardFocusEventTo:aViewOrNil withArgument:true.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2113
        focusByTab := focusCameViaTab.
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2114
        myDisplay focusView:aViewOrNil.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2115
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2116
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2117
    "
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2118
     |top v1 v2|
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2119
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2120
     top := StandardSystemView new.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2121
     v1 := EditTextView origin:0.0@0.0 corner:1.0@0.5 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2122
     v2 := EditTextView origin:0.0@0.5 corner:1.0@1.0 in:top.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2123
     top open.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2124
     top windowGroup focusView:v1.
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2125
    "
357
3655807445b7 keep track of pointerView, for implizit focus tracking
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  2126
2692
79a3b3d740f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  2127
    "Modified: / 20.5.1999 / 18:30:16 / cg"
2479
2dbe1821533b care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  2128
!
2dbe1821533b care for subWidgets when searching for the currentFocusView
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  2129
2737
f8ca00c8e6d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
  2130
pointerView
f8ca00c8e6d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
  2131
    "return the view which currently has the pointer"
f8ca00c8e6d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
  2132
f8ca00c8e6d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
  2133
    ^ pointerView
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2134
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2135
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2136
!WindowGroup methodsFor:'initialization'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2137
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2138
initialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2139
    "setup the windowgroup, by creating a new sensor
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2140
     and an event semaphore"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2141
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2142
    mySensor := WindowSensor new.
1273
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  2143
    mySensor eventSemaphore:(Semaphore new name:'WGroup eventSema').
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2144
    isModal := false.
417
940ebb195fc6 added isModalForSubView flag
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  2145
    isForModalSubview := false.
1273
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  2146
158d030a5553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
  2147
    "Modified: 25.1.1997 / 00:20:19 / cg"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2148
!
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2149
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2150
reinitialize
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2151
    "reinitialize the windowgroup after an image restart"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2152
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2153
    "throw away old (zombie) process"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2154
    myProcess notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2155
	"/ careful: the old processes exit-actions must be cleared.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2156
	"/ otherwise, it might do destroy or other actions when it
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2157
	"/ gets finalized ...
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2158
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2159
"/        myProcess removeAllExitActions.
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2160
	myProcess removeAllSuspendActions.
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2161
	myProcess := nil.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2162
    ].
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2163
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2164
    "throw away old events"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2165
    mySensor reinitialize
313
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  2166
2b776b2a26c5 stefans changes
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
  2167
    "Modified: 13.12.1995 / 13:45:35 / stefan"
1186
e1fbbabcd682 no longer use exitBlocks - a termination-unwind handler will
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2168
    "Modified: 12.1.1997 / 00:45:01 / cg"
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2169
! !
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2170
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2171
!WindowGroup methodsFor:'keyboard control'!
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2172
3391
c11ca001a8ef - rename #mnemonicViewNext: to #processMnemonic:
ca
parents: 3376
diff changeset
  2173
processMnemonic:aKeyEvent
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2174
    "a  mnemonicKey event as forwarded from the keyboardProcessor - if there
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2175
     is the mnemonic-key defined for a subView true is returned and the view
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2176
     becomes the focusView otherwise false.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2177
    "
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2178
    |topView mnemonicView|
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2179
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2180
    focusView notNil ifTrue:[
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2181
        "/ start from current focusView
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2182
        mnemonicView := focusView mnemonicViewNext:aKeyEvent.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2183
3391
c11ca001a8ef - rename #mnemonicViewNext: to #processMnemonic:
ca
parents: 3376
diff changeset
  2184
        (mnemonicView notNil and:[true "mnemonicView canTab" and:[mnemonicView enabled]]) ifTrue:[
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2185
            self focusView:mnemonicView byTab:false.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2186
          ^ true
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2187
        ]
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2188
    ].
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2189
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2190
    "/ start from any topview
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2191
    topViews notNil ifTrue:[
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2192
        topView := topViews detect:[:aView| aView shown ] ifNone:nil.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2193
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2194
        topView notNil ifTrue:[
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2195
            mnemonicView := topView mnemonicViewNext:aKeyEvent.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2196
3391
c11ca001a8ef - rename #mnemonicViewNext: to #processMnemonic:
ca
parents: 3376
diff changeset
  2197
            (mnemonicView notNil and:[true "mnemonicView canTab" and:[mnemonicView enabled]]) ifTrue:[
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2198
                self focusView:mnemonicView byTab:false.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2199
              ^ true
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2200
            ]
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2201
        ]
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2202
    ].
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2203
    ^ false
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2204
!
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2205
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2206
processShortcut:aKeyEvent
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2207
    "a  shortcutKey event as forwarded from the keyboardProcessor - if there is the
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2208
     shortcut-key defined process the shortcut and return true otherwise false.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2209
    "
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2210
    |topView mnemonicView|
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2211
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2212
    "/ start from current focusView
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2213
    (focusView notNil and:[focusView processShortcut:aKeyEvent]) ifTrue:[
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2214
        ^ true
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2215
    ].
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2216
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2217
    "/ start from any topview
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2218
    topViews notNil ifTrue:[
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2219
        topView := topViews detect:[:v| v ~~ focusView and:[v shown]] ifNone:nil.
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2220
      ^ topView notNil and:[topView processShortcut:aKeyEvent]
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2221
    ].
3376
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2222
    ^ false
a9784be22e6a added hasKeyboardFocus event
tm
parents: 3373
diff changeset
  2223
! !
3372
af010559c138 mnemonic-key and shortcut-key support;
ca
parents: 3354
diff changeset
  2224
3276
9ed39f7e7282 category change
Claus Gittinger <cg@exept.de>
parents: 3212
diff changeset
  2225
!WindowGroup methodsFor:'printing & storing'!
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  2226
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2227
printOn:aStream
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  2228
    "return a printed representation;
144
claus
parents: 141
diff changeset
  2229
     just for more user friendlyness: add name of process."
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  2230
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2231
    myProcess isNil ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2232
	(previousGroup notNil and:[previousGroup process notNil]) ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2233
	    aStream nextPutAll:('WindowGroup(modal in ' , previousGroup process nameOrId , ')').
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2234
	    ^ self.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2235
	].
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2236
	^ super printOn:aStream
2870
7805fc861445 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2863
diff changeset
  2237
    ].
7805fc861445 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2863
diff changeset
  2238
    isModal ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2239
	aStream nextPutAll:('WindowGroup(modal for ' , myProcess nameOrId , ')').
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2240
	^ self.
90
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2241
    ].
b1f1d7fc96eb *** empty log message ***
claus
parents: 86
diff changeset
  2242
    aStream nextPutAll:('WindowGroup(' , myProcess nameOrId , ')')
19
74683e998f36 *** empty log message ***
claus
parents: 17
diff changeset
  2243
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2245
!WindowGroup methodsFor:'special'!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2246
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2247
migrateTo:anotherDisplay
3302
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2248
    "migrate all of my views to some other display device"
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2249
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2250
    |myDevice top nm dev devNm previouslyRealized|
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2251
3304
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2252
    self isModal ifTrue:[
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2253
        "/ cannot migrate a modal box away from its owner ...
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2254
        "/ (need a separate process and views may not be owned)
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2255
        self error:'Modal windogroup cannot be migrated.'.
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2256
        ^ self
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2257
    ].
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2258
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2259
    previouslyRealized := IdentitySet new.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2260
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2261
    myDevice := self graphicsDevice.
3308
f20f8481741c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3304
diff changeset
  2262
    DeviceWorkstation flushCachedLastScreen.
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2263
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2264
    graphicsDevice := nil.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2265
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2266
    "/ enumerate views - flush their device info ...
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2267
    topViews do:[:eachTopView |
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2268
        eachTopView realized ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2269
            previouslyRealized add:eachTopView
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2270
        ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2271
        eachTopView unmap.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2272
    ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2273
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2274
    "/ destroy them - but without notifying application/views
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2275
    self allViewsDo:[:eachView |
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2276
        eachView releaseDeviceResources.
3302
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2277
        eachView setDevice:anotherDisplay id:nil gcId:nil.
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2278
    ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2279
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2280
    "/ recreate them ...
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2281
    self allViewsDo:[:eachView |
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2282
        eachView recreate.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2283
        eachView fetchDeviceResources
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2284
    ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2285
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2286
    "/ realize them ...
3304
6dcc6bb7c3e5 block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  2287
    (topViews ? previouslyRealized) do:[:eachTopView |
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2288
        (previouslyRealized includes:eachTopView) ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2289
            eachTopView realize
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2290
        ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2291
    ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2292
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2293
    graphicsDevice := anotherDisplay.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2294
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2295
    anotherDisplay sync.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2296
    myDevice sync.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2297
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2298
    "/
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2299
    "/ change the name of my process
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2300
    "/
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2301
    (topViews size > 0) ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2302
        top := topViews first.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2303
        nm := top processName.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2304
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2305
        (dev := top graphicsDevice) notNil ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2306
            devNm := dev displayName.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2307
            (devNm notNil and:[Display isNil or:[devNm ~= Display displayName]]) ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2308
                nm := nm , ' (->' , devNm , ')'
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2309
            ]
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2310
        ]
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2311
    ] ifFalse:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2312
        nm := 'window handler'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2313
    ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2314
    myProcess name:nm.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2315
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2316
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2317
     |anotherDisplay v host|
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2318
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2319
     v := StandardSystemView new.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2320
     v extent:100@100.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2321
     v addSubView:(Button label:'foo').
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2322
     v openAndWait.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2323
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2324
     host := Dialog request:'display:' initialAnswer:'dawn:0'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2325
     host isNil ifTrue:[^ self].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2326
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2327
     anotherDisplay := XWorkstation newDispatchingFor:host.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2328
     anotherDisplay isNil ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2329
         self warn:'Could not connect to remote display'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2330
         ^ self
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2331
     ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2332
     Smalltalk at:#Display2 put:anotherDisplay.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2333
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2334
     v windowGroup migrateTo:anotherDisplay
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2335
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2336
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2337
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2338
     |anotherDisplay app host|
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2339
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2340
     app := NewSystemBrowser open.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2341
     app window waitUntilVisible.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2342
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2343
     host := Dialog request:'display:' initialAnswer:'dawn:0'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2344
     host isNil ifTrue:[^ self].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2345
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2346
     anotherDisplay := XWorkstation newDispatchingFor:host.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2347
     anotherDisplay isNil ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2348
         self warn:'Could not connect to remote display'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2349
         ^ self
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2350
     ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2351
     Smalltalk at:#Display2 put:anotherDisplay.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2352
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2353
     app windowGroup migrateTo:anotherDisplay
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2354
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2355
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2356
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2357
     |host anotherDisplay|
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2358
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2359
     host := Dialog request:'display:' initialAnswer:'dawn:0'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2360
     host isNil ifTrue:[^ self].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2361
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2362
     anotherDisplay := XWorkstation newDispatchingFor:host.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2363
     anotherDisplay isNil ifTrue:[
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2364
         self warn:'Could not connect to remote display'.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2365
         ^ self
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2366
     ].
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2367
     Smalltalk at:#Display2 put:anotherDisplay.
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2368
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2369
     Transcript topView windowGroup migrateTo:anotherDisplay
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2370
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2371
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2372
    "
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2373
     Transcript topView windowGroup migrateTo:Display
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2374
    "
3302
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2375
! !
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2376
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2377
!WindowGroup methodsFor:'special-accessing'!
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2378
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2379
isForModalSubview 
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2380
    "special for windowgroups for modal subviews.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2381
     These must be flagged specially to avoid the views being reassigned
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2382
     to the maingroup.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2383
     This is a private interface to the SimpleView class"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2384
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2385
    ^ isForModalSubview
3293
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2386
!
a5c5d64b36e9 migration - not yet finished
Claus Gittinger <cg@exept.de>
parents: 3288
diff changeset
  2387
3302
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2388
isForModalSubview:aBoolean
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2389
    "special for windowgroups for modal subviews.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2390
     These must be flagged specially to avoid the views being reassigned
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2391
     to the maingroup.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2392
     This is a private interface to the SimpleView class"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2393
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2394
    isForModalSubview := aBoolean
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2395
!
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2396
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2397
setModal:aBoolean
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2398
    "special entry for debugger: set the modal flag.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2399
     Not for public use"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2400
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2401
    isModal := aBoolean
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2402
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2403
    "Modified: 3.9.1995 / 14:51:04 / claus"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2404
!
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2405
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2406
setPreviousGroup:aGroup
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2407
    "special entry for debugger:
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2408
     set the windowgroup that started this group (for modal groups only).
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2409
     This is not a public interface."
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2410
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2411
    previousGroup := aGroup
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2412
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2413
    "Modified: 3.9.1995 / 14:55:40 / claus"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2414
!
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2415
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2416
setProcess:aProcess 
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2417
    "special entry for debugger: set the windowGroups process.
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2418
     Not for public use."
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2419
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2420
    myProcess := aProcess
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2421
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2422
    "Modified: 3.9.1995 / 14:25:38 / claus"
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2423
! !
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2424
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2425
!WindowGroup methodsFor:'special-user interaction'!
c06a207c33da *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3298
diff changeset
  2426
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2427
restoreCursors
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2428
    "restore the original cursors in all of my views"
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2429
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2430
    |myDevice|
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2431
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2432
    myDevice := self graphicsDevice.
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2433
330
13a3fa93330c careful - view could have been destroyed in the meanwhile (in restoreCursors)
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  2434
    self allViewsDo:[:aView |  
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2435
        |c dev id cid|
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2436
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2437
        dev := aView graphicsDevice.
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2438
        dev notNil ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2439
            (id := aView id) notNil ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2440
                c := aView cursor.
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2441
                c notNil ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2442
                    c := c onDevice:dev.
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2443
                    (c notNil and:[(cid := c id) notNil]) ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2444
                        dev setCursor:cid in:id.
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2445
                        dev ~~ myDevice ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2446
                            dev flush
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2447
                        ]
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2448
                    ].
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2449
                ]
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2450
            ]
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2451
        ]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2452
    ].
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2453
    myDevice flush
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 698
diff changeset
  2454
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2455
    "Modified: / 22.4.1998 / 14:28:22 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2456
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2457
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2458
showActivity:someMessage
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2459
    "some activityNotification shalt be communicated to
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2460
     the user; 
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2461
     forward it to my first topView if there is one
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2462
     (that one should know how to deal with it)"
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2463
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2464
    topViews notNil ifTrue:[
1977
9bda3ac0d83d no need for #flush in event-loop (already done by threads suspendAction)
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2465
	topViews first showActivity:someMessage
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2466
    ]
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2467
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2468
    "Created: 16.12.1995 / 18:39:40 / cg"
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  2469
    "Modified: 23.4.1996 / 21:36:54 / cg"
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2470
!
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
  2471
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2472
showCursor:aCursor
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2473
    "change the cursor to aCursor in all of my views
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2474
     (This sets the cursor directly, without changing the state of the cursor instance variable;
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2475
      the reason is to allow for #restoreCursors to be able to undo this)."
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2476
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2477
    |myDevice c|
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2478
3062
76e91b0a9ab7 care for nil cursors
Claus Gittinger <cg@exept.de>
parents: 2993
diff changeset
  2479
    aCursor isNil ifTrue:[^ self].
76e91b0a9ab7 care for nil cursors
Claus Gittinger <cg@exept.de>
parents: 2993
diff changeset
  2480
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2481
    c := aCursor.
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2482
    myDevice := self graphicsDevice.
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2483
    self allViewsDo:[:aView |  
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2484
        |cId vId dev|
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2485
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2486
        dev := aView graphicsDevice.
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2487
        dev notNil ifTrue:[
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2488
            c := c onDevice:dev.
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2489
            (cId := c id) notNil ifTrue:[
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2490
               (vId := aView id) notNil ifTrue:[
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2491
                    dev setCursor:cId in:vId.
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2492
                    dev ~~ myDevice ifTrue:[
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2493
                        dev flush
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2494
                    ]
3280
fc8a810432c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3279
diff changeset
  2495
                ]
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2496
            ].
3286
21f022859294 flush device-queue when showing cursor,
Claus Gittinger <cg@exept.de>
parents: 3281
diff changeset
  2497
        ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2498
    ].
3288
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2499
    myDevice flush
13ae063e593e only flush once in #showCursor
Claus Gittinger <cg@exept.de>
parents: 3286
diff changeset
  2500
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2501
!
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2502
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2503
withCursor:aCursor do:aBlock
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2504
    "evaluate aBlock while showing aCursor in all
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2505
     my views (used to show wait-cursor while doing something).
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2506
     Return the result as returned by aBlock."
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2507
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  2508
    |oldCursors dev deviceCursor action|
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  2509
926
1b8422921e4d use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
  2510
    dev := self graphicsDevice.   
3062
76e91b0a9ab7 care for nil cursors
Claus Gittinger <cg@exept.de>
parents: 2993
diff changeset
  2511
    (dev isNil or:[aCursor isNil]) ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2512
	^ aBlock value
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  2513
    ].
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2514
1652
5745269f78a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1561
diff changeset
  2515
    deviceCursor := aCursor onDevice:dev.
5745269f78a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1561
diff changeset
  2516
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2517
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2518
     get mapping of view->cursor for all of my subviews
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2519
    "
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2520
    oldCursors := IdentityDictionary new.
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2521
    self allViewsDo:[:aView |
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2522
	|old|
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  2523
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2524
	old := aView cursor.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2525
	old ~~ aCursor ifTrue:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2526
	    oldCursors at:aView put:old.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2527
	    aView cursor:deviceCursor now:false
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2528
	]
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2529
    ].
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  2530
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  2531
    oldCursors size == 0 ifTrue:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2532
	action := aBlock
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  2533
    ] ifFalse:[
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2534
	action := [
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2535
		    |rslt|
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  2536
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2537
		    "/
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2538
		    "/ here sync looks better; flush leads to almost invisible cursors when accepting.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2539
		    "/ I dont really know why (maybe unix does not context-switch to the Xserver
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2540
		    "/ early enough after the requests have been sent ?)
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2541
		    "/
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2542
		    dev sync.
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  2543
3077
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2544
		    rslt := aBlock valueNowOrOnUnwindDo:[
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2545
			"
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2546
			 restore cursors from the mapping
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2547
			"
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2548
			oldCursors keysAndValuesDo:[:view :cursor |
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2549
			    view cursor:cursor now:false.
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2550
			].
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2551
			dev flush
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2552
		    ].
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2553
		    rslt
aa0c8fc61fd0 *** empty log message ***
ps
parents: 3062
diff changeset
  2554
		  ]
1387
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  2555
    ].
3fabdef0790d better behavior if called recursively
Claus Gittinger <cg@exept.de>
parents: 1364
diff changeset
  2556
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2557
"/    (self isModal and:[previousGroup notNil]) ifTrue:[
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2558
"/        "/ pass the work to my parentGroup
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2559
"/        ^ previousGroup withCursor:aCursor do:action
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2560
"/    ].
1986
344c50a87cbe #withCursor:do: for a modal group
ca
parents: 1977
diff changeset
  2561
    ^ action value.
317
7a1271ecb987 use new #cursor:now: if many cursors are switched
Claus Gittinger <cg@exept.de>
parents: 313
diff changeset
  2562
2097
d290e7910bec dont change cursors of mainGroup
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
  2563
    "Modified: / 22.4.1998 / 14:36:47 / cg"
408
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2564
!
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2565
2213
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2566
withExecuteCursorDo:aBlock
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2567
    "evaluate aBlock while showing a busyCursor in all
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2568
     my views (used to show busy-cursor while doing something time consuming).
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2569
     Return the result as returned by aBlock."
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2570
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2571
    ^ self withCursor:(Cursor execute) do:aBlock
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2572
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2573
    "Created: / 31.7.1998 / 20:11:52 / cg"
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2574
!
84035dc560e0 added #withExecuteCursorDo: (for completeness)
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2575
408
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2576
withWaitCursorDo:aBlock
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2577
    "evaluate aBlock while showing a waitCursor in all
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2578
     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
  2579
     Return the result as returned by aBlock."
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2580
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2581
    ^ self withCursor:(Cursor wait) do:aBlock
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2582
bd946e47bc07 added #withCursor:do:
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
  2583
    "Created: 6.2.1996 / 19:51:53 / cg"
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2584
! !
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2585
1110
3ffcd22497fd last event query signal
ca
parents: 956
diff changeset
  2586
!WindowGroup class methodsFor:'documentation'!
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  2587
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  2588
version
3438
8d3e56c417ce oops - topViews may become empty after hideRequest.
Claus Gittinger <cg@exept.de>
parents: 3436
diff changeset
  2589
    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.226 2001-06-13 07:57:29 cg Exp $'
251
915de9a65169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 244
diff changeset
  2590
! !
244
83218faf792c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  2591
WindowGroup initialize!