author | Claus Gittinger <cg@exept.de> |
Wed, 17 Jul 2019 10:31:26 +0200 | |
changeset 8734 | de0c9b4d22b9 |
parent 8722 | 114b5c5589aa |
child 8836 | 895551b9ddd7 |
permissions | -rw-r--r-- |
135 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
5721 | 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 |
" |
|
3347 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
6791 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
135 | 16 |
View subclass:#TopView |
5721 | 17 |
instanceVariableNames:'type iconified keyboardProcessor' |
18 |
classVariableNames:'TakeFocusWhenMapped ForceModalBoxesToOpenAtCenter |
|
19 |
ForceModalBoxesToOpenAtPointer MasterSlaveMask WindowTypeMask |
|
20 |
TypeMaster TypeSlave TypePartner TypeDialog TypePopUp |
|
21 |
TypeUndecorated TypeToolWindow TypeToolDialog MDIClientMask |
|
22 |
MDIClient TypeScreenDialog CurrentWindowMoveStart |
|
6647 | 23 |
CurrentWindowMoveState CurrentWindowBeingMoved |
24 |
TypeUndecoratedResizable TypePopUpNonModal' |
|
5721 | 25 |
poolDictionaries:'' |
26 |
category:'Views-Basic' |
|
135 | 27 |
! |
28 |
||
1160 | 29 |
!TopView class methodsFor:'documentation'! |
135 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
5721 | 34 |
All Rights Reserved |
135 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
I am an abstract superclass of StandardSystemView and PopUpView; |
|
48 |
i.e. views which have no superview. |
|
616 | 49 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
50 |
Do not get confused by the name TopView - your applications |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
51 |
topViews are typically instances of StandardSystemView. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
52 |
|
1396 | 53 |
[instance variables:] |
5721 | 54 |
type <Integer> encodes master/slave relationship: |
55 |
#normal, #master, #slave or #partner |
|
56 |
for modeless views |
|
57 |
(the #master-, #slave- or #partner-type links multiple views |
|
58 |
into a windowManagers windowGroup -> for de-iconification) |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
59 |
|
5721 | 60 |
encodes window type: |
61 |
#normal, #dialog, #popup, #undecorated |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
62 |
|
616 | 63 |
[see also:] |
5721 | 64 |
StandardSystemView PopUpView DialogBox |
65 |
( introduction to view programming :html: programming/viewintro.html ) |
|
616 | 66 |
|
67 |
[author:] |
|
5721 | 68 |
Claus Gittinger |
135 | 69 |
" |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
70 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
71 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
72 |
examples |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
73 |
" |
8293 | 74 |
Notice, the following examples only demonstrate the windows style (not its modal behavior). |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
75 |
the style is controlled by the systems windowManager, and might even be ignored by some. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
76 |
(for example, the dialog- and normal styles often look the same). |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
77 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
78 |
The bahavior is controlled by ST/X, and controlled by the open vs. openModeless vs. openModal message. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
79 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
80 |
Modeless: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
81 |
regular style: |
8293 | 82 |
[exBegin] |
83 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
84 |
|
8293 | 85 |
v := TopView new. |
86 |
v extent:200@200. |
|
87 |
v open |
|
88 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
89 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
90 |
dialog: |
8293 | 91 |
[exBegin] |
92 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
93 |
|
8293 | 94 |
v := TopView new. |
95 |
v beDialogView. |
|
96 |
v extent:200@200. |
|
97 |
v open |
|
98 |
Delay waitForSeconds:10. v destroy. |
|
99 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
100 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
101 |
popUp (always on top): |
8293 | 102 |
[exBegin] |
103 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
104 |
|
8293 | 105 |
v := TopView new. |
106 |
v bePopUpView. |
|
107 |
v extent:200@200. |
|
108 |
v open. |
|
109 |
Delay waitForSeconds:10. v destroy. |
|
110 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
111 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
112 |
undecorated (looks loke popUp, but is not always on top): |
8293 | 113 |
[exBegin] |
114 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
115 |
|
8293 | 116 |
v := TopView new. |
117 |
v beUndecorated. |
|
118 |
v extent:200@200. |
|
119 |
v open. |
|
120 |
Delay waitForSeconds:10. v destroy. |
|
121 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
122 |
|
4254 | 123 |
toolwindow (looks loke normal, but has smaller windowTitle-area on win32): |
8293 | 124 |
[exBegin] |
125 |
|v| |
|
4254 | 126 |
|
8293 | 127 |
v := TopView new. |
128 |
v beToolWindow. |
|
129 |
v extent:200@200. |
|
130 |
v open. |
|
131 |
Delay waitForSeconds:10. v destroy. |
|
132 |
[exEnd] |
|
4254 | 133 |
|
4256 | 134 |
toolwindow dialog (looks loke normal, but has smaller windowTitle-area on win32): |
8293 | 135 |
[exBegin] |
136 |
|v| |
|
4256 | 137 |
|
8293 | 138 |
v := TopView new. |
139 |
v beToolDialog. |
|
140 |
v extent:200@200. |
|
141 |
v open. |
|
142 |
Delay waitForSeconds:10. v destroy. |
|
143 |
[exEnd] |
|
4256 | 144 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
145 |
Modal: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
146 |
regular style: |
8293 | 147 |
[exBegin] |
148 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
149 |
|
8293 | 150 |
v := TopView new. |
151 |
v extent:200@200. |
|
152 |
v openModal |
|
153 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
154 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
155 |
dialog: |
8293 | 156 |
[exBegin] |
157 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
158 |
|
8293 | 159 |
v := TopView new. |
160 |
v beDialogView. |
|
161 |
v extent:200@200. |
|
162 |
v openModal |
|
163 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
164 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
165 |
popUp (always on top): |
8293 | 166 |
[exBegin] |
167 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
168 |
|
8293 | 169 |
v := TopView new. |
170 |
v bePopUpView. |
|
171 |
v extent:200@200. |
|
172 |
v openModal |
|
173 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
174 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
175 |
undecorated (looks loke popUp, but is not always on top): |
8293 | 176 |
[exBegin] |
177 |
|v| |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
178 |
|
8293 | 179 |
v := TopView new. |
180 |
v beUndecorated. |
|
181 |
v extent:200@200. |
|
182 |
v openModal |
|
183 |
[exEnd] |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
184 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
185 |
" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
186 |
! ! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
187 |
|
5720 | 188 |
!TopView class methodsFor:'accessing'! |
189 |
||
190 |
currentWindowBeingMoved |
|
6500 | 191 |
"the current window move operation |
5720 | 192 |
(only used with modeless popup windows; i.e. windows without decoration, |
193 |
which want to be moved by click-motion on the background)" |
|
194 |
||
195 |
^ CurrentWindowBeingMoved |
|
196 |
||
197 |
"Created: / 03-03-2011 / 19:20:34 / cg" |
|
198 |
! ! |
|
199 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
200 |
!TopView class methodsFor:'class initialization'! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
201 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
202 |
initialize |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
203 |
MasterSlaveMask := 16r0F. |
4498 | 204 |
TypeMaster := 16r01. |
205 |
TypeSlave := 16r02. |
|
206 |
TypePartner := 16r03. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
207 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
208 |
WindowTypeMask := 16rF0. |
4498 | 209 |
TypeDialog := 16r10. |
210 |
TypePopUp := 16r20. |
|
211 |
TypeUndecorated := 16r30. |
|
212 |
TypeToolWindow := 16r40. |
|
213 |
TypeToolDialog := 16r50. |
|
4798 | 214 |
TypeScreenDialog:= 16r60. |
6647 | 215 |
TypeUndecoratedResizable := 16r70. |
216 |
TypePopUpNonModal := 16r80. |
|
4498 | 217 |
|
218 |
MDIClientMask := 16r100. |
|
219 |
MDIClient := 16r100. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
220 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
221 |
" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
222 |
self initialize |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
223 |
" |
135 | 224 |
! ! |
225 |
||
1160 | 226 |
!TopView class methodsFor:'defaults'! |
135 | 227 |
|
228 |
defaultExtent |
|
586 | 229 |
"return the default extent of my instances. |
230 |
Topviews extents is 2/3 of screen by default" |
|
135 | 231 |
|
153 | 232 |
|display| |
233 |
||
234 |
display := Screen current. |
|
3072 | 235 |
display isNil ifTrue:[ |
5721 | 236 |
^ 600 @ 400 |
3072 | 237 |
]. |
3446 | 238 |
^ display defaultExtentForTopViews |
3519
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
239 |
! |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
240 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
241 |
forceModalBoxesToOpenAtCenter |
5614 | 242 |
"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
|
243 |
at the screens center" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
244 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
245 |
^ ForceModalBoxesToOpenAtCenter ? false |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
246 |
! |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
247 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
248 |
forceModalBoxesToOpenAtCenter:aBoolean |
3768 | 249 |
"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
|
250 |
at the screens center" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
251 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
252 |
ForceModalBoxesToOpenAtCenter := aBoolean |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
253 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
254 |
" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
255 |
TopView forceModalBoxesToOpenAtCenter:true |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
256 |
TopView forceModalBoxesToOpenAtCenter:false |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
257 |
" |
3768 | 258 |
! |
259 |
||
260 |
forceModalBoxesToOpenAtPointer |
|
5614 | 261 |
"return the flag which forces all modal views to be opened |
3768 | 262 |
at the current pointer position" |
263 |
||
264 |
^ ForceModalBoxesToOpenAtPointer ? false |
|
265 |
! |
|
266 |
||
267 |
forceModalBoxesToOpenAtPointer:aBoolean |
|
5614 | 268 |
"set/clear the flag which forces all modal views to be opened |
3768 | 269 |
at the current pointer position" |
270 |
||
271 |
ForceModalBoxesToOpenAtPointer := aBoolean |
|
3978 | 272 |
! |
273 |
||
274 |
takeFocusWhenMapped:aBoolean |
|
275 |
"if turned on, topViews will grab the keyboard when mapped. |
|
276 |
This is useful on systems like openView or Win32, where a view needs a click |
|
277 |
otherwise" |
|
278 |
||
279 |
TakeFocusWhenMapped := aBoolean |
|
280 |
||
281 |
" |
|
282 |
StandardSystemView takeFocusWhenMapped:true |
|
283 |
" |
|
135 | 284 |
! ! |
285 |
||
8252 | 286 |
!TopView class methodsFor:'help'! |
287 |
||
288 |
helpSpec |
|
289 |
^ nil |
|
290 |
! ! |
|
291 |
||
3880 | 292 |
!TopView methodsFor:'Compatibility-ST80'! |
1410
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
293 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
294 |
displayBox |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
295 |
^ self bounds |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
296 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
297 |
"Created: 3.3.1997 / 16:31:33 / cg" |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
298 |
! |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
299 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
300 |
displayBox:aRectangle |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
301 |
self origin:aRectangle origin corner:aRectangle corner |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
302 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
303 |
"Created: 3.3.1997 / 16:34:38 / cg" |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
304 |
! ! |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
305 |
|
3370 | 306 |
!TopView methodsFor:'accessing'! |
307 |
||
308 |
keyboardProcessor |
|
309 |
"return my keyboard processor" |
|
310 |
||
311 |
^ keyboardProcessor |
|
312 |
||
313 |
"Created: / 18.6.1998 / 18:52:42 / cg" |
|
314 |
"Modified: / 18.6.1998 / 20:00:18 / cg" |
|
315 |
! |
|
316 |
||
317 |
keyboardProcessor:something |
|
318 |
"set my keyboard processor" |
|
319 |
||
320 |
keyboardProcessor := something. |
|
321 |
||
322 |
"Created: / 18.6.1998 / 18:52:42 / cg" |
|
323 |
"Modified: / 18.6.1998 / 20:00:30 / cg" |
|
4138 | 324 |
! |
325 |
||
8484 | 326 |
resources |
327 |
resources isNil ifTrue:[ |
|
328 |
^ self class resources |
|
329 |
]. |
|
330 |
^ resources |
|
331 |
||
332 |
" |
|
333 |
TopView new resources |
|
334 |
" |
|
335 |
||
336 |
"Created: / 25-09-2018 / 08:43:13 / Claus Gittinger" |
|
3370 | 337 |
! ! |
338 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
339 |
!TopView methodsFor:'accessing-behavior'! |
269 | 340 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
341 |
beDialogView |
4798 | 342 |
"make me a Dialog Window; that is one which raises above all other ST/X views" |
343 |
||
4256 | 344 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
345 |
type isInteger ifTrue:[ |
5721 | 346 |
type := (type bitClear:WindowTypeMask) bitOr:TypeDialog. |
347 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
348 |
]. |
5614 | 349 |
type := #dialog |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
350 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
351 |
|
1765 | 352 |
beIndependent |
353 |
"make this an independent view; i.e. remove any master/slave or partner |
|
354 |
attribute (this is the default). |
|
355 |
However, the view remains in the current windowGroup" |
|
356 |
||
4256 | 357 |
"/ the nonInteger handling code is for backward compatibility only. |
4081 | 358 |
type isInteger ifTrue:[ |
5721 | 359 |
type := type bitClear:MasterSlaveMask. |
360 |
^ self. |
|
4081 | 361 |
]. |
1765 | 362 |
type := nil |
363 |
! |
|
364 |
||
4500 | 365 |
beMDIClientView |
4498 | 366 |
type := (type bitClear:MDIClientMask) bitOr:MDIClient. |
367 |
! |
|
368 |
||
269 | 369 |
beMaster |
5614 | 370 |
"make this a master-view. |
4032 | 371 |
All slave views within the same windowGroup will be closed if any master is closed |
372 |
and also de/iconify together with their master(s). |
|
373 |
(i.e. they follow their master(s))." |
|
269 | 374 |
|
4256 | 375 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
376 |
type isInteger ifTrue:[ |
5721 | 377 |
type := (type bitClear:MasterSlaveMask) bitOr:TypeMaster. |
378 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
379 |
]. |
269 | 380 |
type := #master |
298 | 381 |
|
382 |
" |
|
383 |
see example in TopView>>beSlave |
|
384 |
" |
|
385 |
||
386 |
"Created: 10.12.1995 / 13:30:50 / cg" |
|
269 | 387 |
! |
388 |
||
389 |
bePartner |
|
5614 | 390 |
"make this a partner-view. Each partner-view will automatically |
712 | 391 |
close other partner views (within the same windowGroup) when closed." |
269 | 392 |
|
4256 | 393 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
394 |
type isInteger ifTrue:[ |
5721 | 395 |
type := (type bitClear:MasterSlaveMask) bitOr:TypePartner. |
396 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
397 |
]. |
5614 | 398 |
type := #partner |
298 | 399 |
|
400 |
" |
|
401 |
create two topViews within the same group: |
|
402 |
if any of them is iconified/deiconified/closed, the other one is also |
|
403 |
||
404 |
|top1 top2| |
|
405 |
||
712 | 406 |
top1 := StandardSystemView new label:'partner'; extent:300@300. |
407 |
top2 := StandardSystemView new label:'partner'; extent:200@200. |
|
298 | 408 |
top1 bePartner. |
409 |
top2 bePartner. |
|
410 |
||
411 |
top1 open. |
|
412 |
top2 openInGroup:(top1 windowGroup) |
|
413 |
" |
|
414 |
||
415 |
"Created: 10.12.1995 / 13:29:59 / cg" |
|
712 | 416 |
"Modified: 25.5.1996 / 11:44:48 / cg" |
269 | 417 |
! |
418 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
419 |
bePopUpView |
4256 | 420 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
421 |
type isInteger ifTrue:[ |
5721 | 422 |
type := (type bitClear:WindowTypeMask) bitOr:TypePopUp. |
423 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
424 |
]. |
5614 | 425 |
type := #popup |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
426 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
427 |
|
5719 | 428 |
bePopUpViewNotModal |
6647 | 429 |
"experimental/unfinished - do not use" |
430 |
||
5719 | 431 |
"/ the nonInteger handling code is for backward compatibility only. |
6647 | 432 |
|
433 |
type isInteger ifTrue:[ |
|
434 |
type := (type bitClear:WindowTypeMask) bitOr:TypePopUpNonModal. |
|
435 |
^ self. |
|
436 |
]. |
|
5719 | 437 |
type := #popUpNotModal |
438 |
! |
|
439 |
||
4798 | 440 |
beScreenDialog |
441 |
"make me a Screen-Dialog Window; that is one which raises above ALL other windows |
|
442 |
(not only st/x ones)" |
|
443 |
||
444 |
"/ the nonInteger handling code is for backward compatibility only. |
|
445 |
type isInteger ifTrue:[ |
|
5721 | 446 |
type := (type bitClear:WindowTypeMask) bitOr:TypeScreenDialog. |
447 |
^ self. |
|
4798 | 448 |
]. |
5614 | 449 |
type := #dialog |
4798 | 450 |
! |
451 |
||
269 | 452 |
beSlave |
453 |
"make this a slave-view. It will be closed automatically, |
|
712 | 454 |
whenever any master of the windowgroup is closed. |
455 |
See also: #bePartner" |
|
269 | 456 |
|
4256 | 457 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
458 |
type isInteger ifTrue:[ |
5721 | 459 |
type := (type bitClear:MasterSlaveMask) bitOr:TypeSlave. |
460 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
461 |
]. |
5614 | 462 |
type := #slave |
298 | 463 |
|
464 |
" |
|
465 |
create two topViews within the same group: |
|
466 |
the slave is allowed to be iconified/close independ of the master; |
|
467 |
but if the master is iconified, the slave is also. |
|
468 |
||
469 |
|top1 top2| |
|
470 |
||
712 | 471 |
top1 := StandardSystemView new label:'master'; extent:300@300. |
472 |
top2 := StandardSystemView new label:'slave'; extent:200@200. |
|
298 | 473 |
top1 beMaster. |
474 |
top2 beSlave. |
|
475 |
||
476 |
top1 open. |
|
477 |
top2 openInGroup:(top1 windowGroup) |
|
478 |
" |
|
479 |
||
480 |
"Created: 10.12.1995 / 13:29:10 / cg" |
|
712 | 481 |
"Modified: 25.5.1996 / 11:45:30 / cg" |
269 | 482 |
! |
483 |
||
4256 | 484 |
beToolDialog |
6647 | 485 |
"make me a tool dialog Window with a smaller title area. |
486 |
Warning: not all window systems support that. Will be normal decorated on some systems (macosx)" |
|
487 |
||
4256 | 488 |
"/ the nonInteger handling code is for backward compatibility only. |
4254 | 489 |
type isInteger ifTrue:[ |
6647 | 490 |
type := (type bitClear:WindowTypeMask) bitOr:TypeToolDialog. |
491 |
^ self. |
|
4254 | 492 |
]. |
5614 | 493 |
type := #dialog |
4254 | 494 |
! |
495 |
||
4256 | 496 |
beToolWindow |
6647 | 497 |
"make me a tool Window with a smaller title area. |
498 |
Warning: not all window systems support that. Will be normal decorated on some systems (macosx)" |
|
499 |
||
4256 | 500 |
"/ the nonInteger handling code is for backward compatibility only. |
501 |
type isInteger ifTrue:[ |
|
6647 | 502 |
type := (type bitClear:WindowTypeMask) bitOr:TypeToolWindow. |
503 |
^ self. |
|
4256 | 504 |
]. |
5614 | 505 |
type := nil |
4256 | 506 |
! |
507 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
508 |
beUndecorated |
6647 | 509 |
"make me an undecorated Window. |
510 |
Warning: not all window systems support that. Will be decorated on some systems (macosx)" |
|
4798 | 511 |
|
4256 | 512 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
513 |
type isInteger ifTrue:[ |
6647 | 514 |
type := (type bitClear:WindowTypeMask) bitOr:TypeUndecorated. |
515 |
^ self. |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
516 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
517 |
type := nil |
6647 | 518 |
|
519 |
" |
|
520 |
TopView new open |
|
521 |
TopView new windowType:#dialog2; open |
|
522 |
TopView new windowType:#notitle; open |
|
523 |
TopView new beDialogView; open |
|
524 |
TopView new bePopUpView; open |
|
525 |
TopView new beToolDialog; open |
|
526 |
TopView new beUndecorated; open |
|
527 |
" |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
528 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
529 |
|
5724 | 530 |
beUndecoratedResizable |
6647 | 531 |
"make me an undecorated but resizable Window" |
532 |
"experimental/unfinished - do not use |
|
533 |
Warning: not all window systems support that. Will be decorated on some systems (macosx)" |
|
534 |
||
535 |
type isInteger ifTrue:[ |
|
536 |
type := (type bitClear:WindowTypeMask) bitOr:TypeUndecoratedResizable. |
|
537 |
^ self. |
|
538 |
]. |
|
5724 | 539 |
type := #undecoratedResizable |
540 |
||
541 |
"Created: / 03-03-2011 / 20:22:14 / cg" |
|
542 |
! |
|
543 |
||
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
544 |
focusSequence:aCollectionOfSubcomponents |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
545 |
"define the sequence for stepping through my components." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
546 |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
547 |
windowGroup isNil ifTrue:[ |
5721 | 548 |
windowGroup := self windowGroupClass new. |
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
549 |
]. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
550 |
windowGroup focusSequence:aCollectionOfSubcomponents. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
551 |
|
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
552 |
"Created: 6.3.1996 / 15:37:11 / cg" |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
553 |
"Modified: 30.4.1996 / 15:41:40 / cg" |
4569 | 554 |
! |
555 |
||
5724 | 556 |
windowType:aTypeSymbol |
557 |
"experimental - do not use" |
|
558 |
||
559 |
type := aTypeSymbol |
|
560 |
||
561 |
"Created: / 03-03-2011 / 20:12:40 / cg" |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
562 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
563 |
|
4836 | 564 |
!TopView methodsFor:'accessing-look'! |
565 |
||
566 |
addTrayIcon:anImageOrForm toolTipMessage:toolTipMessage |
|
567 |
"WIN32 only: add a tray icon for myself; |
|
568 |
may then receive tray*-events in the future." |
|
569 |
||
7265 | 570 |
device |
571 |
addTrayIconFor:self |
|
572 |
icon:anImageOrForm iconMask:nil |
|
573 |
toolTipMessage:toolTipMessage |
|
4836 | 574 |
|
575 |
" |
|
576 |
|v icon| |
|
577 |
||
578 |
v := StandardSystemView new. |
|
579 |
v openAndWait. |
|
580 |
||
581 |
icon := Icon stxIcon. |
|
582 |
v addTrayIcon:icon toolTipMessage:'Hi There' |
|
583 |
" |
|
584 |
||
585 |
"Modified: / 05-11-2007 / 12:10:48 / cg" |
|
8722 | 586 |
! |
587 |
||
588 |
label:labelString iconLabel:iconLabelString |
|
589 |
"/ ignored here - for compat. with StdSysViews |
|
4836 | 590 |
! ! |
591 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
592 |
!TopView methodsFor:'event handling'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
593 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
594 |
keyPress:key x:x y:y |
5614 | 595 |
"notice: this ought to be moved into the upcoming |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
596 |
StandardSystemViewController." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
597 |
|
5614 | 598 |
<resource: #keyboard ( #Tab |
5721 | 599 |
#FocusNext #FocusPrevious |
600 |
#CursorDown #CursorUp ) > |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
601 |
|
932 | 602 |
windowGroup notNil ifTrue:[ |
5721 | 603 |
key == #Tab ifTrue:[ |
604 |
self sensor shiftDown ifTrue:[ |
|
605 |
windowGroup focusPrevious |
|
606 |
] ifFalse:[ |
|
607 |
windowGroup focusNext |
|
608 |
]. |
|
609 |
^ self. |
|
610 |
]. |
|
611 |
(key == #FocusNext or:[key == #CursorDown]) ifTrue:[ |
|
612 |
windowGroup focusNext. |
|
613 |
^ self. |
|
614 |
]. |
|
615 |
(key == #FocusPrevious or:[key == #CursorUp]) ifTrue:[ |
|
616 |
windowGroup focusPrevious. |
|
617 |
^ self. |
|
618 |
]. |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
619 |
]. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
620 |
|
932 | 621 |
super keyPress:key x:x y:y |
622 |
||
4823
3a4246ca2a32
tray stuff only sent to a topView
Claus Gittinger <cg@exept.de>
parents:
4799
diff
changeset
|
623 |
"Created: / 01-02-1996 / 22:08:30 / cg" |
3a4246ca2a32
tray stuff only sent to a topView
Claus Gittinger <cg@exept.de>
parents:
4799
diff
changeset
|
624 |
"Modified: / 31-10-2007 / 01:48:50 / cg" |
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
625 |
! |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
626 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
627 |
showActivity:someMessage |
5614 | 628 |
"some activityNotification shalt be communicated to the user. |
8718 | 629 |
The default here is to ignore it, |
630 |
but it is redefined in StdSysView to present it to the user." |
|
625
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 |
^ self |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
633 |
|
4823
3a4246ca2a32
tray stuff only sent to a topView
Claus Gittinger <cg@exept.de>
parents:
4799
diff
changeset
|
634 |
"Created: / 16-12-1995 / 18:40:13 / cg" |
3a4246ca2a32
tray stuff only sent to a topView
Claus Gittinger <cg@exept.de>
parents:
4799
diff
changeset
|
635 |
"Modified: / 31-10-2007 / 01:48:33 / cg" |
8718 | 636 |
"Modified: / 28-06-2019 / 10:44:14 / Claus Gittinger" |
4836 | 637 |
! |
638 |
||
639 |
trayButtonDoubleClick:buttonNr |
|
640 |
"WIN32 only: double-click in the tray. |
|
641 |
Nothing done here - must be redefined in a subclass" |
|
642 |
||
643 |
^ self |
|
644 |
||
645 |
"Created: / 31-10-2007 / 01:46:27 / cg" |
|
646 |
"Modified: / 05-11-2007 / 12:11:24 / cg" |
|
647 |
! |
|
648 |
||
649 |
trayButtonPress:buttonNr |
|
650 |
"WIN32 only: button-press in the tray. |
|
651 |
Nothing done here - must be redefined in a subclass" |
|
652 |
||
653 |
^ self |
|
654 |
||
655 |
"Created: / 31-10-2007 / 01:25:52 / cg" |
|
656 |
"Modified: / 05-11-2007 / 12:11:21 / cg" |
|
657 |
! |
|
658 |
||
659 |
trayButtonRelease:buttonNr |
|
660 |
"WIN32 only: button-release in the tray. |
|
661 |
Nothing done here - must be redefined in a subclass" |
|
662 |
||
663 |
^ self |
|
664 |
||
665 |
"Created: / 31-10-2007 / 01:25:55 / cg" |
|
666 |
"Modified: / 05-11-2007 / 12:11:19 / cg" |
|
667 |
! |
|
668 |
||
669 |
trayMouseMotion |
|
670 |
"WIN32 only: mouse-motion in the tray. |
|
671 |
Nothing done here - must be redefined in a subclass" |
|
672 |
||
673 |
^ self |
|
674 |
||
675 |
"Created: / 31-10-2007 / 01:25:33 / cg" |
|
676 |
"Modified: / 05-11-2007 / 12:11:17 / cg" |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
677 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
678 |
|
5720 | 679 |
!TopView methodsFor:'event handling-window move'! |
680 |
||
681 |
doWindowMove |
|
6500 | 682 |
"a window move operation |
5720 | 683 |
(only used with modeless popup windows; i.e. windows without decoration, |
684 |
which want to be moved by click-motion on the background)" |
|
685 |
||
686 |
|delta| |
|
687 |
||
688 |
CurrentWindowBeingMoved == self ifTrue:[ |
|
7265 | 689 |
delta := device pointerPosition - CurrentWindowMoveStart. |
690 |
(CurrentWindowMoveState notNil |
|
691 |
or:[ delta r > 5 ]) ifTrue:[ |
|
692 |
CurrentWindowMoveState := #inMove. |
|
693 |
CurrentWindowMoveStart := device pointerPosition. |
|
694 |
self origin:(self origin + delta). |
|
695 |
]. |
|
5720 | 696 |
]. |
697 |
||
698 |
"Created: / 03-03-2011 / 19:13:08 / cg" |
|
699 |
! |
|
700 |
||
701 |
endWindowMove |
|
6500 | 702 |
"a window move operation |
5720 | 703 |
(only used with modeless popup windows; i.e. windows without decoration, |
704 |
which want to be moved by click-motion on the background)" |
|
705 |
||
706 |
CurrentWindowBeingMoved := nil. |
|
707 |
||
708 |
"Created: / 03-03-2011 / 19:17:24 / cg" |
|
709 |
! |
|
710 |
||
711 |
startWindowMove |
|
6500 | 712 |
"a window move operation |
5720 | 713 |
(only used with modeless popup windows; i.e. windows without decoration, |
714 |
which want to be moved by click-motion on the background)" |
|
715 |
||
716 |
CurrentWindowBeingMoved := self. |
|
7265 | 717 |
CurrentWindowMoveStart := device pointerPosition. |
5720 | 718 |
CurrentWindowMoveState := nil. |
719 |
||
720 |
"Created: / 03-03-2011 / 19:09:39 / cg" |
|
5723
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
721 |
! |
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
722 |
|
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
723 |
startWindowMoveOnButtonPress |
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
724 |
"this allows undecorated windows (i.e. modeless popups) to be moved by |
6500 | 725 |
drag-moving in their window area |
5723
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
726 |
(similar to how mac windows and realplayer are moved). |
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
727 |
Return true here, if a window move should be initiated" |
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
728 |
|
7441 | 729 |
^ self isModal not and:[self topView isPopUpView] |
5723
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
730 |
|
d75bdd85df13
added: #startWindowMoveOnButtonPress
Claus Gittinger <cg@exept.de>
parents:
5721
diff
changeset
|
731 |
"Created: / 03-03-2011 / 19:30:59 / cg" |
5720 | 732 |
! ! |
733 |
||
4992
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
734 |
!TopView methodsFor:'help'! |
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
735 |
|
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
736 |
flyByHelpDependsOnPositionIn:aView |
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
737 |
"subclasses where the help-text depends upon the pointer position might |
7335 | 738 |
want to redefine this. |
739 |
If true is returned, the tooltip-process will monitor mouse movements and |
|
740 |
ask for the help text again. |
|
741 |
If false is returned (the default here), it will only look at |
|
742 |
mouse-enter/leave time." |
|
4992
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
743 |
|
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
744 |
^ false |
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
745 |
! ! |
f5ad380a9967
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
746 |
|
2466 | 747 |
!TopView methodsFor:'help stubs'! |
748 |
||
3697 | 749 |
helpTextFor:aSubView |
7093 | 750 |
"this will vanish - it's temporarily here to allow for stdSysViews to be |
3697 | 751 |
used as a masterApp for dialogs" |
752 |
||
753 |
^ nil |
|
754 |
! |
|
755 |
||
2466 | 756 |
showHelp:aHelpText for:aView |
757 |
"dummy - added in case a regular topView is installed |
|
7335 | 758 |
as a dialog's masterApplication. |
2466 | 759 |
Concrete application subclasses may redefine this to |
760 |
display a help text in one of its message areas" |
|
761 |
! ! |
|
762 |
||
3884 | 763 |
!TopView methodsFor:'initialization & release'! |
2573 | 764 |
|
4438 | 765 |
addToCurrentProject |
766 |
"for compatibility with views which can" |
|
767 |
! |
|
768 |
||
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
769 |
assignInitialKeyboardFocus |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
770 |
"assign the initial keyboard focus to a 'useful' component." |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
771 |
|
4180 | 772 |
|componentWithInitialFocus| |
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
773 |
|
4180 | 774 |
"/ |keyboardProcessor componentWithInitialFocus| |
775 |
"/ |
|
776 |
"/ keyboardProcessor := self keyboardProcessor. |
|
777 |
"/ keyboardProcessor notNil ifTrue:[ |
|
778 |
"/ componentWithInitialFocus := keyboardProcessor componentWithInitialFocus. |
|
779 |
"/ componentWithInitialFocus notNil ifTrue:[ |
|
780 |
"/ self windowGroup focusView:componentWithInitialFocus byTab:true. |
|
5614 | 781 |
"/ "/ componentWithInitialFocus requestFocus. |
4180 | 782 |
"/ ^ self. |
783 |
"/ ] |
|
784 |
"/ ]. |
|
785 |
||
5614 | 786 |
(windowGroup notNil |
4180 | 787 |
and:[(componentWithInitialFocus := windowGroup defaultKeyboardConsumer) notNil]) ifTrue:[ |
6791 | 788 |
windowGroup focusView:componentWithInitialFocus byTab:true "false". |
4180 | 789 |
] ifFalse:[ |
6791 | 790 |
self assignKeyboardFocusToFirstKeyboardConsumer. |
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
791 |
]. |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
792 |
! |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
793 |
|
2573 | 794 |
destroy |
795 |
"the receiver is to be destroyed - look for partners and slaves" |
|
796 |
||
797 |
|wg dev| |
|
798 |
||
799 |
wg := windowGroup. "/ have to fetch windowGroup before; |
|
7265 | 800 |
dev := device. "/ and device ... |
2573 | 801 |
super destroy. "/ ... since destroy nils em |
802 |
||
8698 | 803 |
"/ dev notNil ifTrue:[ |
804 |
"/ dev flush |
|
805 |
"/ ]. |
|
2573 | 806 |
|
807 |
"/ |
|
808 |
"/ destroy slaves and partners |
|
809 |
"/ |
|
810 |
self masterSlaveMessage:#destroy inGroup:wg |
|
811 |
||
8698 | 812 |
"Modified: / 20-03-1997 / 22:14:16 / cg" |
813 |
"Modified (format): / 30-05-2019 / 11:04:21 / Claus Gittinger" |
|
3446 | 814 |
! |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
815 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
816 |
initialize |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
817 |
"initialize the topViews position for the screens center" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
818 |
|
7847 | 819 |
<modifier: #super> "must be called if redefined" |
820 |
||
5971 | 821 |
|screenCenter| |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
822 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
823 |
super initialize. |
7265 | 824 |
device initializeTopViewHookFor:self. |
2874
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
825 |
|
5625
09972b8ce40a
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
5620
diff
changeset
|
826 |
"/ MULTI SCREEN |
7265 | 827 |
screenCenter := device centerOfMonitorHavingPointer. |
5614 | 828 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
829 |
left := screenCenter x - (width // 2). |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
830 |
top := screenCenter y - (height // 2). |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
831 |
type := 0 |
5625
09972b8ce40a
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
5620
diff
changeset
|
832 |
|
7847 | 833 |
"Modified: / 08-02-2017 / 00:26:43 / cg" |
2874
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
834 |
! |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
835 |
|
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
836 |
postRealize |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
837 |
super postRealize. |
3370 | 838 |
|
839 |
keyboardProcessor isNil ifTrue:[ |
|
7265 | 840 |
keyboardProcessor := KeyboardProcessor new. |
3370 | 841 |
]. |
842 |
||
7265 | 843 |
device realizedTopViewHookFor:self |
3706 | 844 |
! |
845 |
||
4407 | 846 |
realize |
847 |
self isMarkedAsUnmappedModalBox ifTrue:[ |
|
5721 | 848 |
"/ must clear this flag |
849 |
"/ - otherwise realize thinks it is already realized. |
|
850 |
realized := false. |
|
851 |
self unmarkAsUnmappedModalBox. |
|
4407 | 852 |
]. |
853 |
super realize. |
|
6275 | 854 |
! |
855 |
||
856 |
release |
|
857 |
keyboardProcessor notNil ifTrue:[ |
|
858 |
keyboardProcessor release. |
|
859 |
keyboardProcessor := nil. |
|
860 |
]. |
|
861 |
super release |
|
8698 | 862 |
! |
863 |
||
864 |
rememberLastExtent |
|
865 |
"can be redefined in subclasses to return true |
|
866 |
iff the default size should be the same as the size when last closed. |
|
867 |
If false is returned, the default size is computed from the contents. |
|
868 |
Remembering is useful for file-selection boxes, |
|
869 |
when the user resized the box for many files. |
|
870 |
It is NOT useful for generic box (like information:) which should just |
|
871 |
adopt to their contents. |
|
872 |
Here, false is returned as default, because I am abstract, not knowing what is |
|
873 |
shown in me." |
|
874 |
||
875 |
^ false |
|
876 |
||
877 |
"Created: / 30-05-2019 / 10:58:08 / Claus Gittinger" |
|
3446 | 878 |
! ! |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
879 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
880 |
!TopView methodsFor:'misc'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
881 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
882 |
withCursor:aCursor do:aBlock |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
883 |
"evaluate aBlock while showing aCursor in all my views. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
884 |
Return the value as returned by aBlock." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
885 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
886 |
windowGroup notNil ifTrue:[ |
5721 | 887 |
^ windowGroup withCursor:aCursor do:aBlock |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
888 |
]. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
889 |
^ super withCursor:aCursor do:aBlock |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
890 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
891 |
|
8252 | 892 |
!TopView methodsFor:'private'! |
893 |
||
894 |
helpSpec |
|
895 |
^ self class helpSpec |
|
896 |
! ! |
|
897 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
898 |
!TopView methodsFor:'queries'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
899 |
|
4338 | 900 |
beepWhenOpening |
5620 | 901 |
"can be redefined by error and warnBoxes" |
902 |
||
4338 | 903 |
^ false |
5620 | 904 |
|
905 |
"Modified: / 21-10-2010 / 17:05:08 / cg" |
|
4338 | 906 |
! |
907 |
||
8585 | 908 |
computePreferredExtent |
909 |
"return my preferred extent - this is the minimum size I would like to have. |
|
910 |
The default here is the classes default extent, |
|
911 |
however many subclasses redefine this to compute the actual value |
|
912 |
depending on the sizes of the contents or subcomponents." |
|
913 |
||
914 |
^ self class defaultExtent |
|
915 |
||
916 |
"Created: / 09-11-2018 / 20:03:23 / Claus Gittinger" |
|
917 |
! |
|
918 |
||
269 | 919 |
heightIncludingBorder |
7694 | 920 |
"return the view's overall-height" |
269 | 921 |
|
922 |
^ height |
|
923 |
! |
|
924 |
||
925 |
isCollapsed |
|
926 |
"ST80 compatibility: return true if the view is not shown (i.e. iconified)" |
|
927 |
||
1536 | 928 |
"/ ^ device windowIsIconified:drawableId |
269 | 929 |
^ shown not |
1536 | 930 |
|
931 |
"Modified: 4.4.1997 / 14:44:39 / cg" |
|
269 | 932 |
! |
933 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
934 |
isDialogView |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
935 |
"return true if this is a dialog view" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
936 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
937 |
type isInteger ifTrue:[ |
5721 | 938 |
^ (type bitAnd:WindowTypeMask) == TypeDialog |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
939 |
]. |
4256 | 940 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
941 |
^ type == #dialog |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
942 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
943 |
|
4500 | 944 |
isMDIClientView |
5724 | 945 |
type isInteger ifFalse:[^ false]. |
946 |
||
4498 | 947 |
^ (type bitAnd:MDIClientMask) == MDIClient. |
5724 | 948 |
|
949 |
"Modified: / 03-03-2011 / 20:14:09 / cg" |
|
4498 | 950 |
! |
951 |
||
3620 | 952 |
isMaster |
953 |
"return true, if this is a masterView" |
|
954 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
955 |
type isInteger ifTrue:[ |
5721 | 956 |
^ (type bitAnd:MasterSlaveMask) == TypeMaster |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
957 |
]. |
4256 | 958 |
"/ the nonInteger handling code is for backward compatibility only. |
3620 | 959 |
^ type == #master |
960 |
! |
|
961 |
||
3347 | 962 |
isModal |
963 |
"return true, if the receiver has been opened modal" |
|
964 |
||
965 |
windowGroup isNil ifTrue:[^ false]. |
|
3446 | 966 |
^ windowGroup isModal |
967 |
! |
|
3347 | 968 |
|
3621 | 969 |
isPartner |
970 |
"return true, if this is a partnerView" |
|
971 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
972 |
type isInteger ifTrue:[ |
5721 | 973 |
^ (type bitAnd:MasterSlaveMask) == TypePartner |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
974 |
]. |
4256 | 975 |
"/ the nonInteger handling code is for backward compatibility only. |
3621 | 976 |
^ type == #partner |
977 |
! |
|
978 |
||
1398 | 979 |
isPopUpView |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
980 |
"return true if I am a popup view. |
5718 | 981 |
(i.e. I want to come up without any decoration and popUp to top immediately)" |
1398 | 982 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
983 |
type isInteger ifTrue:[ |
6500 | 984 |
^ (type bitAnd:WindowTypeMask) == TypePopUp |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
985 |
]. |
4256 | 986 |
"/ the nonInteger handling code is for backward compatibility only. |
1398 | 987 |
^ type == #popup |
988 |
||
5718 | 989 |
"Created: / 28-02-1997 / 22:12:30 / cg" |
990 |
"Modified: / 03-03-2011 / 15:00:35 / cg" |
|
1398 | 991 |
! |
992 |
||
4798 | 993 |
isScreenDialog |
994 |
"return true if I am a screen dialog view. |
|
5656 | 995 |
(i.e. I want to come up above all other windows)" |
4798 | 996 |
|
997 |
type isInteger ifTrue:[ |
|
6500 | 998 |
^ (type bitAnd:WindowTypeMask) == TypeScreenDialog |
4798 | 999 |
]. |
1000 |
"/ the nonInteger handling code is for backward compatibility only. |
|
1001 |
^ false |
|
5656 | 1002 |
|
1003 |
"Modified: / 01-12-2010 / 12:15:59 / cg" |
|
4798 | 1004 |
! |
1005 |
||
3620 | 1006 |
isSlave |
1007 |
"return true, if this is a slaveView" |
|
1008 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1009 |
type isInteger ifTrue:[ |
5721 | 1010 |
^ (type bitAnd:MasterSlaveMask) == TypeSlave |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1011 |
]. |
4256 | 1012 |
"/ the nonInteger handling code is for backward compatibility only. |
3620 | 1013 |
^ type == #slave |
1014 |
! |
|
1015 |
||
4256 | 1016 |
isToolDialog |
1017 |
"return true if I am a toolWindow dialog view. |
|
5717 | 1018 |
(i.e. I want to come up with a smaller window-title area, without minimize and maximize buttons)" |
4256 | 1019 |
|
1020 |
type isInteger ifTrue:[ |
|
6500 | 1021 |
^ (type bitAnd:WindowTypeMask) == TypeToolDialog |
4256 | 1022 |
]. |
1023 |
"/ the nonInteger handling code is for backward compatibility only. |
|
1024 |
^ false |
|
5717 | 1025 |
|
1026 |
"Modified: / 03-03-2011 / 14:59:42 / cg" |
|
4256 | 1027 |
! |
1028 |
||
4254 | 1029 |
isToolWindow |
1030 |
"return true if I am a toolWindow view. |
|
5717 | 1031 |
(i.e. I want to come up with a smaller window-title area, without minimize and maximize buttons)" |
4254 | 1032 |
|
1033 |
type isInteger ifTrue:[ |
|
6500 | 1034 |
^ (type bitAnd:WindowTypeMask) == TypeToolWindow |
4254 | 1035 |
]. |
4256 | 1036 |
"/ the nonInteger handling code is for backward compatibility only. |
1037 |
^ false |
|
5717 | 1038 |
|
1039 |
"Modified: / 03-03-2011 / 14:59:38 / cg" |
|
4254 | 1040 |
! |
1041 |
||
1481 | 1042 |
isTopView |
1043 |
"return true, since I am a topView" |
|
1044 |
||
1045 |
^ true |
|
1046 |
||
1047 |
"Created: 22.3.1997 / 14:45:55 / cg" |
|
1048 |
! |
|
1049 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1050 |
isUndecoratedView |
5717 | 1051 |
"return true if I am an undecorated view (no minimize, maximize and close buttons)." |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1052 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1053 |
type isInteger ifTrue:[ |
6500 | 1054 |
^ (type bitAnd:WindowTypeMask) == TypeUndecorated |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1055 |
]. |
4256 | 1056 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1057 |
^ false |
5717 | 1058 |
|
1059 |
"Modified: / 03-03-2011 / 15:00:22 / cg" |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1060 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1061 |
|
269 | 1062 |
widthIncludingBorder |
7694 | 1063 |
"return the view's overall-width" |
269 | 1064 |
|
1065 |
^ width |
|
2808
627ce4f2a090
respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
1066 |
! |
627ce4f2a090
respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
1067 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1068 |
windowStyle |
4254 | 1069 |
"return a symbol describing my style which should be one of |
1070 |
#dialog, #popUp, #undecorated, #normal or #toolWindow. |
|
1071 |
This is used by the device as a decoration hint." |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1072 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1073 |
|t| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1074 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1075 |
type isInteger ifTrue:[ |
6647 | 1076 |
t := type bitAnd:WindowTypeMask. |
1077 |
t == TypeUndecorated ifTrue:[^ #undecorated]. |
|
1078 |
t == TypeDialog ifTrue:[^ #dialog]. |
|
1079 |
t == TypePopUp ifTrue:[^ #popUp]. |
|
1080 |
t == TypeToolWindow ifTrue:[^ #toolWindow]. |
|
1081 |
t == TypeToolDialog ifTrue:[^ #toolDialog]. |
|
1082 |
t == TypeUndecoratedResizable ifTrue:[^ #dialog]. |
|
1083 |
t == TypePopUpNonModal ifTrue:[^ #undecorated ]. |
|
1084 |
^ #normal |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1085 |
]. |
4256 | 1086 |
"/ the nonInteger handling code is for backward compatibility only. |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1087 |
^ super windowStyle |
269 | 1088 |
! ! |
1089 |
||
3881 | 1090 |
!TopView methodsFor:'show & hide'! |
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1091 |
|
4353 | 1092 |
activate |
1093 |
"added for MS-windows - much like raise. |
|
1094 |
Raise/Activate seem to work only within my own (ST/X)-windows; |
|
1095 |
they do not raise one of my views above another (for example: command.com)-window. |
|
5614 | 1096 |
Can anyone tell me what the difference between raise, activate and setForeground |
4353 | 1097 |
really is (I mean really - not what is written in the crappy documentation)" |
1098 |
||
6589 | 1099 |
|id| |
1100 |
||
1101 |
(id := self drawableId) isNil ifTrue:[ |
|
1102 |
self create. |
|
1103 |
id := self drawableId |
|
8673 | 1104 |
] ifFalse:[ |
1105 |
self raiseDeiconified. |
|
6589 | 1106 |
]. |
7265 | 1107 |
device |
6589 | 1108 |
activateWindow:id; |
1109 |
focusView:self |
|
4353 | 1110 |
|
1111 |
" |
|
1112 |
Transcript topView activate |
|
1113 |
" |
|
8673 | 1114 |
|
1115 |
"Modified: / 20-04-2019 / 09:12:55 / Claus Gittinger" |
|
4353 | 1116 |
! |
1117 |
||
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1118 |
fixPosition:aPoint |
5614 | 1119 |
"set origin to aPoint, but make sure, that the box is fully visible |
8040 | 1120 |
by shifting it into the visible screen area if necessary. |
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1121 |
This prevents invisible modalBoxes (which you could never close)." |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1122 |
|
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1123 |
self origin:aPoint. |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1124 |
self makeFullyVisible |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1125 |
|
8040 | 1126 |
"Created: / 28-02-1997 / 16:39:31 / cg" |
1127 |
"Modified (comment): / 30-05-2017 / 17:43:00 / mawalch" |
|
1401
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1128 |
! |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1129 |
|
5272
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1130 |
hide |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1131 |
|masterGroup myApplication| |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1132 |
|
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1133 |
realized ifFalse:[^ self]. |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1134 |
|
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1135 |
"/ if I am a modal-opened application's view |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1136 |
"/ (for example, an UIPainter) give it a chance |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1137 |
"/ to intercept the hide. |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1138 |
"/ Q: shouln't this be done in the windowGroup, |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1139 |
"/ by sending a closerequest always and letting popUps |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1140 |
"/ respond by hiding ??? |
5287 | 1141 |
|
5272
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1142 |
(windowGroup notNil |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1143 |
and:[ windowGroup isModal ]) ifTrue:[ |
5721 | 1144 |
masterGroup := windowGroup previousGroup. |
1145 |
myApplication := self application. |
|
5272
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1146 |
|
5721 | 1147 |
(myApplication notNil |
1148 |
and:[ masterGroup isNil or:[myApplication ~= masterGroup application]]) ifTrue:[ |
|
1149 |
AbortOperationRequest handle:[:ex | |
|
6500 | 1150 |
"/ in case the close is caught by the application |
5721 | 1151 |
^ self. |
1152 |
] do:[ |
|
1153 |
myApplication closeRequest. |
|
5287 | 1154 |
|
5721 | 1155 |
"/ if myApp called closeDownViews, it wants me to hide. |
1156 |
"/ otherwise, it has redefined closeRequest to return without closeDownViews. |
|
1157 |
realized ifTrue:[ |
|
1158 |
"/ closeDownViews was not called - app wants me to remain open |
|
1159 |
^ self |
|
1160 |
]. |
|
1161 |
]. |
|
1162 |
]. |
|
5272
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1163 |
]. |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1164 |
super hide. |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1165 |
! |
2e4ccb226a3f
hide redefined to allow abort in close.
Claus Gittinger <cg@exept.de>
parents:
5261
diff
changeset
|
1166 |
|
3916 | 1167 |
map |
1168 |
"make the view visible on the screen. |
|
1169 |
For topViews, the windowManager will choose (or ask for) the |
|
1170 |
views position on the screen. |
|
1171 |
Notice: |
|
5721 | 1172 |
Actually, this method is only valid for topViews; |
1173 |
however, it is defined here to allow things like 'Button new realize'" |
|
3916 | 1174 |
|
1175 |
self mapAt:(self origin) iconified:false |
|
1176 |
! |
|
1177 |
||
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1178 |
mapIconified |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1179 |
"make the view visible but iconified. |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1180 |
In contrast to map, which does it non-iconified" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1181 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1182 |
realized ifFalse:[ |
7265 | 1183 |
" |
1184 |
now, make the view visible |
|
1185 |
" |
|
1186 |
realized := true. |
|
1187 |
device |
|
1188 |
mapView:self id:self drawableId iconified:true |
|
1189 |
atX:left y:top width:width height:height |
|
1190 |
minExtent:(self minExtent) maxExtent:(self maxExtent) |
|
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1191 |
] |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1192 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1193 |
"Modified: 25.2.1997 / 22:44:33 / cg" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1194 |
"Created: 24.7.1997 / 12:48:21 / cg" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1195 |
! |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1196 |
|
8485 | 1197 |
openModal |
1198 |
"added bell to wake up user" |
|
1199 |
||
1200 |
(self beepWhenOpening) ifTrue:[ |
|
1201 |
self beep. |
|
1202 |
]. |
|
1203 |
super openModal |
|
1204 |
||
1205 |
" |
|
1206 |
self warn:'hello' |
|
1207 |
self information:'hello' |
|
1208 |
ModalBox new openModal |
|
1209 |
WarningBox new openModal |
|
1210 |
InfoBox new openModal |
|
1211 |
" |
|
1212 |
||
1213 |
"Modified: 28.5.1996 / 16:59:01 / cg" |
|
1214 |
! |
|
1215 |
||
1401
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1216 |
positionOffset |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1217 |
"return the delta, by which the box should be |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1218 |
displaced from the mouse pointer. |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1219 |
Here, the boxes center is returned as a default. |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1220 |
Usually redefined in subclasses to have the most convenient |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1221 |
ok-button appear under the pointer." |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1222 |
|
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1223 |
^ self extent // 2 |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1224 |
|
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
1225 |
"Created: 28.2.1997 / 22:56:34 / cg" |
4353 | 1226 |
! |
1227 |
||
8485 | 1228 |
raiseDeiconified |
1229 |
"deiconify & bring to front" |
|
1230 |
||
1231 |
self isCollapsed ifTrue:[ |
|
8682 | 1232 |
self map. |
1233 |
"/ This was realize until 2019-05-24. |
|
1234 |
"/ realize has the (very bad) effect, that this is called again: |
|
1235 |
"/ postRealize -> ApplicationModel>>#opened -> #postOpenWith |
|
1236 |
"/ Expecco::Browser>>#installToolbarMenus (or, worse #automaticRepopenLastUsedTestSuiteOnStart) |
|
1237 |
"/ self realize. |
|
8485 | 1238 |
]. |
1239 |
self raise |
|
1240 |
||
1241 |
" |
|
1242 |
Transcript topView raiseDeiconified |
|
1243 |
" |
|
1244 |
||
1245 |
"Modified: / 03-05-1996 / 23:49:36 / stefan" |
|
8638 | 1246 |
"Modified (format): / 23-02-2019 / 18:52:52 / Claus Gittinger" |
8682 | 1247 |
"Modified (comment): / 24-05-2019 / 12:17:09 / Stefan Vogel" |
8485 | 1248 |
! |
1249 |
||
4353 | 1250 |
setForegroundWindow |
4522 | 1251 |
"make a window the foreground window (so raise and activate it). |
1252 |
Under Win 98/Me/XP/2000 the window is not raised/activated, if a window from |
|
1253 |
a different process is currently active - in this case the title bar/icon is flashed. |
|
4974
bd8ff34bd381
Comment in #raise/#setForegroundWindow
Stefan Vogel <sv@exept.de>
parents:
4961
diff
changeset
|
1254 |
this also raises the priority of the sending thread slightly. |
bd8ff34bd381
Comment in #raise/#setForegroundWindow
Stefan Vogel <sv@exept.de>
parents:
4961
diff
changeset
|
1255 |
|
5614 | 1256 |
Mark a TopView as #beScreenDialog, to send this on open." |
4353 | 1257 |
|
6275 | 1258 |
self drawableId isNil ifTrue:[self create]. |
7265 | 1259 |
device setForegroundWindow:self drawableId |
4353 | 1260 |
|
1261 |
" |
|
4974
bd8ff34bd381
Comment in #raise/#setForegroundWindow
Stefan Vogel <sv@exept.de>
parents:
4961
diff
changeset
|
1262 |
Transcript topView raise |
4353 | 1263 |
Transcript topView setForegroundWindow |
1264 |
" |
|
8485 | 1265 |
! |
1266 |
||
1267 |
waitUntilClosed |
|
1268 |
"wait until the receiver has been closed. |
|
1269 |
Can be used to synchronize multiple-window applications, |
|
1270 |
and (especially) to wait until an application session is finished |
|
1271 |
when invoking commands with the rDoit mechanism" |
|
1272 |
||
1273 |
[self drawableId isNil] whileFalse:[ |
|
1274 |
Delay waitForSeconds:0.1. |
|
1275 |
]. |
|
1276 |
||
1277 |
"asynchronous: |
|
1278 |
||
1279 |
EditTextView open |
|
1280 |
" |
|
1281 |
||
1282 |
"synchronous: |
|
1283 |
||
1284 |
EditTextView open topView waitUntilClosed |
|
1285 |
" |
|
1286 |
||
1287 |
"Modified: / 20.5.1998 / 18:03:37 / cg" |
|
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1288 |
! ! |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1289 |
|
269 | 1290 |
!TopView methodsFor:'startup'! |
1291 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1292 |
openAt:aPosition transientFor:anotherView |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1293 |
"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
|
1294 |
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
|
1295 |
(i.e. suppress any ghostframe). |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1296 |
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
|
1297 |
anotherView - it will deiconify with it and (on some windowManagers) |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1298 |
have no iconify button of its own. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1299 |
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
|
1300 |
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
|
1301 |
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
|
1302 |
|
5887 | 1303 |
<resource: #obsolete> |
1304 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1305 |
|otherId| |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1306 |
|
5887 | 1307 |
self obsoleteMethodWarning. |
1308 |
||
6275 | 1309 |
self drawableId isNil ifTrue:[self create]. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1310 |
anotherView isNil ifTrue:[ |
7265 | 1311 |
otherId := self drawableId. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1312 |
] ifFalse:[ |
7265 | 1313 |
anotherView create. |
8489 | 1314 |
otherId := anotherView drawableId. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1315 |
]. |
7265 | 1316 |
device setTransient:self drawableId for:otherId. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1317 |
self origin:aPosition. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1318 |
self open |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1319 |
|
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1320 |
" |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1321 |
|v1 v2| |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1322 |
|
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1323 |
v1 := StandardSystemView extent:300@300. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1324 |
v2 := StandardSystemView extent:300@300. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1325 |
v1 open. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1326 |
v2 openAt:0@0 transientFor:v1. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1327 |
" |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1328 |
|
960 | 1329 |
" |
1330 |
|v1| |
|
1331 |
||
1332 |
v1 := StandardSystemView extent:300@300. |
|
1333 |
v1 openAt:0@0 transientFor:v1. |
|
1334 |
" |
|
1335 |
||
8489 | 1336 |
"Created: / 28-06-1996 / 10:51:55 / cg" |
1337 |
"Modified: / 28-07-1997 / 18:53:16 / cg" |
|
1338 |
"Modified: / 01-10-2018 / 17:06:25 / Claus Gittinger" |
|
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1339 |
! |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1340 |
|
1353 | 1341 |
openDisplayAt:aPoint |
1342 |
"ST-80 compatibility: open the view centered around aPoint" |
|
1343 |
||
1344 |
^ self openModelessAt:(aPoint - (self extent//2)) |
|
1345 |
||
1346 |
" |
|
1347 |
(TopView new extent:200@200) openDisplayAt:300@300 |
|
1348 |
" |
|
1349 |
! |
|
1350 |
||
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1351 |
openIconified |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1352 |
"open the view in iconified state" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1353 |
|
1829 | 1354 |
self openModelessAt:nil iconified:true |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1355 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1356 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1357 |
FileBrowser new openIconified |
1829 | 1358 |
ChangesBrowser new openIconified |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1359 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1360 |
|
1829 | 1361 |
"Modified: 24.7.1997 / 14:54:58 / cg" |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1362 |
! |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
1363 |
|
1336 | 1364 |
openIn:aBoundaryRectangle |
5614 | 1365 |
"set origin & extent and open. |
7233 | 1366 |
The given extent overrides the receiver's preferredExtent. |
1336 | 1367 |
Added for ST-80 compatibility" |
1368 |
||
5614 | 1369 |
self |
7233 | 1370 |
origin:aBoundaryRectangle origin; |
1371 |
extent:aBoundaryRectangle extent; |
|
1372 |
sizeFixed:true. |
|
1336 | 1373 |
self open |
1374 |
||
1375 |
"Modified: 12.2.1997 / 11:58:21 / cg" |
|
1376 |
! |
|
1377 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1378 |
openTransientAt:aPosition |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1379 |
"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
|
1380 |
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
|
1381 |
(i.e. suppress any ghostframe). |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1382 |
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
|
1383 |
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
|
1384 |
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
|
1385 |
|
5887 | 1386 |
<resource: #obsolete> |
1387 |
self obsoleteMethodWarning. |
|
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1388 |
self openAt:aPosition transientFor:nil |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1389 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1390 |
"normal open: |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1391 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1392 |
|v| |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1393 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1394 |
v := StandardSystemView extent:300@300. |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1395 |
v open |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1396 |
" |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1397 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1398 |
"open at position: |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1399 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1400 |
|v| |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1401 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1402 |
v := StandardSystemView extent:300@300. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1403 |
v openTransientAt:10@10 |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1404 |
" |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1405 |
|
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
1406 |
"Created: 28.6.1996 / 10:52:30 / cg" |
909
d2d624d57f61
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
1407 |
"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
|
1408 |
! |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1409 |
|
269 | 1410 |
openWithExtent:anExtent |
5614 | 1411 |
"set extent and open. The given extent overrides the |
7233 | 1412 |
receiver's preferredExtent. |
269 | 1413 |
Added for ST-80 compatibility" |
1414 |
||
1415 |
self extent:anExtent; sizeFixed:true. |
|
1416 |
self open |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1417 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1418 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1419 |
openWithPriority:aPriority |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1420 |
"open the view, run the windowgroup process at |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1421 |
other than UserScehdulingPriority." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1422 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1423 |
self open. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1424 |
windowGroup process priority:aPriority. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1425 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
1426 |
"Created: 30.4.1996 / 15:34:44 / cg" |
269 | 1427 |
! ! |
1428 |
||
157 | 1429 |
!TopView methodsFor:'window events'! |
1430 |
||
5614 | 1431 |
mapped |
7233 | 1432 |
"the receiver was mapped (i.e. deiconified); |
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1433 |
look for partners and slaves." |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1434 |
|
5614 | 1435 |
realized := true. |
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1436 |
super mapped. |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1437 |
|
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1438 |
"/ |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1439 |
"/ map slaves and partners |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1440 |
"/ |
2799
e7b1ea0db727
partners must be remapped (at the old position)
Claus Gittinger <cg@exept.de>
parents:
2693
diff
changeset
|
1441 |
self masterSlaveMessage:#remap inGroup:windowGroup. |
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1442 |
|
3347 | 1443 |
self isModal ifTrue:[ |
7233 | 1444 |
"take it away from any popup menu possibly still active" |
3347 | 1445 |
|
7233 | 1446 |
self forceUngrabKeyboard. |
1447 |
self forceUngrabPointer. |
|
1448 |
" |
|
1449 |
get the focus |
|
1450 |
" |
|
1451 |
self getKeyboardFocus. |
|
1452 |
self enableEnterLeaveEvents |
|
3347 | 1453 |
] ifFalse:[ |
7233 | 1454 |
" |
1455 |
ask for the focus - this avoids having to click on the |
|
1456 |
view with WM's which need an explicit click. |
|
1457 |
Q: is this a good idea ? |
|
1458 |
" |
|
1459 |
TakeFocusWhenMapped == true ifTrue:[ |
|
1460 |
self getKeyboardFocus. |
|
1461 |
] |
|
4355 | 1462 |
]. |
7265 | 1463 |
device isWindowsPlatform ifTrue:[ |
7233 | 1464 |
self raise |
4355 | 1465 |
]. |
5658 | 1466 |
false "self isScreenDialog" ifTrue:[ |
7233 | 1467 |
self setForegroundWindow. |
1468 |
self activate. |
|
4799
b91607dae5bb
if marked as ScreenDialog, raise above ALL windows.
Michael Beyl <mb@exept.de>
parents:
4798
diff
changeset
|
1469 |
]. |
5666 | 1470 |
subViews notNil ifTrue:[ |
7233 | 1471 |
subViews do:[:eachSubView | eachSubView topViewWasMapped ]. |
5666 | 1472 |
] |
3347 | 1473 |
|
5666 | 1474 |
"Modified: / 09-12-2010 / 18:13:20 / cg" |
3446 | 1475 |
! |
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
1476 |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1477 |
masterSlaveMessage:aSelector inGroup:aWindowGroup |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1478 |
"send aSelector to partners and/or slaves. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1479 |
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
|
1480 |
|
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1481 |
aWindowGroup notNil ifTrue:[ |
5721 | 1482 |
"/ |
1483 |
"/ if I am a master or partner, send to all slaves |
|
1484 |
"/ |
|
1485 |
(self isMaster or:[self isPartner]) ifTrue:[ |
|
1486 |
aWindowGroup slavesDo:[:v | v perform:aSelector]. |
|
1487 |
]. |
|
1488 |
"/ |
|
1489 |
"/ if I am a partner, send to all partners |
|
1490 |
"/ |
|
1491 |
self isPartner ifTrue:[ |
|
1492 |
aWindowGroup partnersDo:[:v | v ~~ self ifTrue:[v perform:aSelector]]. |
|
1493 |
]. |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1494 |
]. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1495 |
! |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1496 |
|
5614 | 1497 |
unmapped |
7233 | 1498 |
"the receiver was unmapped (i.e. iconified); |
157 | 1499 |
look for partners and slaves." |
1500 |
||
3035 | 1501 |
|r| |
1502 |
||
1503 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
7233 | 1504 |
"keep the realized flag true (to avoid exiting the modal event loop). |
1505 |
Consider this a kludge." |
|
1506 |
self markAsUnmappedModalBox. |
|
1507 |
r := realized. |
|
3035 | 1508 |
] ifFalse:[ |
7233 | 1509 |
self unmarkAsUnmappedModalBox. |
1510 |
r := realized := false. |
|
3035 | 1511 |
]. |
4407 | 1512 |
super unmapped. |
1513 |
realized := r. |
|
419
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1514 |
|
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1515 |
"/ |
775 | 1516 |
"/ unmap slaves and partners |
419
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1517 |
"/ |
658 | 1518 |
self masterSlaveMessage:#unmap inGroup:windowGroup |
157 | 1519 |
|
775 | 1520 |
"Modified: 30.5.1996 / 09:37:22 / cg" |
157 | 1521 |
! ! |
1522 |
||
1160 | 1523 |
!TopView class methodsFor:'documentation'! |
135 | 1524 |
|
269 | 1525 |
version |
7093 | 1526 |
^ '$Header$' |
5614 | 1527 |
! |
1528 |
||
1529 |
version_CVS |
|
7093 | 1530 |
^ '$Header$' |
135 | 1531 |
! ! |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1532 |
|
6033
4e9ab193b90f
moved assignKeyboardFocus stuff from topView
Claus Gittinger <cg@exept.de>
parents:
5971
diff
changeset
|
1533 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1534 |
TopView initialize! |