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