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