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