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