TopView.st
author ca
Thu, 09 Nov 2000 16:17:34 +0100
changeset 3370 3a4990b6bfb5
parent 3347 e7b8350d6525
child 3446 e66622e4f832
permissions -rw-r--r--
keyboardProcessor lifted (to have it in dialogs, too)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
135
claus
parents:
diff changeset
     1
"
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
     3
              All Rights Reserved
135
claus
parents:
diff changeset
     4
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    10
 hereby transferred.
claus
parents:
diff changeset
    11
"
claus
parents:
diff changeset
    12
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
    13
"{ Package: 'stx:libview' }"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
    14
135
claus
parents:
diff changeset
    15
View subclass:#TopView
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    16
	instanceVariableNames:'type iconified keyboardProcessor'
2326
c47b2c8f51dc moved TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents: 2124
diff changeset
    17
	classVariableNames:'TakeFocusWhenMapped'
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
    18
	poolDictionaries:''
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
    19
	category:'Views-Basic'
135
claus
parents:
diff changeset
    20
!
claus
parents:
diff changeset
    21
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
    22
!TopView class methodsFor:'documentation'!
135
claus
parents:
diff changeset
    23
claus
parents:
diff changeset
    24
copyright
claus
parents:
diff changeset
    25
"
claus
parents:
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
    27
              All Rights Reserved
135
claus
parents:
diff changeset
    28
claus
parents:
diff changeset
    29
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    34
 hereby transferred.
claus
parents:
diff changeset
    35
"
claus
parents:
diff changeset
    36
!
claus
parents:
diff changeset
    37
claus
parents:
diff changeset
    38
documentation
claus
parents:
diff changeset
    39
"
claus
parents:
diff changeset
    40
    I am an abstract superclass of StandardSystemView and PopUpView;
claus
parents:
diff changeset
    41
    i.e. views which have no superview.
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    42
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    43
    Do not get confused by the name TopView - your applications
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    44
    topViews are typically instances of StandardSystemView.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    45
1396
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    46
    [instance variables:]
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    47
	type		<Symbol>	one of #normal, #master, #slave or #partner
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    48
					for modeless views
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    49
					(#master, #slave or #partner link multiple views 
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    50
					into a windowManagers windowGroup -> de-iconification) 
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    51
					#dialog for modal views; #popup for popup views.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    52
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    53
    [see also:]
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    54
        StandardSystemView PopUpView DialogBox 
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    55
        ( introduction to view programming :html: programming/viewintro.html )
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    56
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    57
    [author:]
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    58
        Claus Gittinger
135
claus
parents:
diff changeset
    59
"
claus
parents:
diff changeset
    60
! !
claus
parents:
diff changeset
    61
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
    62
!TopView class methodsFor:'defaults'!
135
claus
parents:
diff changeset
    63
claus
parents:
diff changeset
    64
defaultExtent
586
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
    65
    "return the default extent of my instances.
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
    66
     Topviews extents is 2/3 of screen by default"
135
claus
parents:
diff changeset
    67
153
claus
parents: 151
diff changeset
    68
    |display|
claus
parents: 151
diff changeset
    69
claus
parents: 151
diff changeset
    70
    display := Screen current.
3072
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
    71
    display isNil ifTrue:[
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
    72
        ^ 600 @ 400
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
    73
    ].
153
claus
parents: 151
diff changeset
    74
    ^ (display width // 3 * 2) @ (display height // 3 * 2)
586
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
    75
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
    76
    "Modified: 22.4.1996 / 23:39:13 / cg"
135
claus
parents:
diff changeset
    77
! !
claus
parents:
diff changeset
    78
3143
db2332366367 category renamining
Claus Gittinger <cg@exept.de>
parents: 3072
diff changeset
    79
!TopView methodsFor:'Compatibility - ST80'!
1410
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    80
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    81
displayBox
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    82
    ^ self bounds
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    83
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    84
    "Created: 3.3.1997 / 16:31:33 / cg"
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    85
!
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    86
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    87
displayBox:aRectangle
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    88
    self origin:aRectangle origin corner:aRectangle corner
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    89
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    90
    "Created: 3.3.1997 / 16:34:38 / cg"
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    91
! !
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
    92
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    93
!TopView methodsFor:'accessing'!
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    94
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    95
keyboardProcessor
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    96
    "return my keyboard processor"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    97
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    98
    ^ keyboardProcessor
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    99
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   100
    "Created: / 18.6.1998 / 18:52:42 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   101
    "Modified: / 18.6.1998 / 20:00:18 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   102
!
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   103
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   104
keyboardProcessor:something
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   105
    "set my keyboard processor"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   106
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   107
    keyboardProcessor := something.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   108
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   109
    "Created: / 18.6.1998 / 18:52:42 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   110
    "Modified: / 18.6.1998 / 20:00:30 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   111
! !
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   112
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   113
!TopView methodsFor:'accessing-behavior'!
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   114
1765
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   115
beIndependent
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   116
    "make this an independent view; i.e. remove any master/slave or partner
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   117
     attribute (this is the default).
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   118
     However, the view remains in the current windowGroup"
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   119
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   120
    type := nil
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   121
!
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   122
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   123
beMaster
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   124
    "make this a master-view. All slave views within the same
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   125
     windowGroup will be closed if any master is closed."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   126
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   127
    type := #master
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   128
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   129
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   130
     see example in TopView>>beSlave
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   131
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   132
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   133
    "Created: 10.12.1995 / 13:30:50 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   134
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   135
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   136
bePartner
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   137
    "make this a partner-view. Each partner-view will automatically 
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   138
     close other partner views (within the same windowGroup) when closed."
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   139
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   140
    type := #partner 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   141
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   142
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   143
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   144
     if any of them is iconified/deiconified/closed, the other one is also
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   145
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   146
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   147
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   148
     top1 := StandardSystemView new label:'partner'; extent:300@300.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   149
     top2 := StandardSystemView new label:'partner'; extent:200@200.
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   150
     top1 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   151
     top2 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   152
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   153
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   154
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   155
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   156
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   157
    "Created: 10.12.1995 / 13:29:59 / cg"
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   158
    "Modified: 25.5.1996 / 11:44:48 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   159
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   160
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   161
beSlave
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   162
    "make this a slave-view. It will be closed automatically,
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   163
     whenever any master of the windowgroup is closed.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   164
     See also: #bePartner"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   165
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   166
    type := #slave 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   167
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   168
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   169
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   170
     the slave is allowed to be iconified/close independ of the master;
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   171
     but if the master is iconified, the slave is also.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   172
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   173
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   174
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   175
     top1 := StandardSystemView new label:'master'; extent:300@300.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   176
     top2 := StandardSystemView new label:'slave'; extent:200@200.
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   177
     top1 beMaster.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   178
     top2 beSlave.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   179
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   180
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   181
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   182
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   183
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   184
    "Created: 10.12.1995 / 13:29:10 / cg"
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   185
    "Modified: 25.5.1996 / 11:45:30 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   186
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   187
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   188
focusSequence:aCollectionOfSubcomponents
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   189
    "define the sequence for stepping through my components."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   190
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   191
    windowGroup isNil ifTrue:[
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   192
        windowGroup := WindowGroup new.
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   193
    ].
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   194
    windowGroup focusSequence:aCollectionOfSubcomponents.
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   195
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   196
    "Created: 6.3.1996 / 15:37:11 / cg"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   197
    "Modified: 30.4.1996 / 15:41:40 / cg"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   198
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   199
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   200
!TopView methodsFor:'event handling'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   201
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   202
keyPress:key x:x y:y
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   203
    "notice: this is going to be moved into the upcoming 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   204
     StandardSystemViewController."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   205
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   206
    <resource: #keyboard ( #Tab 
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   207
                           #FocusNext #FocusPrevious 
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   208
                           #CursorDown #CursorUp ) >
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   209
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   210
    windowGroup notNil ifTrue:[
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   211
        key == #Tab ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   212
            self sensor shiftDown ifTrue:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   213
                windowGroup focusPrevious
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   214
            ] ifFalse:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   215
                windowGroup focusNext
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   216
            ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   217
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   218
        ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   219
        (key == #FocusNext or:[key == #CursorDown]) ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   220
            windowGroup focusNext.
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   221
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   222
        ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   223
        (key == #FocusPrevious or:[key == #CursorUp])  ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   224
            windowGroup focusPrevious.
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   225
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   226
        ].
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   227
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   228
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   229
    super keyPress:key x:x y:y
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   230
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   231
    "Created: 1.2.1996 / 22:08:30 / cg"
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   232
    "Modified: 9.1.1997 / 12:17:38 / cg"
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   233
!
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   234
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   235
showActivity:someMessage
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   236
    "some activityNotification shalt be communicated to
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   237
     the user. 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   238
     Default for activity notifications here: ignore them"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   239
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   240
    ^ self
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   241
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   242
    "Created: 16.12.1995 / 18:40:13 / cg"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   243
    "Modified: 23.4.1996 / 21:38:27 / cg"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   244
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   245
2466
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   246
!TopView methodsFor:'help stubs'!
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   247
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   248
showHelp:aHelpText for:aView
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   249
    "dummy - added in case a regular topView is installed
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   250
     as a dialogs masterApplication.
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   251
     Concrete application subclasses may redefine this to
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   252
     display a help text in one of its message areas"
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   253
! !
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   254
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   255
!TopView methodsFor:'initialize / release'!
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   256
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   257
assignKeyboardFocusToFirstInputField
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   258
    "assign the keyboard focus to the first input field,
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   259
     or else to the first keyboardConsumer.
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   260
     This prefers inputFields over editTextViews 
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   261
     (which may change in the future)"
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   262
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   263
    |firstConsumer|
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   264
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   265
    self allSubViewsDo:[:v |
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   266
        v isInputField ifTrue:[
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   267
            v requestFocus. "/ self windowGroup focusView:v.
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   268
            ^ self
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   269
        ].
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   270
        (firstConsumer isNil and:[v isKeyboardConsumer]) ifTrue:[
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   271
            firstConsumer := v
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   272
        ].
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   273
    ].
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   274
    firstConsumer notNil ifTrue:[
2693
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   275
        firstConsumer requestFocus.
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   276
        "/ firstConsumer requestFocus. - could be denied; but we force it here
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   277
        windowGroup focusView:firstConsumer byTab:false.
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   278
    ].
2693
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   279
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   280
    "Modified: / 20.5.1999 / 18:14:16 / cg"
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   281
!
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   282
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   283
destroy
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   284
    "the receiver is to be destroyed - look for partners and slaves"
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   285
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   286
    |wg dev|
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   287
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   288
    keyboardProcessor notNil ifTrue:[
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   289
        keyboardProcessor release.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   290
        keyboardProcessor := nil.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   291
    ].
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   292
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   293
    wg := windowGroup.                  "/ have to fetch windowGroup before;
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   294
    dev := device.                      "/ and device ...
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   295
    super destroy.                      "/ ... since destroy nils em
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   296
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   297
"/    dev notNil ifTrue:[
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   298
"/        dev flush
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   299
"/    ].
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   300
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   301
    "/
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   302
    "/ destroy slaves and partners
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   303
    "/
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   304
    self masterSlaveMessage:#destroy inGroup:wg
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   305
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   306
    "Modified: 20.3.1997 / 22:14:16 / cg"!
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   307
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   308
initialize
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   309
    "initialize the topViews position for the screens center"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   310
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   311
    |screenCenter|
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   312
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   313
    super initialize.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   314
2874
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   315
    device initializeTopViewHookFor:self.
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   316
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   317
    screenCenter := device center.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   318
    left := screenCenter x - (width // 2).
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   319
    top := screenCenter y - (height // 2).
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   320
    type := #normal
2874
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   321
!
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   322
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   323
postRealize
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   324
    super postRealize.
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   325
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   326
    keyboardProcessor isNil ifTrue:[
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   327
        keyboardProcessor := KeyboardProcessor new.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   328
    ].
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   329
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   330
    device realizedTopViewHookFor:self! !
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   331
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   332
!TopView methodsFor:'misc'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   333
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   334
raiseDeiconified
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   335
    "deiconify & bring to front"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   336
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   337
    self isCollapsed ifTrue:[
645
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   338
        self unmap.
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   339
        self realize.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   340
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   341
    self raise
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   342
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   343
    "
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   344
     Transcript topView raiseDeiconified
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   345
    "
645
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   346
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   347
    "Modified: 3.5.1996 / 23:49:36 / stefan"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   348
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   349
2124
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   350
waitUntilClosed
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   351
    "wait until the receiver has been closed.
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   352
     Can be used to synchronize multiple-window applications,
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   353
     and (especially) to wait until an application session is finished
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   354
     when invoking commands with the rDoit mechanism"
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   355
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   356
    [drawableId isNil] whileFalse:[
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   357
        Delay waitForSeconds:0.1.
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   358
    ].
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   359
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   360
    "asynchronous:
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   361
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   362
     EditTextView open
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   363
    "
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   364
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   365
    "synchronous:
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   366
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   367
     EditTextView open topView waitUntilClosed
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   368
    "
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   369
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   370
    "Modified: / 20.5.1998 / 18:03:37 / cg"
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   371
!
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   372
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   373
withCursor:aCursor do:aBlock
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   374
    "evaluate aBlock while showing aCursor in all my views.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   375
     Return the value as returned by aBlock."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   376
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   377
    windowGroup notNil ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   378
        ^ windowGroup withCursor:aCursor do:aBlock
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   379
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   380
    ^ super withCursor:aCursor do:aBlock
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   381
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   382
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   383
!TopView methodsFor:'queries'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   384
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   385
heightIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   386
    "return the views overall-height"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   387
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   388
    ^ height
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   389
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   390
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   391
isCollapsed
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   392
    "ST80 compatibility: return true if the view is not shown (i.e. iconified)"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   393
1536
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   394
    "/ ^ device windowIsIconified:drawableId
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   395
    ^ shown not
1536
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   396
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   397
    "Modified: 4.4.1997 / 14:44:39 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   398
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   399
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   400
isModal
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   401
    "return true, if the receiver has been opened modal"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   402
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   403
    windowGroup isNil ifTrue:[^ false].
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   404
    ^ windowGroup isModal!
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   405
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   406
isPopUpView
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   407
    "return true, since I want to come up without decoration 
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   408
     and popUp to top immediately."
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   409
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   410
    ^ type == #popup
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   411
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   412
    "Created: 28.2.1997 / 22:12:30 / cg"
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   413
    "Modified: 28.2.1997 / 22:37:01 / cg"
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   414
!
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   415
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   416
isTopView
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   417
    "return true, since I am a topView"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   418
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   419
    ^ true
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   420
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   421
    "Created: 22.3.1997 / 14:45:55 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   422
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   423
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   424
preferredExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   425
    "return my preferred extent - this is the minimum size I would like to have.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   426
     The default here is the classes default extent,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   427
     however many subclasses redefine this to compute the actual value
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   428
     depending on the sizes of the contents or subcomponents."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   429
966
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   430
    "/ If I have an explicit preferredExtent ..
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   431
761
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   432
    preferredExtent notNil ifTrue:[
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   433
        ^ preferredExtent
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   434
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   435
    ^ self class defaultExtent
761
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   436
966
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   437
    "Modified: 19.7.1996 / 20:45:41 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   438
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   439
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   440
type
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   441
    "return the views type. This is one of #normal,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   442
     #master, #slave or #partner."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   443
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   444
    ^ type
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   445
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   446
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   447
widthIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   448
    "return the views overall-width"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   449
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   450
    ^ width
2808
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   451
!
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   452
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   453
window
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   454
    "for compatibility with applicationModels ... return the receiver"
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   455
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   456
    ^ self
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   457
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   458
1399
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   459
!TopView methodsFor:'show / hide'!
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   460
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   461
fixPosition:aPoint
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   462
    "set origin to aPoint, but make sure, that the box is fully visible 
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   463
     by shifting it into the visible screen area if nescessary.
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   464
     This prevents invisible modalBoxes (which you could never close)."
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   465
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   466
    self origin:aPoint.
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   467
    self makeFullyVisible
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   468
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   469
    "Created: 28.2.1997 / 16:39:31 / cg"
1401
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   470
!
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   471
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   472
mapIconified
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   473
    "make the view visible but iconified.
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   474
     In contrast to map, which does it non-iconified"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   475
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   476
    realized ifFalse:[
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   477
        "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   478
         now, make the view visible
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   479
        "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   480
        realized := true.
2103
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   481
        device
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   482
            mapView:self id:drawableId iconified:true
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   483
            atX:left y:top width:width height:height
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   484
            minExtent:(self minExtent) maxExtent:(self maxExtent)
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   485
    ]
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   486
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   487
    "Modified: 25.2.1997 / 22:44:33 / cg"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   488
    "Created: 24.7.1997 / 12:48:21 / cg"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   489
!
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   490
1401
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   491
positionOffset
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   492
    "return the delta, by which the box should be
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   493
     displaced from the mouse pointer.
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   494
     Here, the boxes center is returned as a default.
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   495
     Usually redefined in subclasses to have the most convenient
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   496
     ok-button appear under the pointer."
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   497
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   498
    ^ self extent // 2
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   499
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   500
    "Created: 28.2.1997 / 22:56:34 / cg"
1399
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   501
! !
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   502
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   503
!TopView methodsFor:'startup'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   504
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   505
openAt:aPosition transientFor:anotherView
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   506
    "force the view to be opened at some position on the screen
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   507
     AND tell the windowManager to NOT let the user choose a position
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   508
     (i.e. suppress any ghostframe).
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   509
     The view is marked as being a transient (i.e. pop-up) view for
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   510
     anotherView - it will deiconify with it and (on some windowManagers)
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   511
     have no iconify button of its own.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   512
     Notice, that its up to the windowManager to care for any borders -
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   513
     it seems not deterministic, where the view actually ends up being positioned.
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
   514
     Not all windowManagers (olwm) honor this - some insist on it ..."
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   515
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   516
    |otherId|
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   517
1836
df791f4fe7b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1829
diff changeset
   518
    drawableId isNil ifTrue:[self create].
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   519
    anotherView isNil ifTrue:[
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   520
        otherId := drawableId.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   521
    ] ifFalse:[
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   522
        anotherView create.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   523
        otherId := anotherView id.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   524
    ].
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   525
    device setTransient:drawableId for:otherId.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   526
    self origin:aPosition.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   527
    self open
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   528
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   529
    "
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   530
     |v1 v2|
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   531
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   532
     v1 := StandardSystemView extent:300@300.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   533
     v2 := StandardSystemView extent:300@300.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   534
     v1 open.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   535
     v2 openAt:0@0 transientFor:v1.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   536
    "
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   537
960
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   538
    "
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   539
     |v1|
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   540
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   541
     v1 := StandardSystemView extent:300@300.
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   542
     v1 openAt:0@0 transientFor:v1.
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   543
    "
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   544
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   545
    "Created: 28.6.1996 / 10:51:55 / cg"
1836
df791f4fe7b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1829
diff changeset
   546
    "Modified: 28.7.1997 / 18:53:16 / cg"
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   547
!
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   548
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   549
openDisplayAt:aPoint
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   550
    "ST-80 compatibility: open the view centered around aPoint"
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   551
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   552
    ^ self openModelessAt:(aPoint - (self extent//2))
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   553
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   554
    "
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   555
     (TopView new extent:200@200) openDisplayAt:300@300
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   556
    "
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   557
!
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   558
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   559
openIconified
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   560
    "open the view in iconified state"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   561
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   562
    self openModelessAt:nil iconified:true
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   563
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   564
    "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   565
     FileBrowser new openIconified
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   566
     ChangesBrowser new openIconified
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   567
    "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   568
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
   569
    "Modified: 24.7.1997 / 14:54:58 / cg"
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   570
!
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   571
1336
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   572
openIn:aBoundaryRectangle
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   573
    "set origin & extent and open. 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   574
     The given extent overrides the receivers preferredExtent.
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   575
     Added for ST-80 compatibility"
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   576
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   577
    self 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   578
        origin:aBoundaryRectangle origin; 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   579
        extent:aBoundaryRectangle extent; 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   580
        sizeFixed:true.
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   581
    self open
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   582
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   583
    "Modified: 12.2.1997 / 11:58:21 / cg"
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   584
!
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   585
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   586
openTransientAt:aPosition
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   587
    "force the view to be opened at soem position on the screen
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   588
     AND tell the windowManager to NOT let the user choose a position
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   589
     (i.e. suppress any ghostframe).
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   590
     Notice, that its up to the windowManager to care for any borders -
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   591
     it seems not deterministic, where the view actually ends up being positioned.
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
   592
     Not all windowManagers (olwm) honor this - some insist on it ..."
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   593
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   594
    self openAt:aPosition transientFor:nil
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   595
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   596
    "normal open:
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   597
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   598
     |v|
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   599
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   600
     v := StandardSystemView extent:300@300.
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   601
     v open
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   602
    "
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   603
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   604
    "open at position:
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   605
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   606
     |v|
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   607
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   608
     v := StandardSystemView extent:300@300.
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   609
     v openTransientAt:10@10
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   610
    "
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   611
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
   612
    "Created: 28.6.1996 / 10:52:30 / cg"
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
   613
    "Modified: 28.6.1996 / 10:55:15 / cg"
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   614
!
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   615
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   616
openWithExtent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   617
    "set extent and open. The given extent overrides the 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   618
     receivers preferredExtent.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   619
     Added for ST-80 compatibility"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   620
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   621
    self extent:anExtent; sizeFixed:true.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   622
    self open
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   623
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   624
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   625
openWithPriority:aPriority
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   626
    "open the view, run the windowgroup process at
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   627
     other than UserScehdulingPriority."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   628
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   629
    self open.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   630
    windowGroup process priority:aPriority.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   631
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   632
    "Created: 30.4.1996 / 15:34:44 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   633
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   634
157
claus
parents: 153
diff changeset
   635
!TopView methodsFor:'window events'!
claus
parents: 153
diff changeset
   636
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   637
mapped 
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   638
    "the recevier was unmapped (i.e. iconified);
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   639
     look for partners and slaves."
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   640
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   641
    realized := true. 
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   642
    super mapped.
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   643
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   644
    "/
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   645
    "/ map slaves and partners
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   646
    "/
2799
e7b1ea0db727 partners must be remapped (at the old position)
Claus Gittinger <cg@exept.de>
parents: 2693
diff changeset
   647
    self masterSlaveMessage:#remap inGroup:windowGroup.
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   648
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   649
    self isModal ifTrue:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   650
        "take it away from any popup menu possibly still active"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   651
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   652
        self forceUngrabKeyboard.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   653
        self forceUngrabPointer.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   654
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   655
         get the focus
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   656
        "
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   657
        self getKeyboardFocus.
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   658
        self enableEnterLeaveEvents
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   659
    ] ifFalse:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   660
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   661
         ask for the focus - this avoids having to click on the
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   662
         view with WM's which need an explicit click.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   663
         Q: is this a good idea ?
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   664
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   665
        TakeFocusWhenMapped == true ifTrue:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   666
            self getKeyboardFocus.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   667
        ]
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   668
    ]
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   669
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   670
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   671
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   672
    "Modified: / 10.9.1998 / 22:02:52 / cg"
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   673
    "Modified: 30.5.1996 / 09:37:22 / cg"!
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
   674
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   675
masterSlaveMessage:aSelector inGroup:aWindowGroup
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   676
    "send aSelector to partners and/or slaves.
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   677
     This is a private helper for destroy / mapped / unmapped"
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   678
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   679
    aWindowGroup notNil ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   680
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   681
        "/ if I am a master or partner, send to all slaves
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   682
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   683
        (type == #master or:[type == #partner]) ifTrue:[
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   684
            aWindowGroup slavesDo:[:v | v perform:aSelector].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   685
        ].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   686
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   687
        "/ if I am a partner, send to all partners
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   688
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   689
        type == #partner ifTrue:[
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   690
            aWindowGroup partnersDo:[:v | v ~~ self ifTrue:[v perform:aSelector]].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   691
        ].
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   692
    ].
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   693
!
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   694
157
claus
parents: 153
diff changeset
   695
unmapped 
claus
parents: 153
diff changeset
   696
    "the recevier was unmapped (i.e. iconified);
claus
parents: 153
diff changeset
   697
     look for partners and slaves."
claus
parents: 153
diff changeset
   698
3035
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   699
    |r|
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   700
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   701
    (windowGroup notNil and:[windowGroup isModal]) ifTrue:[
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   702
        "keep the realized flag true (to avoid exiting the modal event loop).
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   703
         Consider this a kludge."
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   704
        r := realized.
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   705
        super unmapped.
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   706
        realized := r.
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   707
    ] ifFalse:[
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   708
        realized := false. 
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   709
        super unmapped.
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
   710
    ].
419
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
   711
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
   712
    "/
775
fbabce661c52 comment
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   713
    "/ unmap slaves and partners
419
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
   714
    "/
658
ce56170b3fb1 renamed rerealize to remap
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   715
    self masterSlaveMessage:#unmap inGroup:windowGroup
157
claus
parents: 153
diff changeset
   716
775
fbabce661c52 comment
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   717
    "Modified: 30.5.1996 / 09:37:22 / cg"
157
claus
parents: 153
diff changeset
   718
! !
claus
parents: 153
diff changeset
   719
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   720
!TopView class methodsFor:'documentation'!
135
claus
parents:
diff changeset
   721
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   722
version
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   723
    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.68 2000-11-09 15:17:34 ca Exp $'
135
claus
parents:
diff changeset
   724
! !