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