author | Claus Gittinger <cg@exept.de> |
Tue, 09 Jul 2019 20:21:23 +0200 | |
changeset 8723 | 19df60b6bd06 |
parent 8712 | c776d7612ed1 |
child 8782 | f24ac196172d |
permissions | -rw-r--r-- |
8723 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
6 | 4 |
COPYRIGHT (c) 1989 by Claus Gittinger |
72 | 5 |
All Rights Reserved |
0 | 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 |
" |
|
3210 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
6721 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
135 | 18 |
TopView subclass:#StandardSystemView |
1539 | 19 |
instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed |
3408
42384f123133
Add labelChannel and visibilityChannel to WindowSpec/StandardSystemView
Stefan Vogel <sv@exept.de>
parents:
3393
diff
changeset
|
20 |
application windowEventsForApplication deviceIcon labelChannel' |
7398 | 21 |
classVariableNames:'DefaultExtent DefaultIcon DefaultMinExtent IncludeHostNameInLabel |
22 |
TimedRaiseAction WindowLabelFormat' |
|
328 | 23 |
poolDictionaries:'' |
24 |
category:'Views-Basic' |
|
0 | 25 |
! |
26 |
||
4566 | 27 |
!StandardSystemView class methodsFor:'documentation'! |
46 | 28 |
|
4566 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
32 |
All Rights Reserved |
|
0 | 33 |
|
4566 | 34 |
This software is furnished under a license and may be used |
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
0 | 42 |
|
4566 | 43 |
documentation |
44 |
" |
|
5613 | 45 |
I represent standard application topViews |
46 |
i.e. those views which have a title-label, an icon etc. |
|
4566 | 47 |
|
48 |
The name `StandardSystemView' is probably misleading and |
|
49 |
results from ST-80 (rel2.x) compatibility reasons. |
|
50 |
Think of it as an ApplicationWindow. |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
51 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
52 |
|
4566 | 53 |
In ST/X, StandardSystemViews were subclassed for special views |
54 |
in the past (for example: FileBrowser, ChangesBrowser etc.). |
|
55 |
Although this worked, it may lead to the following |
|
56 |
problems and inconveniences: |
|
7587 | 57 |
- applications inherit a big number of methods through the |
58 |
SimpleView->View->TopView->StandardSystemView hierarchy. |
|
59 |
There is quite a danger that by accident, some method gets |
|
60 |
redefined which is required by one of those classes. |
|
61 |
(typical candidates are: terminate, destroy, open ...) |
|
62 |
This may lead to strange effects, which may not be obvious to |
|
63 |
non experts ... |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
64 |
|
7587 | 65 |
- applications with multiple topViews are difficult to implement |
66 |
and manage. |
|
4566 | 67 |
|
7587 | 68 |
- use of a windowBuilder is difficult. |
4566 | 69 |
|
70 |
For all those reasons, we HIGHLY recommend to NOT define applications |
|
71 |
as subclasses of StandardSystemView, but instead base them on |
|
72 |
ApplicationModel, and reference the topView(s) as instance variables of |
|
73 |
if (if at all). |
|
74 |
||
75 |
[instance variables:] |
|
7587 | 76 |
label <String> the label in the windows title |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
77 |
|
7587 | 78 |
icon <Form> the icon |
79 |
[ignored if the display does not |
|
80 |
support icons] |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
81 |
|
7587 | 82 |
iconView <View> an optional icon-view (for animated icons) |
83 |
[ignored if the display does not |
|
84 |
supports this] |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
85 |
|
7587 | 86 |
iconLabel <String> the label in the icon |
87 |
[ignored if the display does not |
|
88 |
support label-tabs with icons] |
|
4566 | 89 |
|
7587 | 90 |
minExtent <Point> the minimum size |
91 |
No limit, if nil |
|
92 |
[the window manager may have its own |
|
93 |
limit; typically some small area] |
|
4566 | 94 |
|
7587 | 95 |
maxExtent <Point> the maximum size |
96 |
No limit, if nil. |
|
97 |
[the window manager may have its own |
|
98 |
limit; typically the screen size] |
|
4566 | 99 |
|
7587 | 100 |
sizeFixed <Boolean> prevents the view from resizing itself |
8058 | 101 |
(especially to freeze a dialog's size) |
4566 | 102 |
|
7587 | 103 |
application <AppModel> if nonNil, that's the application |
104 |
Many requests (such as open/close etc. |
|
105 |
are forwarded to it, if present. |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
106 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
107 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
108 |
|
4566 | 109 |
[class variables:] |
110 |
||
7587 | 111 |
DefaultIcon <Form> cached default icon |
4566 | 112 |
|
7587 | 113 |
TakeFocusWhenMapped <Boolean> if true, views grab the keyboard |
114 |
focus (convenient with some stupid |
|
115 |
windowManagers) |
|
4566 | 116 |
|
7587 | 117 |
IncludeHostNameInLabel <Boolean> if true, the windows title shall |
118 |
include the hostname. |
|
119 |
(convenient if you have many remote |
|
120 |
views open simultaneously) |
|
4566 | 121 |
|
7587 | 122 |
WindowLabelFormat <Boolean> specifies the format for windowLabels |
4566 | 123 |
|
124 |
||
125 |
[author:] |
|
7587 | 126 |
Claus Gittinger |
4566 | 127 |
|
128 |
[see also:] |
|
7587 | 129 |
WindowGroup |
130 |
ApplicationModel |
|
4566 | 131 |
" |
132 |
! |
|
133 |
||
134 |
examples |
|
135 |
" |
|
136 |
simple, empty topView: |
|
137 |
[exBegin] |
|
138 |
|topView| |
|
139 |
||
140 |
topView := StandardSystemView new. |
|
141 |
topView label:'my first view'. |
|
142 |
topView extent:200 @ 200. |
|
143 |
topView open. |
|
144 |
[exEnd] |
|
145 |
||
146 |
with an icon & iconLabel: |
|
147 |
[exBegin] |
|
148 |
|topView| |
|
149 |
||
150 |
topView := StandardSystemView extent:200 @ 200. |
|
151 |
topView label:'Hello world'. |
|
152 |
||
153 |
topView icon:(Image fromFile:'hello_world.icon'). |
|
154 |
topView open. |
|
155 |
[exEnd] |
|
156 |
||
157 |
||
158 |
with an animated iconView [not supported on all display devices]: |
|
159 |
[exBegin] |
|
160 |
|iconView topView| |
|
161 |
||
162 |
iconView := ClockView new. |
|
163 |
||
164 |
topView := StandardSystemView extent:200 @ 200. |
|
165 |
topView label:'Hello world'. |
|
166 |
||
167 |
topView iconView:iconView. |
|
168 |
topView open. |
|
169 |
[exEnd] |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
170 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
171 |
|
4566 | 172 |
placing a subView into it: |
173 |
[exBegin] |
|
174 |
|topView button| |
|
175 |
||
176 |
topView := StandardSystemView new. |
|
177 |
topView label:'my second view'. |
|
178 |
topView extent:200 @ 200. |
|
179 |
||
180 |
button := Button label:'close' in:topView. |
|
181 |
button action:[topView destroy]. |
|
182 |
||
183 |
topView open. |
|
184 |
[exEnd] |
|
185 |
||
186 |
same, relative sized subview: |
|
187 |
[exBegin] |
|
188 |
|topView button| |
|
189 |
||
190 |
topView := StandardSystemView new. |
|
191 |
topView label:'my second view'. |
|
192 |
topView extent:200 @ 200. |
|
193 |
||
194 |
button := Button label:'close' in:topView. |
|
195 |
button action:[topView destroy]. |
|
196 |
button origin:0.25 @ 0.25 corner:0.75 @ 0.75. |
|
197 |
||
198 |
topView open. |
|
199 |
[exEnd] |
|
200 |
||
201 |
multiple buttons in a panel in a topView: |
|
202 |
[exBegin] |
|
203 |
|topView panel button1 button2 button3| |
|
204 |
||
205 |
topView := StandardSystemView new. |
|
206 |
topView label:'my second view'. |
|
207 |
topView extent:200 @ 200. |
|
208 |
||
209 |
panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:topView. |
|
210 |
panel inset:10. |
|
211 |
panel level:-1. |
|
212 |
||
213 |
button1 := Button label:'one' in:panel. |
|
214 |
button1 action:[Transcript showCR:'one pressed']. |
|
215 |
||
216 |
button2 := Button label:'two' in:panel. |
|
217 |
button2 action:[Transcript showCR:'two pressed']. |
|
218 |
||
219 |
button3 := Button label:'three' in:panel. |
|
220 |
button3 action:[Transcript showCR:'three pressed']. |
|
221 |
||
222 |
topView open. |
|
223 |
[exEnd] |
|
224 |
" |
|
225 |
! ! |
|
226 |
||
227 |
!StandardSystemView class methodsFor:'instance creation'! |
|
228 |
||
229 |
extent:anExtent label:aLabel icon:aForm |
|
230 |
"create a new topView and define its extent, label and icon" |
|
231 |
||
232 |
^ self origin:nil extent:anExtent |
|
233 |
label:aLabel icon:aForm |
|
234 |
minExtent:nil maxExtent:nil |
|
235 |
! |
|
236 |
||
237 |
extent:anExtent label:aLabel icon:aForm minExtent:minExtent |
|
238 |
^ self origin:nil extent:anExtent |
|
239 |
label:aLabel icon:aForm |
|
240 |
minExtent:minExtent maxExtent:nil |
|
241 |
! |
|
242 |
||
243 |
extent:anExtent label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent |
|
244 |
^ self origin:nil extent:anExtent |
|
245 |
label:aLabel icon:aForm |
|
246 |
minExtent:minExtent maxExtent:maxExtent |
|
247 |
! |
|
248 |
||
249 |
extent:anExtent label:aLabel minExtent:minExtent |
|
250 |
"create a new topView and define its extent, label and minumum extent" |
|
251 |
||
252 |
^ self origin:nil extent:anExtent |
|
253 |
label:aLabel icon:nil |
|
254 |
minExtent:minExtent maxExtent:nil |
|
255 |
! |
|
256 |
||
257 |
label:aLabel |
|
258 |
"create a new topView and define its label" |
|
259 |
||
260 |
^ self origin:nil extent:nil |
|
261 |
label:aLabel icon:nil |
|
262 |
minExtent:nil maxExtent:nil |
|
263 |
! |
|
264 |
||
265 |
label:aLabel icon:aForm |
|
266 |
"create a new topView and define its label and icon" |
|
267 |
||
268 |
^ self origin:nil extent:nil |
|
269 |
label:aLabel icon:aForm |
|
270 |
minExtent:nil maxExtent:nil |
|
271 |
! |
|
272 |
||
273 |
label:aLabel icon:aForm minExtent:anExtent |
|
274 |
"create a new topView and define its label, icon and minumum extent" |
|
275 |
||
276 |
^ self origin:nil extent:nil |
|
277 |
label:aLabel icon:aForm |
|
278 |
minExtent:anExtent maxExtent:nil |
|
279 |
! |
|
280 |
||
281 |
label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent |
|
282 |
"create a new topView and define its label, icon, min and max extents" |
|
283 |
||
284 |
^ self origin:nil extent:nil |
|
285 |
label:aLabel icon:aForm |
|
286 |
minExtent:minExtent maxExtent:maxExtent |
|
287 |
! |
|
288 |
||
289 |
label:aLabel minExtent:anExtent |
|
290 |
"create a new topView and define its label and minimum extent" |
|
291 |
||
292 |
^ self origin:nil extent:nil |
|
293 |
label:aLabel icon:nil |
|
294 |
minExtent:anExtent maxExtent:nil |
|
295 |
! |
|
296 |
||
297 |
model:aModel label:aLabel minimumSize:minExtent |
|
298 |
"ST80-style instance creation" |
|
299 |
||
300 |
|newView| |
|
301 |
||
5613 | 302 |
newView := self origin:nil |
4566 | 303 |
extent:minExtent |
5613 | 304 |
label:aLabel |
4566 | 305 |
icon:nil |
306 |
minExtent:minExtent |
|
307 |
maxExtent:nil. |
|
308 |
newView model:aModel. |
|
309 |
"/ newView controller:(self defaultControllerClass new view:newView). |
|
310 |
^ newView |
|
311 |
! |
|
312 |
||
313 |
origin:anOrigin extent:anExtent label:aLabel |
|
314 |
"create a new topView and define its origin, extent and label" |
|
315 |
||
316 |
^ self origin:anOrigin extent:anExtent |
|
317 |
label:aLabel icon:nil |
|
318 |
minExtent:nil maxExtent:nil |
|
319 |
! |
|
320 |
||
321 |
origin:anOrigin label:aLabel icon:aForm |
|
322 |
minExtent:minExtent maxExtent:maxExtent |
|
323 |
"create a new topView and define its origin, extent, label, icon |
|
324 |
and extent-boundaries." |
|
325 |
||
326 |
^ self origin:anOrigin extent:nil |
|
327 |
label:aLabel icon:aForm |
|
328 |
minExtent:minExtent maxExtent:maxExtent |
|
329 |
! ! |
|
330 |
||
331 |
!StandardSystemView class methodsFor:'Compatibility-VW'! |
|
332 |
||
333 |
promptForOpen:aBoolean |
|
334 |
"not implemented here" |
|
335 |
! ! |
|
336 |
||
337 |
!StandardSystemView class methodsFor:'class initialization'! |
|
338 |
||
339 |
initialize |
|
340 |
IncludeHostNameInLabel := false. |
|
341 |
WindowLabelFormat := self defaultWindowLabelFormat. |
|
342 |
||
6369 | 343 |
TakeFocusWhenMapped := (Screen notNil and:[Screen isWindowsPlatform]). |
4566 | 344 |
|
345 |
"Created: / 20.8.1997 / 14:16:32 / cg" |
|
346 |
"Modified: / 24.8.1998 / 17:16:33 / cg" |
|
347 |
! ! |
|
348 |
||
349 |
!StandardSystemView class methodsFor:'defaults'! |
|
350 |
||
351 |
defaultExtent |
|
352 |
"return a standardSystemViews default window extent" |
|
353 |
||
354 |
DefaultExtent notNil ifTrue:[ |
|
355 |
^ DefaultExtent |
|
356 |
]. |
|
357 |
^ super defaultExtent |
|
358 |
||
359 |
"Created: 15.8.1997 / 01:36:21 / cg" |
|
360 |
! |
|
361 |
||
362 |
defaultIcon |
|
363 |
"return a topViews default window icon" |
|
364 |
||
4800 | 365 |
<resource: #programImage> |
4566 | 366 |
<resource: #style (#ICON #ICON_FILE)> |
367 |
||
368 |
|n nm i| |
|
369 |
||
370 |
(i := DefaultIcon) isNil ifTrue:[ |
|
5613 | 371 |
i := self classResources at:'ICON' default:nil. |
372 |
i isNil ifTrue:[ |
|
4566 | 373 |
"/ OperatingSystem platformName == #win32 ifTrue:[ |
374 |
"/ n := 'stx_16x16.xpm'. |
|
375 |
"/ ] ifFalse:[ |
|
376 |
"/ n := 'SmalltalkX.xbm'. |
|
377 |
"/ ]. |
|
5613 | 378 |
nm := ClassResources at:'ICON_FILE' default:n. |
379 |
nm notNil ifTrue:[ |
|
380 |
i := Smalltalk imageFromFileNamed:nm inPackage:'stx:libtool'. |
|
381 |
]. |
|
382 |
i isNil ifTrue:[ |
|
383 |
i := self defaultSTXIcon |
|
384 |
]. |
|
385 |
]. |
|
386 |
i notNil ifTrue:[ |
|
387 |
DefaultIcon := i := i onDevice:Display |
|
388 |
] |
|
4566 | 389 |
]. |
390 |
^ i |
|
391 |
||
392 |
" |
|
393 |
DefaultIcon := nil. |
|
394 |
self defaultIcon inspect |
|
395 |
" |
|
396 |
||
4800 | 397 |
"Modified: / 17-09-2007 / 11:36:25 / cg" |
4566 | 398 |
! |
399 |
||
4975
9e899aca8597
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
4837
diff
changeset
|
400 |
defaultIconForAboutBox |
9e899aca8597
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
4837
diff
changeset
|
401 |
^ self defaultIcon |
9e899aca8597
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
4837
diff
changeset
|
402 |
! |
9e899aca8597
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
4837
diff
changeset
|
403 |
|
4566 | 404 |
defaultLabel |
405 |
"return the default label for views of my kind. |
|
406 |
This can be redefined in subclasses or overwritten in |
|
407 |
initialize methods." |
|
408 |
||
409 |
^ self nameWithoutPrefix. "/ 'aView' |
|
410 |
||
411 |
"Modified: / 27.9.1999 / 11:38:57 / cg" |
|
412 |
! |
|
413 |
||
414 |
defaultWindowLabelFormat |
|
415 |
"%2 is the hostName; |
|
416 |
%1 is the actual window label." |
|
417 |
||
418 |
"/ ^ '%2:%1'. "/ the old format |
|
419 |
"/ ^ '%1 @ %2'. |
|
5771
a4b190ff55e7
changed: #defaultWindowLabelFormat
Claus Gittinger <cg@exept.de>
parents:
5743
diff
changeset
|
420 |
^ '%1 (%5@%2)'. |
4566 | 421 |
! |
422 |
||
423 |
includeHostNameInLabel |
|
8149 | 424 |
"return the flag which controls if a view's label should |
4566 | 425 |
include the hostname. |
426 |
This flag is usually set/cleared in your private.rc file; |
|
427 |
the default is false." |
|
428 |
||
429 |
^ IncludeHostNameInLabel |
|
430 |
||
8149 | 431 |
"Created: / 10-09-1995 / 19:21:16 / claus" |
432 |
"Modified (comment): / 31-08-2017 / 20:16:14 / cg" |
|
4566 | 433 |
! |
434 |
||
435 |
includeHostNameInLabel:aBoolean |
|
8149 | 436 |
"set/clear the flag which controls if a view's label should |
5613 | 437 |
include the hostname - this is highly useful if you have |
4566 | 438 |
multiple smalltalks open simultaneously ... |
439 |
This flag is usually set/cleared in your private.rc file; |
|
440 |
the default is false." |
|
441 |
||
442 |
IncludeHostNameInLabel := aBoolean |
|
443 |
||
8149 | 444 |
"Modified: / 24-04-1996 / 09:09:21 / cg" |
445 |
"Modified (comment): / 31-08-2017 / 20:16:18 / cg" |
|
4566 | 446 |
! |
447 |
||
448 |
takeFocusWhenMapped |
|
5613 | 449 |
^ TakeFocusWhenMapped |
4566 | 450 |
|
451 |
" |
|
452 |
StandardSystemView takeFocusWhenMapped |
|
453 |
" |
|
454 |
! |
|
455 |
||
456 |
updateStyleCache |
|
457 |
"extract values from the styleSheet and cache them in class variables" |
|
458 |
||
459 |
<resource: #style (#'standardSystemView.defaultExtent')> |
|
460 |
||
461 |
DefaultExtent := StyleSheet at:'standardSystemView.defaultExtent' default:nil. |
|
462 |
||
463 |
" |
|
464 |
self updateStyleCache |
|
465 |
" |
|
466 |
||
467 |
"Modified: 31.8.1995 / 03:01:14 / claus" |
|
468 |
"Created: 15.8.1997 / 01:34:37 / cg" |
|
469 |
"Modified: 20.10.1997 / 15:13:50 / cg" |
|
470 |
! |
|
471 |
||
472 |
windowLabelFormat |
|
473 |
^ WindowLabelFormat |
|
474 |
! |
|
475 |
||
476 |
windowLabelFormat:aFormatString |
|
477 |
WindowLabelFormat := aFormatString |
|
478 |
! ! |
|
479 |
||
480 |
!StandardSystemView class methodsFor:'image specs'! |
|
481 |
||
482 |
defaultSTXIcon |
|
483 |
<resource: #programImage> |
|
484 |
||
7140 | 485 |
^ Icon stxIcon. |
4566 | 486 |
! ! |
487 |
||
488 |
!StandardSystemView class methodsFor:'startup'! |
|
489 |
||
6073 | 490 |
cancelAutoRaise |
491 |
"cancel any schedule autoraise action" |
|
492 |
||
8288 | 493 |
|raiseBlock| |
6073 | 494 |
|
8288 | 495 |
(raiseBlock := TimedRaiseAction) notNil ifTrue:[ |
496 |
TimedRaiseAction := nil. |
|
497 |
Processor removeTimedBlock:raiseBlock. |
|
6073 | 498 |
]. |
8288 | 499 |
|
500 |
"Modified: / 08-02-2018 / 16:31:38 / stefan" |
|
6073 | 501 |
! |
502 |
||
4566 | 503 |
start |
504 |
"create, realize the view - this topview and all its subviews will |
|
505 |
run as a separate process with its own windowGroup. |
|
506 |
This method exists for backward compatibility - use open." |
|
507 |
||
508 |
^ self open |
|
509 |
! ! |
|
510 |
||
511 |
!StandardSystemView methodsFor:'Compatibility-ST80'! |
|
512 |
||
513 |
maximumSize |
|
514 |
"same as maxExtent; for ST-80 compatibility" |
|
515 |
||
516 |
^ self maxExtent |
|
517 |
! |
|
518 |
||
519 |
maximumSize:anExtent |
|
520 |
"same as maxExtent; for ST-80 compatibility" |
|
521 |
||
522 |
^ self maxExtent:anExtent |
|
523 |
! |
|
524 |
||
525 |
menuBar |
|
526 |
"return my menuBar or nil if I have none. |
|
527 |
This is only valid for topViews which were built with the UIBuilder." |
|
528 |
||
529 |
^ application builder menuBar |
|
530 |
||
531 |
"Created: / 27.10.1997 / 16:23:13 / cg" |
|
532 |
! |
|
533 |
||
534 |
minimumSize |
|
535 |
"same as minExtent; for ST-80 compatibility" |
|
536 |
||
537 |
^ self minExtent |
|
538 |
! |
|
539 |
||
540 |
minimumSize:anExtent |
|
541 |
"same as minExtent; for ST-80 compatibility" |
|
542 |
||
543 |
^ self minExtent:anExtent |
|
544 |
! |
|
545 |
||
546 |
quit |
|
5613 | 547 |
"same as closeRequest |
4566 | 548 |
(but sometimes sent via the sensors event queue from VW programs)" |
549 |
||
550 |
self closeRequest |
|
551 |
||
552 |
"Created: / 30.10.1997 / 19:23:01 / cg" |
|
553 |
"Modified: / 3.8.1998 / 20:04:22 / cg" |
|
554 |
! ! |
|
555 |
||
556 |
!StandardSystemView methodsFor:'accessing'! |
|
557 |
||
558 |
application |
|
559 |
"return the topViews application. |
|
560 |
This is new protocol for ST-80 compatibility and not yet fully supported" |
|
561 |
||
562 |
^ application |
|
563 |
! |
|
564 |
||
565 |
application:anApplicationModel |
|
566 |
"set the topViews application. |
|
567 |
This is new protocol for ST-80 compatibility and not yet fully supported" |
|
568 |
||
569 |
application := anApplicationModel. |
|
570 |
anApplicationModel notNil ifTrue:[ |
|
571 |
anApplicationModel window isNil ifTrue:[ |
|
572 |
anApplicationModel window:self |
|
573 |
] |
|
574 |
] |
|
575 |
||
576 |
"Modified: 18.4.1996 / 14:55:44 / cg" |
|
577 |
! ! |
|
578 |
||
579 |
!StandardSystemView methodsFor:'accessing-behavior'! |
|
580 |
||
581 |
bePartner |
|
582 |
"define me as a partner-View. |
|
583 |
All partners within the applications windowGroup iconify/deiconify together." |
|
584 |
||
585 |
self setWindowGroupFromApplication. |
|
586 |
super bePartner. |
|
587 |
||
588 |
" |
|
589 |
see example in TopView>>bePartner |
|
590 |
" |
|
591 |
||
592 |
"Created: 22.9.1995 / 17:40:15 / claus" |
|
593 |
"Modified: 6.3.1996 / 16:16:42 / cg" |
|
594 |
! |
|
595 |
||
596 |
beSlave |
|
597 |
"define me as a slave-View. |
|
6122 | 598 |
All slaves within the application's windowGroup iconify/deiconify with the masterView(s) |
4566 | 599 |
(i.e. they follow their master(s))" |
600 |
||
601 |
self setWindowGroupFromApplication. |
|
602 |
super beSlave. |
|
603 |
||
604 |
" |
|
605 |
see example in TopView>>beSlave |
|
606 |
" |
|
607 |
||
6122 | 608 |
"Created: / 22-09-1995 / 17:40:15 / claus" |
609 |
"Modified: / 06-03-1996 / 16:16:50 / cg" |
|
610 |
"Modified (comment): / 28-08-2013 / 21:27:46 / cg" |
|
4566 | 611 |
! |
612 |
||
613 |
sendWindowEvents:collectionOfEventSymbols |
|
614 |
"define the events that are to be forwarded to the application. |
|
615 |
This is being implemented ..." |
|
616 |
||
617 |
windowEventsForApplication := collectionOfEventSymbols |
|
618 |
! |
|
619 |
||
620 |
sizeFixed:aBoolean |
|
621 |
"this prevents the view from resizing itself when realized. |
|
7668 | 622 |
For normal topViews, this is void, since they don't do this anyway. |
4566 | 623 |
|
5613 | 624 |
However, modalBoxes (especially: DialogBoxes) typically resize themselfes |
625 |
to the preferredExtent of their components. In some cases, this behavior is |
|
4566 | 626 |
not desired and it should be turned off by setting sizeFixed to true. |
627 |
||
628 |
To avoid confusion: |
|
7668 | 629 |
This does NOT prevent the window manager from resizing the view, |
630 |
instead it tells the view to NOT resize ITSELF." |
|
4566 | 631 |
|
632 |
sizeFixed := aBoolean. |
|
633 |
||
5613 | 634 |
"example: dialog which resizes itself on #open: |
7668 | 635 |
(thereby ignoring the 200@200 extent) |
4566 | 636 |
|
7668 | 637 |
|dialog| |
4566 | 638 |
|
7668 | 639 |
dialog := Dialog new. |
640 |
dialog addInputFieldOn:'' asValue. |
|
641 |
dialog addOkButton. |
|
642 |
dialog extent:200@200. |
|
643 |
dialog open. |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
644 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
645 |
|
4566 | 646 |
using sizeFixed: |
647 |
||
7668 | 648 |
|dialog| |
4566 | 649 |
|
7668 | 650 |
dialog := Dialog new. |
651 |
dialog addInputFieldOn:'' asValue. |
|
652 |
dialog addOkButton. |
|
653 |
dialog extent:200@200; sizeFixed:true. |
|
654 |
dialog open. |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
655 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
656 |
|
4566 | 657 |
using openWithExtent (also sets sizeFixed): |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
658 |
|
7668 | 659 |
|dialog| |
4566 | 660 |
|
7668 | 661 |
dialog := Dialog new. |
662 |
dialog addInputFieldOn:'' asValue. |
|
663 |
dialog addOkButton. |
|
664 |
dialog openWithExtent:200@200. |
|
4566 | 665 |
" |
666 |
! ! |
|
667 |
||
668 |
!StandardSystemView methodsFor:'accessing-channels'! |
|
669 |
||
670 |
labelChannel |
|
671 |
"return the labelChannel - or nil" |
|
672 |
||
673 |
^ labelChannel. |
|
674 |
! |
|
675 |
||
676 |
labelChannel:aValueHolder |
|
677 |
"set the labelChannel - a valueHolder holding a string |
|
678 |
which is shown as title bar" |
|
679 |
||
680 |
|prev| |
|
681 |
||
682 |
prev := labelChannel. |
|
683 |
labelChannel := aValueHolder. |
|
684 |
self setupChannel:aValueHolder for:nil withOld:prev. |
|
685 |
! ! |
|
686 |
||
687 |
!StandardSystemView methodsFor:'accessing-dimensions'! |
|
688 |
||
689 |
maxExtent |
|
7693 | 690 |
"return the view's maximum allowed extent" |
4566 | 691 |
|
692 |
^ maxExtent |
|
693 |
! |
|
694 |
||
695 |
maxExtent:max |
|
696 |
"define the maximum extent the view may have - |
|
697 |
depends on good-will of window manager" |
|
698 |
||
7080 | 699 |
|id| |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
700 |
|
4566 | 701 |
maxExtent ~= max ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
702 |
maxExtent := max. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
703 |
maxExtent x isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
704 |
maxExtent := 99999 @ maxExtent y. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
705 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
706 |
maxExtent y isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
707 |
maxExtent := maxExtent x @ 99999. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
708 |
]. |
4566 | 709 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
710 |
(id := self drawableId) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
711 |
device setWindowMinExtent:nil maxExtent:max in:id |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
712 |
]. |
4566 | 713 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
714 |
"/ if my current extent is larger than the new |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
715 |
"/ maxExtent, adjust. |
4566 | 716 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
717 |
(width notNil and:[height notNil]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
718 |
((width > (max x)) or: |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
719 |
[height > (max y)]) ifTrue: [ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
720 |
self extent:(max min:self extent) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
721 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
722 |
] |
4566 | 723 |
]. |
724 |
! |
|
725 |
||
726 |
minExtent |
|
7693 | 727 |
"return the view's minimum allowed extent" |
4566 | 728 |
|
729 |
^ minExtent |
|
730 |
! |
|
731 |
||
732 |
minExtent:min |
|
733 |
"define the minimum extent the view may have - |
|
734 |
depends on good-will of window manager" |
|
735 |
||
7080 | 736 |
|id| |
737 |
||
4566 | 738 |
minExtent ~= min ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
739 |
minExtent := min. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
740 |
(id := self drawableId) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
741 |
device setWindowMinExtent:min maxExtent:nil in:id |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
742 |
]. |
4566 | 743 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
744 |
"/ if my current extent is smaller than the new |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
745 |
"/ minExtent, adjust. |
4566 | 746 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
747 |
(width notNil and:[height notNil]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
748 |
((width < (min x)) or: |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
749 |
[height < (min y)]) ifTrue: [ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
750 |
self extent:(min max:self extent) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
751 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
752 |
] |
4566 | 753 |
] |
754 |
! ! |
|
755 |
||
756 |
!StandardSystemView methodsFor:'accessing-look'! |
|
757 |
||
758 |
icon |
|
759 |
"return the form defined as icon" |
|
760 |
||
761 |
^ icon value |
|
762 |
! |
|
763 |
||
764 |
icon:aFormOrImage |
|
765 |
"define the form or image (bitmap) used as icon" |
|
766 |
||
767 |
|i m iconValue| |
|
768 |
||
769 |
icon := aFormOrImage. |
|
770 |
iconValue := icon value. |
|
771 |
iconValue notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
772 |
self drawableId notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
773 |
i := device convertedIcon:iconValue. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
774 |
(i notNil and:[i id notNil]) ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
775 |
(m := iconValue mask) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
776 |
m := device convertedIconMask:m. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
777 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
778 |
device setWindowIcon:i mask:m in:self drawableId |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
779 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
780 |
] |
4566 | 781 |
] |
782 |
||
4814 | 783 |
"Modified: / 30-10-2007 / 16:39:15 / cg" |
4566 | 784 |
! |
785 |
||
786 |
iconLabel |
|
787 |
"return the name displayed in the icon" |
|
788 |
||
789 |
^ iconLabel |
|
790 |
! |
|
791 |
||
792 |
iconLabel:aString |
|
793 |
"define the name to be displayed in the icon" |
|
794 |
||
795 |
|newLabel| |
|
796 |
||
797 |
(newLabel := aString string) ~= iconLabel ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
798 |
iconLabel := newLabel. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
799 |
self drawableId notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
800 |
device setIconName:newLabel in:self drawableId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
801 |
" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
802 |
unbuffered - to make it visible right NOW |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
803 |
" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
804 |
self flush. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
805 |
] |
4566 | 806 |
] |
807 |
! |
|
808 |
||
809 |
iconMask |
|
810 |
"return the form defined as iconMask. |
|
811 |
Notice, that many windowManagers ignore this mask |
|
812 |
(usually, only managers which place icons on the background desktop |
|
813 |
care for an icon - if at all ...)" |
|
814 |
||
815 |
|mask| |
|
816 |
||
817 |
"/ only images possibly have iconMasks |
|
818 |
icon notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
819 |
(mask := icon value mask) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
820 |
^ device convertedIconMask:mask |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
821 |
] |
4566 | 822 |
]. |
823 |
||
824 |
^ nil |
|
825 |
||
4815 | 826 |
"Modified: / 30-10-2007 / 20:59:40 / cg" |
4566 | 827 |
! |
828 |
||
829 |
iconName:aString |
|
830 |
"this method will vanish soon ... - for backward compatibility" |
|
831 |
||
832 |
<resource:#obsolete> |
|
833 |
||
834 |
self obsoleteMethodWarning:'use #iconLabel:'. |
|
835 |
self iconLabel:aString |
|
836 |
! |
|
837 |
||
838 |
iconView |
|
839 |
"return the view used as icon-view" |
|
840 |
||
841 |
^ iconView |
|
842 |
! |
|
843 |
||
844 |
iconView:aView |
|
845 |
"specify the view to be used as icon. |
|
846 |
This may not be supported on all display types" |
|
847 |
||
848 |
iconView := aView. |
|
6278 | 849 |
self drawableId notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
850 |
aView create. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
851 |
device setWindowIconWindow:aView in:self drawableId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
852 |
aView setRealized:true. |
4566 | 853 |
] |
854 |
||
855 |
"Modified: 4.4.1997 / 16:21:37 / cg" |
|
856 |
! |
|
857 |
||
858 |
label |
|
7693 | 859 |
"return the view's name in the title area" |
4566 | 860 |
|
861 |
^ label |
|
862 |
! |
|
863 |
||
864 |
label:aString |
|
6245 | 865 |
"define the view's name in the window's title area. |
866 |
If IncludeHostNameInLabel is true, prepend the hostname - now done in windowLabelFor: |
|
4566 | 867 |
(you will appreciate this, if you are working on multiple |
868 |
machines simultaneously - as I do ...)" |
|
869 |
||
5066 | 870 |
|newLabel expandedLabel| |
4566 | 871 |
|
4633 | 872 |
newLabel := aString. |
873 |
newLabel notNil ifTrue:[newLabel := newLabel string]. |
|
874 |
newLabel ~= label ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
875 |
label := newLabel. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
876 |
"/ fix: cg: realized is a bad test here - could still be unmapped... |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
877 |
self drawableId notNil "realized" ifTrue: [ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
878 |
expandedLabel := self windowLabelFor:label. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
879 |
self windowName:(expandedLabel ? ''). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
880 |
shown ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
881 |
" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
882 |
unbuffered - to make it visible right NOW |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
883 |
" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
884 |
self flush. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
885 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
886 |
] |
4566 | 887 |
] |
888 |
||
4633 | 889 |
"Created: / 08-09-1995 / 19:37:06 / claus" |
890 |
"Modified: / 06-10-2006 / 11:55:06 / cg" |
|
4566 | 891 |
! |
892 |
||
893 |
label:labelString iconLabel:iconLabelString |
|
894 |
"set both the label and the iconLabel" |
|
895 |
||
896 |
self label:labelString. |
|
897 |
self iconLabel:iconLabelString |
|
898 |
! ! |
|
899 |
||
900 |
!StandardSystemView methodsFor:'change & update'! |
|
901 |
||
902 |
update:something with:aParameter from:changedObject |
|
903 |
"the MVC way of changing the label ..." |
|
904 |
||
905 |
changedObject notNil ifTrue:[ |
|
5613 | 906 |
changedObject == labelChannel ifTrue:[ |
907 |
self label:labelChannel value. |
|
908 |
^ self |
|
909 |
]. |
|
4566 | 910 |
]. |
911 |
^ super update:something with:aParameter from:changedObject |
|
912 |
! ! |
|
913 |
||
914 |
!StandardSystemView methodsFor:'destroying'! |
|
915 |
||
916 |
release |
|
917 |
self removeFromCurrentProject. |
|
918 |
labelChannel notNil ifTrue:[ |
|
5613 | 919 |
labelChannel removeDependent:self. |
920 |
labelChannel := nil. |
|
4566 | 921 |
]. |
922 |
windowGroup notNil ifTrue:[ |
|
5613 | 923 |
windowGroup focusSequence:nil. |
4566 | 924 |
]. |
925 |
super release. |
|
926 |
! |
|
927 |
||
928 |
saveAndTerminate |
|
5613 | 929 |
"save & terminate request from the windowManager. The application should |
4566 | 930 |
save its data/files/text etc. somehow and close. |
931 |
If there is an application, let it decide how do do that. |
|
932 |
Otherwise, forward it to superclasses which knows how to do this. |
|
933 |
(it defaults to a terminate there). |
|
934 |
Notice, that not all windowmanagers are nice enough |
|
935 |
to send this request; some simply distroy the view." |
|
936 |
||
937 |
application notNil ifTrue:[ |
|
938 |
application saveAndTerminateRequestFor:self |
|
939 |
] ifFalse:[ |
|
940 |
super saveAndTerminate |
|
941 |
] |
|
942 |
! |
|
943 |
||
944 |
terminate |
|
945 |
"terminate request from the windowManager. If there is an application, |
|
946 |
let it decide if it really wants to be close. Otherwise, forward it to |
|
947 |
superclasses terminate which knows how to do this. |
|
948 |
Notice, that not all windowmanagers are nice enough |
|
949 |
to send this request; some simply distroy the view." |
|
950 |
||
951 |
application notNil ifTrue:[ |
|
952 |
application closeRequestFor:self |
|
953 |
] ifFalse:[ |
|
954 |
self closeRequest. |
|
955 |
] |
|
956 |
||
957 |
"Modified: / 3.8.1998 / 19:49:45 / cg" |
|
958 |
! ! |
|
959 |
||
960 |
!StandardSystemView methodsFor:'event handling'! |
|
961 |
||
6646 | 962 |
delayedAutoRaiseEvent |
6048 | 963 |
"called with a delay by the focusIn code, iff the userPref setting is active. |
964 |
Some (a small number only) may want to prevent autoraise in certain situations |
|
965 |
- for example, if one view is controlling another. These get a chance to redefine this |
|
966 |
method" |
|
967 |
||
6073 | 968 |
|wg app| |
6049 | 969 |
|
6071 | 970 |
"/ not, if my windowGroup is in a modal or popup action |
6073 | 971 |
((wg := self windowGroup) notNil |
972 |
and:[ wg isInModalLoop not |
|
973 |
and:[ wg mainGroup isInModalLoop not |
|
974 |
and:[ self isModal not ]]]) ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
975 |
self sensor anyButtonPressed ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
976 |
"/ if I have an application, let it decide |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
977 |
(app := self application) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
978 |
app delayedAutoRaiseEventFor:self |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
979 |
] ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
980 |
self raise. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
981 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
982 |
] |
6071 | 983 |
] |
6048 | 984 |
! |
985 |
||
4566 | 986 |
focusIn |
987 |
"the view got the keyboard focus (via the window manager). |
|
988 |
I.e. the mouse was moved out into the topView area - restore the |
|
989 |
focus to the previous focusView.." |
|
990 |
||
6721 | 991 |
|viewToGetFocus viewUnderMousePointer ms| |
4566 | 992 |
|
993 |
windowGroup notNil ifTrue:[ |
|
8394 | 994 |
"/ a hack for window managers, which do not honor the |
995 |
"/ WMTransientFor attribute (i.e. XQuartz). |
|
996 |
"/ This flag would prevent a popup (dialog or notification) from being |
|
997 |
"/ covered by its underlying regular view. But on MAC, it does not. |
|
998 |
"/ However, focus is coming in, when doing this, so we manually fix this |
|
999 |
"/ here. Should not hurt on other systems, where the view is already on top. |
|
1000 |
"/ if it does, add some conditional check here (device WMTransientForBroken or similar) |
|
1001 |
"/ You can check for you WM to be correct, by disabling the line below, |
|
1002 |
"/ then click on a smallLint-note icon, to see the smallLint info, |
|
1003 |
"/ then click on the underlying codeView, to raise it. |
|
1004 |
"/ if the smallLint view can be covered, your WM is broken. |
|
1005 |
"/ cg: turns out to be a bad idea - it does help solve the above problem (on mac), |
|
1006 |
"/ but raises unwanted topViews (for example, if a modal dialog's popup menu closes) |
|
1007 |
"/ windowGroup topViews first raise. |
|
6772 | 1008 |
|
8394 | 1009 |
"/ I got the focus - tell the current focus-windowgroup |
1010 |
"/ that its focus is gone elsewhere ... |
|
1011 |
"/ 'focusIn ' print. windowGroup process name printCR. |
|
1012 |
"/ 'focusView is ' print. windowGroup focusView printCR. |
|
4566 | 1013 |
|
8394 | 1014 |
"/ although the foucs has usually already been taken (see focusOut), |
1015 |
"/ there are situations where this does not happen; |
|
1016 |
"/ I am not sure if that is a WM bug or an ST/X bug, but sometimes (with popups), |
|
1017 |
"/ I only get a focus in. Could be a race, when the loosing view is already destroyed, |
|
1018 |
"/ at the time the focus event arrives. |
|
1019 |
"/ Anyway: it should not matter to take it again... |
|
1020 |
WindowGroup takeFocusFromDevice:device. |
|
1021 |
device focusWindowGroup:windowGroup. |
|
1022 |
||
1023 |
windowGroup isInModalLoop ifTrue:[ |
|
1024 |
windowGroup allTopViewsDo:[:t | |
|
1025 |
t ~~ self ifTrue:[ |
|
1026 |
t focusIn. |
|
1027 |
t raise. |
|
1028 |
^ self. |
|
1029 |
]. |
|
1030 |
] |
|
1031 |
]. |
|
6772 | 1032 |
|
8394 | 1033 |
"/ Transcript show:self; show:' focus in '; showCR:windowGroup isInModalLoop. |
6646 | 1034 |
|
8394 | 1035 |
viewToGetFocus := windowGroup focusView. |
1036 |
viewToGetFocus isNil ifTrue:[ |
|
1037 |
UserPreferences current focusFollowsMouse ~~ false ifTrue:[ |
|
1038 |
viewUnderMousePointer := windowGroup pointerView. |
|
1039 |
"/ 'viewUnderMousePointer is ' print. viewUnderMousePointer printCR. |
|
1040 |
(viewUnderMousePointer notNil |
|
1041 |
and:[viewUnderMousePointer isKeyboardConsumer |
|
1042 |
and:[viewUnderMousePointer wantsFocusWithPointerEnter]]) ifTrue:[ |
|
1043 |
viewToGetFocus := viewUnderMousePointer. |
|
1044 |
] |
|
1045 |
]. |
|
1046 |
]. |
|
1047 |
viewToGetFocus isNil ifTrue:[ |
|
1048 |
windowGroup focusBackToPreviousFocusView. |
|
1049 |
windowGroup focusView isNil ifTrue:[ |
|
1050 |
self assignInitialKeyboardFocus. |
|
1051 |
"/ windowGroup focusView isNil ifTrue:[ |
|
1052 |
"/ 'No focusWindow' infoPrintCR. |
|
1053 |
"/ ]. |
|
1054 |
]. |
|
1055 |
] ifFalse:[ |
|
1056 |
"/ v requestFocus. - will be denied; but we must force it here |
|
1057 |
"/ to force a change... |
|
1058 |
windowGroup setFocusView:nil. |
|
1059 |
windowGroup focusView:viewToGetFocus byTab:nil. |
|
1060 |
]. |
|
6047 | 1061 |
|
8394 | 1062 |
"/ optionally bring the window to the front after some delay. |
1063 |
"/ but not, if my windowGroup is in a modal or popup action |
|
1064 |
(ms := UserPreferences current autoRaiseOnFocusInDelay) notNil ifTrue:[ |
|
1065 |
self scheduleAutoRaiseAfter:ms |
|
1066 |
]. |
|
4566 | 1067 |
]. |
1068 |
super focusIn |
|
1069 |
||
5675 | 1070 |
"Modified: / 20-01-2011 / 20:51:20 / cg" |
8394 | 1071 |
"Modified: / 19-06-2018 / 14:01:54 / Claus Gittinger" |
4566 | 1072 |
! |
1073 |
||
1074 |
focusOut |
|
1075 |
"the top-view lost the keyboard focus (via the window manager). |
|
1076 |
I.e. the mouse was moved out of the topView area." |
|
1077 |
||
6787 | 1078 |
|v wg| |
4566 | 1079 |
|
6148 | 1080 |
"/ 'fout ' print. self printCR. |
1081 |
||
6787 | 1082 |
(wg := windowGroup) notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1083 |
"/ ' fout-focusView: ' print. windowGroup focusView printCR. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1084 |
(v := wg focusView) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1085 |
"/ wg focusView:nil. "/ -- let windowGroup do it. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1086 |
v showNoFocus:(windowGroup explicitFocusView == v). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1087 |
"/ ' send-has-nofocus to: ' print. v printCR. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1088 |
v hasKeyboardFocus:false. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1089 |
] |
4566 | 1090 |
]. |
1091 |
super focusOut |
|
1092 |
||
1093 |
"Modified: 25.2.1997 / 23:19:46 / cg" |
|
1094 |
! |
|
1095 |
||
6100
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1096 |
processShortcut:aKeyEvent |
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1097 |
"a shortcut key event as forwarded from the keyboardProcessor - if there is the |
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1098 |
shortcut key defined, process the shortcut and return true - otherwise false." |
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1099 |
|
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1100 |
application notNil ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1101 |
(application processShortcut:aKeyEvent) ifTrue:[ ^ true ] |
6101
ea437d17677d
Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6100
diff
changeset
|
1102 |
]. |
ea437d17677d
Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6100
diff
changeset
|
1103 |
^super processShortcut:aKeyEvent |
6100
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1104 |
|
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1105 |
"Created: / 23-07-2013 / 18:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6101
ea437d17677d
Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6100
diff
changeset
|
1106 |
"Modified: / 23-07-2013 / 23:57:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6100
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1107 |
! |
409e2909e130
Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
6079
diff
changeset
|
1108 |
|
6073 | 1109 |
scheduleAutoRaiseAfter:ms |
1110 |
"bring the window to the front after some delay. |
|
1111 |
but not, if my windowGroup is in a modal or popup action" |
|
1112 |
||
8288 | 1113 |
|wg raiseBlock| |
6073 | 1114 |
|
6646 | 1115 |
(wg := self windowGroup) isNil ifTrue:[^ self]. |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1116 |
wg isInModalLoop ifTrue:[^ self]. |
6646 | 1117 |
wg mainGroup isInModalLoop ifTrue:[^ self]. |
1118 |
"/ self isModal ifTrue:[^ self]. |
|
1119 |
||
1120 |
TimedRaiseAction notNil ifTrue:[ |
|
8288 | 1121 |
Processor removeTimedBlock:TimedRaiseAction. |
6646 | 1122 |
]. |
8288 | 1123 |
TimedRaiseAction := raiseBlock := [ |
1124 |
TimedRaiseAction == raiseBlock ifTrue:[ |
|
1125 |
TimedRaiseAction := nil. |
|
1126 |
self sensor pushUserEvent: #delayedAutoRaiseEvent for: self |
|
1127 |
]. |
|
1128 |
]. |
|
1129 |
||
1130 |
Processor |
|
1131 |
addTimedBlock:raiseBlock |
|
1132 |
afterMilliseconds:ms. |
|
1133 |
||
1134 |
"Modified: / 08-02-2018 / 17:48:22 / stefan" |
|
6073 | 1135 |
! |
1136 |
||
4566 | 1137 |
showActivity:someMessage |
1138 |
"some activityNotification shalt be communicated to |
|
1139 |
the user. Forward it to my application (if any). |
|
1140 |
(that one should know how to deal with it). |
|
1141 |
Otherwise, simply ignore it." |
|
1142 |
||
1143 |
application notNil ifTrue:[ |
|
1144 |
application showActivity:someMessage |
|
1145 |
] |
|
1146 |
||
1147 |
"Created: 16.12.1995 / 18:40:44 / cg" |
|
1148 |
"Modified: 23.4.1996 / 21:38:11 / cg" |
|
1149 |
! ! |
|
1150 |
||
1151 |
!StandardSystemView methodsFor:'initialization & release'! |
|
1152 |
||
1153 |
addToCurrentProject |
|
1154 |
"add the receiver (a topview) to the current projects set-of-views. |
|
1155 |
(If there is a current project)" |
|
1156 |
||
1157 |
|p| |
|
1158 |
||
1159 |
" |
|
1160 |
the following check allows systems |
|
1161 |
without projects and changeSets |
|
1162 |
" |
|
1163 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
|
1164 |
p addView: self |
|
1165 |
] |
|
1166 |
! |
|
1167 |
||
1168 |
defaultControllerClass |
|
1169 |
"for ST-80 compatibility only - not used in ST/X" |
|
1170 |
||
1171 |
^ nil "/ StandardSystemController |
|
1172 |
! |
|
1173 |
||
1174 |
initEvents |
|
1175 |
super initEvents. |
|
1176 |
self enableFocusEvents. |
|
1177 |
! |
|
1178 |
||
1179 |
initialize |
|
7849 | 1180 |
<modifier: #super> "must be called if redefined" |
1181 |
||
4566 | 1182 |
super initialize. |
1183 |
||
5388 | 1184 |
"/ self setBorderWidth:2. "- notice: many window managers ignore this" |
7263 | 1185 |
device isWindowsPlatform ifTrue:[ |
7849 | 1186 |
minExtent := 0 @ 0. |
4566 | 1187 |
] ifFalse:[ |
7849 | 1188 |
minExtent := 10 @ 10. |
4566 | 1189 |
]. |
1190 |
||
1191 |
label isNil ifTrue:[label := self class defaultLabel]. |
|
1192 |
icon isNil ifTrue:[icon := self class defaultIcon]. |
|
5942 | 1193 |
sizeFixed := false. |
1194 |
||
7849 | 1195 |
"Modified: / 08-02-2017 / 00:26:39 / cg" |
4566 | 1196 |
! |
1197 |
||
5659 | 1198 |
mapped |
1199 |
super mapped. |
|
7263 | 1200 |
device isWindowsPlatform ifTrue:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1201 |
"don't do this in X11 - switching between |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1202 |
virtual desktops would change the window stacking all the time" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1203 |
self setForegroundWindow. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1204 |
self activate. |
5743 | 1205 |
]. |
5659 | 1206 |
|
1207 |
"Created: / 01-12-2010 / 15:57:22 / cg" |
|
1208 |
! |
|
1209 |
||
4566 | 1210 |
reAdjustGeometry |
1211 |
"sent as a final step when an image is restarted. |
|
5613 | 1212 |
when we come up on a smaller display, |
4566 | 1213 |
make certain, that the receiver is visible" |
1214 |
||
6278 | 1215 |
|dX dY limitRight limitBottom graphicsDevice| |
4566 | 1216 |
|
7263 | 1217 |
graphicsDevice := device. |
6278 | 1218 |
dX := (graphicsDevice horizontalPixelPerMillimeter * 20) rounded. |
1219 |
dY := (graphicsDevice verticalPixelPerMillimeter * 20) rounded. |
|
4566 | 1220 |
|
6278 | 1221 |
limitRight := graphicsDevice usableWidth - dX. |
1222 |
limitBottom := graphicsDevice usableHeight - dY. |
|
4566 | 1223 |
((self left > limitRight) or:[ |
1224 |
self top > limitBottom]) ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1225 |
'StandardSystemView [info]: moving view into visible area' infoPrintCR. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1226 |
self origin:limitRight @ limitBottom |
4566 | 1227 |
] |
1228 |
||
1229 |
"Modified: 10.1.1997 / 15:12:19 / cg" |
|
1230 |
! |
|
1231 |
||
1232 |
reinitialize |
|
7562 | 1233 |
"reopen the receiver if it was visible before. |
4566 | 1234 |
This is called right after snapIn; Notice, that all instance variables |
1235 |
(such as shown, realized etc.) are left-overs from the time the snapout |
|
1236 |
was done. Remap the receiver, if it was mapped at snapout time" |
|
1237 |
||
1238 |
|myController| |
|
1239 |
||
1240 |
"if I have already been reinited - return" |
|
6278 | 1241 |
self drawableId notNil ifTrue:[ |
7562 | 1242 |
^ self |
4566 | 1243 |
]. |
1244 |
||
5613 | 1245 |
"have to kludge with the controller |
4566 | 1246 |
- otherwise its startup performs unwanted actions ..." |
1247 |
||
1248 |
myController := controller. |
|
1249 |
controller := nil. |
|
1250 |
||
1251 |
"physically create the view & subviews" |
|
1252 |
self recreate. |
|
1253 |
||
1254 |
"if I was iconified (not realized), remap iconified" |
|
7263 | 1255 |
device |
7562 | 1256 |
mapView:self id:self drawableId iconified:(realized "shown" not) |
1257 |
atX:left y:top width:width height:height |
|
1258 |
minExtent:minExtent maxExtent:maxExtent. |
|
24 | 1259 |
|
4566 | 1260 |
"and restart the window-group process" |
1261 |
windowGroup notNil ifTrue:[ |
|
7562 | 1262 |
windowGroup restart |
4566 | 1263 |
]. |
24 | 1264 |
|
4566 | 1265 |
"restore controller" |
1266 |
controller := myController |
|
1267 |
||
1268 |
"Modified: / 6.5.1999 / 09:50:13 / cg" |
|
1269 |
! |
|
1270 |
||
1271 |
removeFromCurrentProject |
|
1272 |
"remove the receiver (a topview) from the current projects set-of-views. |
|
1273 |
(If there is a current project)" |
|
1274 |
||
1275 |
|p| |
|
1276 |
||
1277 |
" |
|
1278 |
the following check allows systems |
|
1279 |
without projects and changeSets |
|
1280 |
" |
|
1281 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
|
1282 |
p removeView:self |
|
1283 |
] |
|
1284 |
! |
|
1285 |
||
1286 |
restarted |
|
1287 |
"sent by my windowGroup, when restarted from an image. |
|
1288 |
Nothing done here, but can be redefined to perform any actions |
|
1289 |
required to reset the application after an image-restart. |
|
1290 |
(for example: check if application files are still around, restart |
|
1291 |
subprocesses etc.)." |
|
1292 |
||
1293 |
application notNil ifTrue:[ |
|
1294 |
application restarted |
|
1295 |
]. |
|
1296 |
! ! |
|
1297 |
||
1298 |
!StandardSystemView methodsFor:'printing & storing'! |
|
1299 |
||
5233
fb88be5a3dea
define #printOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5086
diff
changeset
|
1300 |
printOn:aStream |
4566 | 1301 |
"just for your convenience in inspectors ... |
7693 | 1302 |
... add the view's label to the displayString." |
4566 | 1303 |
|
5233
fb88be5a3dea
define #printOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5086
diff
changeset
|
1304 |
super printOn:aStream. |
4566 | 1305 |
label notNil ifTrue:[ |
7693 | 1306 |
aStream nextPut:$(. label printOn:aStream. aStream nextPut:$). |
4566 | 1307 |
]. |
1308 |
! ! |
|
1309 |
||
1310 |
!StandardSystemView methodsFor:'private'! |
|
1311 |
||
1312 |
convertedIcon |
|
1313 |
"make certain, that the icon is compatible with my device; |
|
1314 |
this means converting it to a format (typically: monochrome) which |
|
1315 |
the device supports. Return a compatible version of the icon." |
|
1316 |
||
7263 | 1317 |
^ device convertedIcon:icon |
4566 | 1318 |
|
4814 | 1319 |
"Modified: / 30-10-2007 / 16:39:55 / cg" |
4566 | 1320 |
! |
1321 |
||
1322 |
convertedIcon:iconArg |
|
1323 |
"make certain, that the image argument is compatible with my device; |
|
1324 |
this means converting it to a format (typically: monochrome) which |
|
1325 |
the device supports. Return a compatible version of the icon." |
|
1326 |
||
7263 | 1327 |
^ device convertedIcon:iconArg |
4566 | 1328 |
|
4814 | 1329 |
"Modified: / 30-10-2007 / 16:37:31 / cg" |
4566 | 1330 |
! |
1331 |
||
1332 |
convertedIconMask:aMask |
|
1333 |
"return a version of the argument which can be used as an iconMask |
|
1334 |
on my device. Typically, this means conversion to a monochrome |
|
1335 |
mask - future versions may add alpha channel masks, if the device supports |
|
1336 |
them ..." |
|
1337 |
||
7263 | 1338 |
^ device convertedIconMask:aMask |
4566 | 1339 |
|
4814 | 1340 |
"Modified: / 30-10-2007 / 16:38:58 / cg" |
4566 | 1341 |
! |
1342 |
||
1343 |
setWindowGroupFromApplication |
|
1344 |
"get the applications topView and set my windowGroup to its wg." |
|
1345 |
||
1346 |
|win master| |
|
1347 |
||
1348 |
windowGroup isNil ifTrue:[ |
|
5613 | 1349 |
application notNil ifTrue:[ |
1350 |
(win := application window) notNil ifTrue:[ |
|
1351 |
win ~~ self ifTrue:[ |
|
1352 |
windowGroup := win windowGroup. |
|
1353 |
^ self |
|
1354 |
]. |
|
1355 |
(master := application masterApplication) notNil ifTrue:[ |
|
1356 |
(win := master window) notNil ifTrue:[ |
|
1357 |
windowGroup := win windowGroup. |
|
1358 |
^ self |
|
1359 |
]. |
|
1360 |
]. |
|
1361 |
] |
|
1362 |
] |
|
4566 | 1363 |
]. |
1364 |
||
1365 |
"Created: 22.9.1995 / 17:40:36 / claus" |
|
1366 |
"Modified: 6.3.1996 / 16:17:32 / cg" |
|
1367 |
! |
|
1368 |
||
1369 |
windowLabelFor:labelString |
|
1370 |
"return an expanded labelString, according to the hostName-in-window setting. |
|
1371 |
The labelString may include positional parameters: |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1372 |
%1 - the actual label |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1373 |
%2 - the hostname |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1374 |
%3 - the userName |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1375 |
%4 - the processId |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1376 |
%5 - the TOP-directories name |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1377 |
%6 - the TOP-directories path |
4566 | 1378 |
" |
1379 |
||
6504 | 1380 |
|wg proc id pidString lbl windowLabelFormat stxPackageDirectory topDirectory| |
4566 | 1381 |
|
1382 |
(IncludeHostNameInLabel == true |
|
1383 |
and:[(windowLabelFormat := self class windowLabelFormat) notNil]) ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1384 |
(wg := self windowGroup) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1385 |
(proc := wg process) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1386 |
(id := proc id) notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1387 |
pidString := id printString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1388 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1389 |
] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1390 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1391 |
stxPackageDirectory := Smalltalk getPackageDirectoryForPackage:'stx'. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1392 |
stxPackageDirectory isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1393 |
'StdSysView [info]: cannot figure out stx package directory.' infoPrintCR. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1394 |
stxPackageDirectory := OperatingSystem pathOfSTXExecutable asFilename. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1395 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1396 |
stxPackageDirectory isNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1397 |
topDirectory := OperatingSystem getHomeDirectory asFilename. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1398 |
] ifFalse:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1399 |
topDirectory := stxPackageDirectory directory. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1400 |
"/ a hack to make it look nicer on mac... (shows Packages otherwise) |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1401 |
topDirectory baseName = 'Packages' ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1402 |
topDirectory := topDirectory directory |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1403 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1404 |
]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1405 |
lbl := windowLabelFormat |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1406 |
bindWith:labelString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1407 |
with:[OperatingSystem getHostName] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1408 |
with:[OperatingSystem getLoginName] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1409 |
with:pidString |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1410 |
with:[topDirectory baseName] |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1411 |
with:[topDirectory pathName]. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1412 |
^ lbl |
4566 | 1413 |
]. |
1414 |
^ labelString |
|
1415 |
||
1416 |
"Created: / 22-09-1997 / 10:10:32 / cg" |
|
1417 |
"Modified: / 22-08-2006 / 11:42:53 / cg" |
|
1418 |
! ! |
|
1419 |
||
1420 |
!StandardSystemView methodsFor:'queries'! |
|
1421 |
||
1422 |
processName |
|
1423 |
"return a string to be shown for my process in the |
|
1424 |
process monitor. This has no semantic meaning, but exists |
|
1425 |
for your convenience only." |
|
1426 |
||
1427 |
application notNil ifTrue:[ |
|
1428 |
^ application processName |
|
1429 |
]. |
|
1430 |
label notNil ifTrue:[^ label]. |
|
1431 |
^ super processName |
|
1432 |
||
1433 |
"Modified: 24.4.1996 / 09:47:01 / cg" |
|
1434 |
! ! |
|
1435 |
||
1436 |
!StandardSystemView methodsFor:'realization'! |
|
1437 |
||
1438 |
create |
|
1439 |
"create - make certain that icon is available" |
|
1440 |
||
1441 |
super create. |
|
1442 |
||
1443 |
iconView notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1444 |
iconView create. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1445 |
device setWindowIconWindow:iconView in:self drawableId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1446 |
iconView setRealized:true. |
4566 | 1447 |
]. |
1448 |
iconLabel notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1449 |
device setIconName:iconLabel string in:self drawableId |
4566 | 1450 |
] |
1451 |
||
1452 |
"Modified: 10.6.1996 / 20:14:50 / cg" |
|
1453 |
! |
|
1454 |
||
1455 |
expand |
|
1456 |
"de-iconify the receiver at its old position" |
|
1457 |
||
1458 |
shown ifFalse:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1459 |
self unmap. |
4566 | 1460 |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1461 |
"if it was iconified, try to remap non-iconified" |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1462 |
device |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1463 |
mapView:self id:self drawableId iconified:false |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1464 |
atX:left y:top width:width height:height |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1465 |
minExtent:minExtent maxExtent:maxExtent. |
4566 | 1466 |
]. |
1467 |
||
1468 |
" |
|
1469 |
|top| |
|
1470 |
||
1471 |
top := StandardSystemView new. |
|
1472 |
top label:'hello'. |
|
1473 |
top openAndWait. |
|
1474 |
top collapse. |
|
1475 |
Delay waitForSeconds:5. |
|
1476 |
top expand. |
|
1477 |
" |
|
1478 |
||
1479 |
"Modified: / 3.2.1998 / 16:02:56 / cg" |
|
1480 |
! |
|
1481 |
||
1482 |
physicalCreate |
|
1483 |
"common code for create & recreate" |
|
1484 |
||
7263 | 1485 |
|dev currentUserPrefs lbl iconValue icn icnMask windowClassNameString org devBounds windowNameString| |
6228 | 1486 |
|
7263 | 1487 |
dev := device. |
1488 |
currentUserPrefs := UserPreferences current. |
|
7985 | 1489 |
|
1490 |
(top notNil and:[left notNil]) ifTrue:[ |
|
1491 |
currentUserPrefs forceWindowsIntoMonitorBounds ifTrue:[ |
|
1492 |
"/ MULTI SCREEN support |
|
1493 |
devBounds := dev monitorBoundsAt:( left @ top ). |
|
1494 |
"/ adjust origin, if too large |
|
1495 |
left + width > devBounds right ifTrue:[ |
|
1496 |
left := devBounds right - width. |
|
1497 |
]. |
|
1498 |
top + height > devBounds bottom ifTrue:[ |
|
1499 |
top := devBounds bottom - height. |
|
1500 |
]. |
|
1501 |
top := top max:(devBounds top). |
|
1502 |
left := left max:(devBounds left). |
|
1503 |
]. |
|
1504 |
||
1505 |
dev isWindowsPlatform ifTrue:[ |
|
1506 |
top := top + dev captionHeight. |
|
1507 |
]. |
|
1508 |
org := (left @ top) rounded. |
|
5532 | 1509 |
]. |
1510 |
||
4566 | 1511 |
lbl := self windowLabelFor:label. |
1512 |
||
1513 |
icon notNil ifTrue:[ |
|
7985 | 1514 |
iconValue := icon value. |
1515 |
icn := dev convertedIcon:iconValue. |
|
1516 |
(icnMask := iconValue mask) notNil ifTrue:[ |
|
1517 |
icnMask := dev convertedIconMask:icnMask. |
|
1518 |
]. |
|
1519 |
"this is to keep the references" |
|
1520 |
deviceIcon := Array with:icn with:icnMask. |
|
4566 | 1521 |
]. |
1522 |
||
1523 |
"/ give global eventListeners a chance to intercept windowCreation |
|
1524 |
"/ and provide another origin (by payching my origin via setOrigin:). |
|
1525 |
WindowSensor preViewCreateNotification:self. |
|
6283 | 1526 |
gc |
6228 | 1527 |
createWindowFor:self |
1528 |
type:(self windowType) |
|
1529 |
origin:org |
|
1530 |
extent:(width @ height) |
|
1531 |
minExtent:minExtent |
|
1532 |
maxExtent:maxExtent |
|
1533 |
borderWidth:0 "self borderWidth" |
|
1534 |
subViewOf:nil |
|
1535 |
style:(self windowStyle) |
|
1536 |
inputOnly:(self isInputOnly) |
|
1537 |
label:lbl |
|
1538 |
owner:nil |
|
1539 |
icon:icn iconMask:icnMask |
|
1540 |
iconView:iconView. |
|
4566 | 1541 |
|
1542 |
"/ give global listeners a chance to track views |
|
1543 |
WindowSensor postViewCreateNotification:self. |
|
1544 |
||
5556 | 1545 |
self originChangedFlag:false extentChangedFlag:false. |
4566 | 1546 |
|
5388 | 1547 |
"/ (borderColor notNil and:[borderColor ~= Black]) ifTrue:[ |
1548 |
"/ self setBorderColor |
|
1549 |
"/ ]. |
|
4566 | 1550 |
|
1551 |
"/ (viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[ |
|
6228 | 1552 |
"/ super viewGravity:viewGravity |
4566 | 1553 |
"/ ]. |
1554 |
||
1555 |
"/ (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[ |
|
6228 | 1556 |
"/ super bitGravity:bitGravity |
4566 | 1557 |
"/ ]. |
1558 |
||
1559 |
viewShape notNil ifTrue:[ |
|
7985 | 1560 |
self setViewShape |
4566 | 1561 |
]. |
1562 |
||
1563 |
(backed notNil and:[backed ~~ false]) ifTrue:[ |
|
7985 | 1564 |
self backingStore:backed. |
4566 | 1565 |
]. |
1566 |
self saveUnder ifTrue:[ |
|
7985 | 1567 |
self saveUnder:true. |
4566 | 1568 |
]. |
1569 |
cursor notNil ifTrue:[ |
|
7985 | 1570 |
self setCursor |
4566 | 1571 |
]. |
1572 |
||
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1573 |
"/JV@2012-11-11: Updated to be ICCCM 2.0 Compliant - some modern Window managers |
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1574 |
"/ provide better UX when application behave nicely. Being |
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1575 |
"/ conformant should not hurt as St/X don't depend on X resources anyway :-) |
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1576 |
"/ See: |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1577 |
"/ |
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1578 |
"/ http://tronche.com/gui/x/icccm/sec-4.html |
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1579 |
|
7263 | 1580 |
(currentUserPrefs icccm20Compliant == true) ifTrue:[ |
7985 | 1581 |
"/ICCCM 2.0 compliant name & class. See ICCCM 2.0 section 4.1.2.5. |
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1582 |
|
7985 | 1583 |
| commandName lastSepIndex | |
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1584 |
|
7985 | 1585 |
commandName := Smalltalk commandName. |
1586 |
lastSepIndex := commandName lastIndexOf: Filename separator. |
|
1587 |
windowNameString := commandName copyFrom: lastSepIndex + 1. |
|
1588 |
windowClassNameString := windowNameString asUppercaseFirst. |
|
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1589 |
|
7985 | 1590 |
"/ Also, set _NET_WM_PID |
1591 |
self setWindowPid: nil. |
|
5039 | 1592 |
] ifFalse:[ |
7985 | 1593 |
"/ Old code..." |
1594 |
application notNil ifTrue:[ |
|
1595 |
windowClassNameString := application class name. |
|
1596 |
] ifFalse:[ |
|
1597 |
(self class == StandardSystemView and:[subViews size == 1]) ifTrue:[ |
|
1598 |
"This is a subclass of SimpleView wrapped into a StandardSystemView" |
|
8712 | 1599 |
windowClassNameString := subViews first className. |
7985 | 1600 |
] ifFalse:[ |
8712 | 1601 |
windowClassNameString := self className. |
7985 | 1602 |
] |
1603 |
]. |
|
1604 |
windowClassNameString := 'Stx.', windowClassNameString. |
|
1605 |
windowNameString := 'main'. |
|
4566 | 1606 |
]. |
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1607 |
|
6228 | 1608 |
self windowClass:windowClassNameString name:windowNameString. |
4566 | 1609 |
|
5975
3d74c7895143
ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5942
diff
changeset
|
1610 |
"Modified: / 04-01-2013 / 16:13:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6871 | 1611 |
"Modified: / 22-05-2015 / 21:09:35 / cg" |
7985 | 1612 |
"Modified: / 18-03-2017 / 00:30:15 / stefan" |
8712 | 1613 |
"Modified: / 28-06-2019 / 09:16:19 / Claus Gittinger" |
4566 | 1614 |
! |
1615 |
||
1616 |
postRealize |
|
1617 |
"postRealize actions - tell the application (if any)." |
|
1618 |
||
1619 |
super postRealize. |
|
6245 | 1620 |
|
4566 | 1621 |
"/ |
1622 |
"/ let the application add its views to the current project |
|
1623 |
"/ |
|
1624 |
application notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1625 |
application opened:self. |
4566 | 1626 |
] ifFalse:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1627 |
self addToCurrentProject. |
4566 | 1628 |
]. |
1629 |
||
1630 |
"Created: 24.7.1997 / 18:11:26 / cg" |
|
1631 |
! |
|
1632 |
||
1633 |
preRealize |
|
1634 |
"invoked right before the view is realized. |
|
1635 |
preRealize actions - tell the application (if any)." |
|
1636 |
||
1637 |
super preRealize. |
|
1638 |
||
1639 |
application notNil ifTrue:[ |
|
5613 | 1640 |
application aboutToOpen:self. |
4566 | 1641 |
]. |
1642 |
! |
|
1643 |
||
1644 |
recreate |
|
1645 |
"recreate the view after a snap-in or a migration" |
|
1646 |
||
1647 |
super recreate. |
|
1648 |
||
1649 |
iconView notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1650 |
iconView recreate. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1651 |
device setWindowIconWindow:iconView in:self drawableId. |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1652 |
iconView setRealized:true. |
4566 | 1653 |
] ifFalse:[ |
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1654 |
icon notNil ifTrue:[ |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1655 |
self icon:(device convertedIcon:icon). |
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1656 |
]. |
4566 | 1657 |
]. |
1658 |
||
1659 |
iconLabel notNil ifTrue:[ |
|
7416
bd3b9e9edd9e
Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents:
7398
diff
changeset
|
1660 |
device setIconName:iconLabel in:self drawableId |
4566 | 1661 |
] |
1662 |
||
4814 | 1663 |
"Modified: / 30-10-2007 / 16:39:42 / cg" |
4566 | 1664 |
! ! |
1665 |
||
8486 | 1666 |
!StandardSystemView methodsFor:'show & hide'! |
1667 |
||
1668 |
collapse |
|
1669 |
"iconify the receiver" |
|
1670 |
||
1671 |
shown ifTrue:[ |
|
1672 |
self unmap. |
|
1673 |
||
1674 |
"remap iconified" |
|
1675 |
device |
|
1676 |
mapView:self id:self drawableId iconified:true |
|
1677 |
atX:left y:top width:width height:height |
|
1678 |
minExtent:minExtent maxExtent:maxExtent. |
|
1679 |
||
1680 |
shown ifTrue:[ |
|
1681 |
shown := false. |
|
1682 |
dependents notNil ifTrue:[ self changed:#visibility ]. |
|
1683 |
]. |
|
1684 |
]. |
|
1685 |
||
1686 |
" |
|
1687 |
|top| |
|
1688 |
||
1689 |
top := StandardSystemView new. |
|
1690 |
top label:'hello'. |
|
1691 |
top openAndWait. |
|
1692 |
Delay waitForSeconds:2. |
|
1693 |
top collapse. |
|
1694 |
Delay waitForSeconds:2. |
|
1695 |
top expand. |
|
1696 |
" |
|
1697 |
||
1698 |
"Modified: / 24-07-1997 / 12:32:17 / cg" |
|
1699 |
"Modified: / 27-09-2018 / 16:51:04 / Claus Gittinger" |
|
1700 |
! ! |
|
1701 |
||
4566 | 1702 |
!StandardSystemView class methodsFor:'documentation'! |
1703 |
||
6048 | 1704 |
version |
7080 | 1705 |
^ '$Header$' |
6048 | 1706 |
! |
1707 |
||
5388 | 1708 |
version_CVS |
7080 | 1709 |
^ '$Header$' |
4566 | 1710 |
! ! |
3746
d9dccd3a4a41
beSlave: also try masterApp in setWGFromApplication
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
1711 |
|
6047 | 1712 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1713 |
StandardSystemView initialize! |