author | Claus Gittinger <cg@exept.de> |
Fri, 21 Nov 1997 13:57:58 +0100 | |
changeset 1960 | aa9ef6e21f15 |
parent 1944 | 4714af03d87d |
child 2020 | 7f37df42424a |
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 |
" |
|
12 |
||
135 | 13 |
TopView subclass:#StandardSystemView |
1539 | 14 |
instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed |
15 |
application windowEventsForApplication' |
|
1865
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
16 |
classVariableNames:'DefaultIcon TakeFocusWhenMapped IncludeHostNameInLabel |
1880
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
17 |
DefaultExtent WindowLabelFormat' |
328 | 18 |
poolDictionaries:'' |
19 |
category:'Views-Basic' |
|
0 | 20 |
! |
21 |
||
46 | 22 |
!StandardSystemView class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
72 | 27 |
All Rights Reserved |
0 | 28 |
|
46 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
0 | 37 |
|
46 | 38 |
documentation |
39 |
" |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
40 |
I represent standard application topViews |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
41 |
i.e. those views which have a title-label, an icon etc. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
42 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
43 |
The name `StandardSystemView' is probably misleading and |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
44 |
results from ST-80 (rel2.x) compatibility reasons. |
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
827
diff
changeset
|
45 |
Think of it as an ApplicationWindow. |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
46 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
47 |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
48 |
In ST/X, StandardSystemViews were subclassed for special views |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
49 |
in the past (for example: FileBrowser, ChangesBrowser etc.). |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
50 |
Although this worked, it may lead to the following |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
51 |
problems and inconveniences: |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
52 |
- applications inherit a big number of methods through the |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
53 |
SimpleView->View->TopView->StandardSystemView hierarchy. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
54 |
There is quite a danger that by accident, some method gets |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
55 |
redefined which is required by one of those classes. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
56 |
(typical candidates are: terminate, destroy, open ...) |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
57 |
This may lead to strange effects, which may not be obvious to |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
58 |
non experts ... |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
59 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
60 |
- applications with multiple topViews are difficult to implement |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
61 |
and manage. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
62 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
63 |
- use of a windowBuilder is difficult. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
64 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
65 |
For all those reasons, we HIGHLY recommend to NOT define applications |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
66 |
as subclasses of StandardSystemView, but instead base them on |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
67 |
ApplicationModel, and reference the topView(s) as instance variables of |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
68 |
if (if at all). |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
69 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
70 |
[instance variables:] |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
71 |
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
|
72 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
73 |
icon <Form> the icon |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
74 |
[ignored if the display does not |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
75 |
support icons] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
76 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
77 |
iconView <View> an optional icon-view (for animated icons) |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
78 |
[ignored if the display does not |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
79 |
supports this] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
80 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
81 |
iconLabel <String> the label in the icon |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
82 |
[ignored if the display does not |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
83 |
support label-tabs with icons] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
84 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
85 |
minExtent <Point> the minimum size |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
86 |
No limit, if nil |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
87 |
[the window manager may have its own |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
88 |
limit; typically some small area] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
89 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
90 |
maxExtent <Point> the maximum size |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
91 |
No limit, if nil. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
92 |
[the window manager may have its own |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
93 |
limit; typically the screen size] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
94 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
95 |
sizeFixed <Boolean> prevents the view from resizing itself |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
96 |
(especially to freeze a dialogs size) |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
97 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
98 |
application <AppModel> if nonNil, thats the application |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
99 |
Many requests (such as open/close etc. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
100 |
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
|
101 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
102 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
103 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
104 |
[class variables:] |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
105 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
106 |
DefaultIcon <Form> cached default icon |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
107 |
|
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
108 |
TakeFocusWhenMapped <Boolean> if true, views grab the keyboard |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
109 |
focus (convenient with some stupid |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
110 |
windowManagers) |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
111 |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
112 |
IncludeHostNameInLabel <Boolean> if true, the windows title shall |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
113 |
include the hostname. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
114 |
(convenient if you have many remote |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
115 |
views open simultaneously) |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
116 |
|
1880
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
117 |
WindowLabelFormat <Boolean> specifies the format for windowLabels |
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
118 |
|
616 | 119 |
|
120 |
[author:] |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
121 |
Claus Gittinger |
616 | 122 |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
123 |
[see also:] |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
124 |
WindowGroup |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
125 |
ApplicationModel |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
126 |
" |
1880
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
127 |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
128 |
! |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
129 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
130 |
examples |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
131 |
" |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
132 |
simple, empty topView: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
133 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
134 |
|topView| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
135 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
136 |
topView := StandardSystemView new. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
137 |
topView label:'my first view'. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
138 |
topView extent:200 @ 200. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
139 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
140 |
[exEnd] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
141 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
142 |
with an icon & iconLabel: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
143 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
144 |
|topView| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
145 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
146 |
topView := StandardSystemView extent:200 @ 200. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
147 |
topView label:'Hello world'. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
148 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
149 |
topView icon:(Image fromFile:'hello_world.icon'). |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
150 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
151 |
[exEnd] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
152 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
153 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
154 |
with an animated iconView [not supported on all display devices]: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
155 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
156 |
|iconView topView| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
157 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
158 |
iconView := ClockView new. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
159 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
160 |
topView := StandardSystemView extent:200 @ 200. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
161 |
topView label:'Hello world'. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
162 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
163 |
topView iconView:iconView. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
164 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
165 |
[exEnd] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
166 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
167 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
168 |
placing a subView into it: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
169 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
170 |
|topView button| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
171 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
172 |
topView := StandardSystemView new. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
173 |
topView label:'my second view'. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
174 |
topView extent:200 @ 200. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
175 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
176 |
button := Button label:'close' in:topView. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
177 |
button action:[topView destroy]. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
178 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
179 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
180 |
[exEnd] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
181 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
182 |
same, relative sized subview: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
183 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
184 |
|topView button| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
185 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
186 |
topView := StandardSystemView new. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
187 |
topView label:'my second view'. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
188 |
topView extent:200 @ 200. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
189 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
190 |
button := Button label:'close' in:topView. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
191 |
button action:[topView destroy]. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
192 |
button origin:0.25 @ 0.25 corner:0.75 @ 0.75. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
193 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
194 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
195 |
[exEnd] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
196 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
197 |
multiple buttons in a panel in a topView: |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
198 |
[exBegin] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
199 |
|topView panel button1 button2 button3| |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
200 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
201 |
topView := StandardSystemView new. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
202 |
topView label:'my second view'. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
203 |
topView extent:200 @ 200. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
204 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
205 |
panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:topView. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
206 |
panel inset:10. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
207 |
panel level:-1. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
208 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
209 |
button1 := Button label:'one' in:panel. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
210 |
button1 action:[Transcript showCR:'one pressed']. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
211 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
212 |
button2 := Button label:'two' in:panel. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
213 |
button2 action:[Transcript showCR:'two pressed']. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
214 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
215 |
button3 := Button label:'three' in:panel. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
216 |
button3 action:[Transcript showCR:'three pressed']. |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
217 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
218 |
topView open. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
219 |
[exEnd] |
46 | 220 |
" |
221 |
! ! |
|
0 | 222 |
|
269 | 223 |
!StandardSystemView class methodsFor:'instance creation'! |
183 | 224 |
|
269 | 225 |
extent:anExtent label:aLabel icon:aForm |
226 |
"create a new topView and define its extent, label and icon" |
|
180 | 227 |
|
269 | 228 |
^ self origin:nil extent:anExtent |
229 |
label:aLabel icon:aForm |
|
230 |
minExtent:nil maxExtent:nil |
|
81 | 231 |
! |
232 |
||
269 | 233 |
extent:anExtent label:aLabel icon:aForm minExtent:minExtent |
234 |
^ self origin:nil extent:anExtent |
|
235 |
label:aLabel icon:aForm |
|
236 |
minExtent:minExtent maxExtent:nil |
|
46 | 237 |
! |
238 |
||
269 | 239 |
extent:anExtent label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent |
240 |
^ self origin:nil extent:anExtent |
|
241 |
label:aLabel icon:aForm |
|
242 |
minExtent:minExtent maxExtent:maxExtent |
|
243 |
! |
|
0 | 244 |
|
269 | 245 |
extent:anExtent label:aLabel minExtent:minExtent |
246 |
"create a new topView and define its extent, label and minumum extent" |
|
0 | 247 |
|
269 | 248 |
^ self origin:nil extent:anExtent |
249 |
label:aLabel icon:nil |
|
250 |
minExtent:minExtent maxExtent:nil |
|
0 | 251 |
! |
252 |
||
253 |
label:aLabel |
|
254 |
"create a new topView and define its label" |
|
255 |
||
256 |
^ self origin:nil extent:nil |
|
72 | 257 |
label:aLabel icon:nil |
258 |
minExtent:nil maxExtent:nil |
|
0 | 259 |
! |
260 |
||
261 |
label:aLabel icon:aForm |
|
81 | 262 |
"create a new topView and define its label and icon" |
263 |
||
0 | 264 |
^ self origin:nil extent:nil |
72 | 265 |
label:aLabel icon:aForm |
266 |
minExtent:nil maxExtent:nil |
|
0 | 267 |
! |
268 |
||
269 |
label:aLabel icon:aForm minExtent:anExtent |
|
81 | 270 |
"create a new topView and define its label, icon and minumum extent" |
271 |
||
0 | 272 |
^ self origin:nil extent:nil |
72 | 273 |
label:aLabel icon:aForm |
274 |
minExtent:anExtent maxExtent:nil |
|
0 | 275 |
! |
276 |
||
277 |
label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent |
|
81 | 278 |
"create a new topView and define its label, icon, min and max extents" |
279 |
||
0 | 280 |
^ self origin:nil extent:nil |
72 | 281 |
label:aLabel icon:aForm |
282 |
minExtent:minExtent maxExtent:maxExtent |
|
0 | 283 |
! |
284 |
||
269 | 285 |
label:aLabel minExtent:anExtent |
286 |
"create a new topView and define its label and minimum extent" |
|
287 |
||
288 |
^ self origin:nil extent:nil |
|
289 |
label:aLabel icon:nil |
|
290 |
minExtent:anExtent maxExtent:nil |
|
291 |
! |
|
292 |
||
293 |
model:aModel label:aLabel minimumSize:minExtent |
|
294 |
"ST80-style instance creation" |
|
295 |
||
296 |
|newView| |
|
297 |
||
298 |
newView := self origin:nil |
|
299 |
extent:minExtent |
|
300 |
label:aLabel |
|
301 |
icon:nil |
|
302 |
minExtent:minExtent |
|
303 |
maxExtent:nil. |
|
304 |
newView model:aModel. |
|
305 |
"/ newView controller:(self defaultControllerClass new view:newView). |
|
306 |
^ newView |
|
307 |
! |
|
308 |
||
0 | 309 |
origin:anOrigin extent:anExtent label:aLabel |
81 | 310 |
"create a new topView and define its origin, extent and label" |
311 |
||
0 | 312 |
^ self origin:anOrigin extent:anExtent |
72 | 313 |
label:aLabel icon:nil |
314 |
minExtent:nil maxExtent:nil |
|
0 | 315 |
! |
316 |
||
317 |
origin:anOrigin label:aLabel icon:aForm |
|
72 | 318 |
minExtent:minExtent maxExtent:maxExtent |
81 | 319 |
"create a new topView and define its origin, extent, label, icon |
320 |
and extent-boundaries." |
|
321 |
||
0 | 322 |
^ self origin:anOrigin extent:nil |
72 | 323 |
label:aLabel icon:aForm |
324 |
minExtent:minExtent maxExtent:maxExtent |
|
269 | 325 |
! ! |
326 |
||
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
327 |
!StandardSystemView class methodsFor:'class initialization'! |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
328 |
|
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
329 |
initialize |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
330 |
IncludeHostNameInLabel := false. |
1880
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
331 |
"/ WindowLabelFormat := '%2:%1'. "/ the old format |
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
332 |
"/ WindowLabelFormat := '%1 @ %2'. |
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
333 |
WindowLabelFormat := '%1 [%2]'. |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
334 |
TakeFocusWhenMapped := false. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
335 |
|
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
336 |
"Created: 20.8.1997 / 14:16:32 / cg" |
1880
2900f8770585
more flexible windowLabel formats.
Claus Gittinger <cg@exept.de>
parents:
1878
diff
changeset
|
337 |
"Modified: 20.8.1997 / 20:11:10 / cg" |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
338 |
! ! |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
339 |
|
269 | 340 |
!StandardSystemView class methodsFor:'defaults'! |
341 |
||
1865
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
342 |
defaultExtent |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
343 |
"return a standardSystemViews default window extent" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
344 |
|
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
345 |
DefaultExtent notNil ifTrue:[ |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
346 |
^ DefaultExtent |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
347 |
]. |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
348 |
^ super defaultExtent |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
349 |
|
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
350 |
"Created: 15.8.1997 / 01:36:21 / cg" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
351 |
! |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
352 |
|
269 | 353 |
defaultIcon |
1612 | 354 |
"return a topViews default window icon" |
355 |
||
356 |
<resource: #style (#ICON #ICON_FILE)> |
|
357 |
||
358 |
|nm i| |
|
269 | 359 |
|
1612 | 360 |
(i := DefaultIcon) isNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
361 |
i := self classResources at:'ICON' default:nil. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
362 |
i isNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
363 |
nm := ClassResources at:'ICON_FILE' default:'SmalltalkX.xbm'. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
364 |
i := Image fromFile:nm resolution:100. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
365 |
i isNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
366 |
i := Image fromFile:('bitmaps/' , nm) resolution:100. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
367 |
] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
368 |
]. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
369 |
i notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
370 |
DefaultIcon := i := i on:Display |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
371 |
] |
269 | 372 |
]. |
1612 | 373 |
^ i |
1464 | 374 |
|
1612 | 375 |
"Modified: 18.4.1997 / 15:17:22 / cg" |
269 | 376 |
! |
377 |
||
378 |
defaultLabel |
|
379 |
"return the default label for views of my kind. |
|
380 |
This can be redefined in subclasses or overwritten in |
|
381 |
initialize methods." |
|
382 |
||
383 |
^ 'aView' |
|
384 |
! |
|
385 |
||
386 |
includeHostNameInLabel |
|
387 |
"return the flag which controls if a views label should |
|
388 |
include the hostname. |
|
389 |
This flag is usually set/cleared in your private.rc file; |
|
390 |
the default is false." |
|
391 |
||
392 |
^ IncludeHostNameInLabel |
|
393 |
||
394 |
"Created: 10.9.1995 / 19:21:16 / claus" |
|
395 |
! |
|
396 |
||
397 |
includeHostNameInLabel:aBoolean |
|
398 |
"set/clear the flag which controls if a views label should |
|
399 |
include the hostname - this is highly useful if you have |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
400 |
multiple smalltalks open simultaneously ... |
269 | 401 |
This flag is usually set/cleared in your private.rc file; |
402 |
the default is false." |
|
403 |
||
404 |
IncludeHostNameInLabel := aBoolean |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
405 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
406 |
"Modified: 24.4.1996 / 09:09:21 / cg" |
1260
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
407 |
! |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
408 |
|
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
409 |
takeFocusWhenMapped |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
410 |
^ TakeFocusWhenMapped |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
411 |
|
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
412 |
" |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
413 |
StandardSystemView takeFocusWhenMapped |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
414 |
" |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
415 |
! |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
416 |
|
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
417 |
takeFocusWhenMapped:aBoolean |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
418 |
"if turned on, topViews will grab the keyboard when mapped. |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
419 |
This is useful on systems like openView, where a view needs a click |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
420 |
otherwise" |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
421 |
|
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
422 |
TakeFocusWhenMapped := aBoolean |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
423 |
|
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
424 |
" |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
425 |
StandardSystemView takeFocusWhenMapped:true |
a89bbf1a52a2
added public access to TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
426 |
" |
1865
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
427 |
! |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
428 |
|
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
429 |
updateStyleCache |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
430 |
"extract values from the styleSheet and cache them in class variables" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
431 |
|
1931 | 432 |
<resource: #style (#'standardSystemView.defaultExtent')> |
1865
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
433 |
|
1931 | 434 |
DefaultExtent := StyleSheet at:'standardSystemView.defaultExtent' default:nil. |
1865
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
435 |
|
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
436 |
" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
437 |
self updateStyleCache |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
438 |
" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
439 |
|
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
440 |
"Modified: 31.8.1995 / 03:01:14 / claus" |
43c2eaba229d
allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
441 |
"Created: 15.8.1997 / 01:34:37 / cg" |
1931 | 442 |
"Modified: 20.10.1997 / 15:13:50 / cg" |
269 | 443 |
! ! |
444 |
||
445 |
!StandardSystemView class methodsFor:'startup'! |
|
446 |
||
447 |
open |
|
448 |
"create, realize the view - this topview and all its subviews will |
|
449 |
run as a separate process with its own windowGroup" |
|
450 |
||
451 |
^ self new open |
|
452 |
! |
|
453 |
||
454 |
start |
|
455 |
"create, realize the view - this topview and all its subviews will |
|
456 |
run as a separate process with its own windowGroup. |
|
457 |
This method exists for backward compatibility - use open." |
|
458 |
||
459 |
^ self open |
|
460 |
! ! |
|
461 |
||
1939
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
462 |
!StandardSystemView methodsFor:'ST-80 compatibility'! |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
463 |
|
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
464 |
menuBar |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
465 |
"return my menuBar or nil if I have none. |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
466 |
This is only valid for topViews which were built with the UIBuilder." |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
467 |
|
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
468 |
^ application builder menuBar |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
469 |
|
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
470 |
"Created: / 27.10.1997 / 16:23:13 / cg" |
1944 | 471 |
! |
472 |
||
473 |
quit |
|
474 |
"same as closeRequest (but sometimes send via the sensors event queue)" |
|
475 |
||
476 |
self closeRequest |
|
477 |
||
478 |
"Created: / 30.10.1997 / 19:23:01 / cg" |
|
1939
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
479 |
! ! |
a32908e2214d
added #menuBar for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
480 |
|
269 | 481 |
!StandardSystemView methodsFor:'accessing'! |
482 |
||
483 |
application |
|
484 |
"return the topViews application. |
|
485 |
This is new protocol for ST-80 compatibility and not yet fully supported" |
|
486 |
||
487 |
^ application |
|
488 |
! |
|
489 |
||
490 |
application:anApplicationModel |
|
491 |
"set the topViews application. |
|
492 |
This is new protocol for ST-80 compatibility and not yet fully supported" |
|
493 |
||
570
8a7c398caa94
preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
494 |
application := anApplicationModel. |
8a7c398caa94
preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
495 |
anApplicationModel notNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
496 |
anApplicationModel window isNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
497 |
anApplicationModel window:self |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
498 |
] |
570
8a7c398caa94
preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
499 |
] |
8a7c398caa94
preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
500 |
|
8a7c398caa94
preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
501 |
"Modified: 18.4.1996 / 14:55:44 / cg" |
269 | 502 |
! |
503 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
504 |
name |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
505 |
"return the topViews label" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
506 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
507 |
^ label |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
508 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
509 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
510 |
!StandardSystemView methodsFor:'accessing-behavior'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
511 |
|
269 | 512 |
bePartner |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
513 |
"define me as a partner-View. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
514 |
All partners within the applications windowGroup iconify/deiconify together." |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
515 |
|
269 | 516 |
self setWindowGroupFromApplication. |
517 |
super bePartner. |
|
518 |
||
298 | 519 |
" |
520 |
see example in TopView>>bePartner |
|
521 |
" |
|
522 |
||
269 | 523 |
"Created: 22.9.1995 / 17:40:15 / claus" |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
524 |
"Modified: 6.3.1996 / 16:16:42 / cg" |
269 | 525 |
! |
526 |
||
527 |
beSlave |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
528 |
"define me as a slave-View. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
529 |
All slaves within the applications windowGroup iconify/deiconify with the masterView(s)" |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
530 |
|
269 | 531 |
self setWindowGroupFromApplication. |
532 |
super beSlave. |
|
533 |
||
298 | 534 |
" |
535 |
see example in TopView>>beSlave |
|
536 |
" |
|
537 |
||
269 | 538 |
"Created: 22.9.1995 / 17:40:15 / claus" |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
539 |
"Modified: 6.3.1996 / 16:16:50 / cg" |
269 | 540 |
! |
541 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
542 |
sendWindowEvents:collectionOfEventSymbols |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
543 |
"define the events that are to be forwarded to the application. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
544 |
This is being implemented ..." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
545 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
546 |
windowEventsForApplication := collectionOfEventSymbols |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
547 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
548 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
549 |
sizeFixed:aBoolean |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
550 |
"this prevents the view from resizing itself when realized. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
551 |
For normal topViews, this is void, since they dont do this anyway. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
552 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
553 |
However, modalBoxes (especially: DialogBoxes) typically resize themselfes |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
554 |
to the preferredExtent of their components. In some cases, this behavior is |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
555 |
not desired and it should be turned off by setting sizeFixed to true. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
556 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
557 |
To avoid confusion: |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
558 |
This does NOT prevent the window manager from resizing the view, |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
559 |
instead it tells the view to NOT resize ITSELF." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
560 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
561 |
sizeFixed := aBoolean. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
562 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
563 |
"example: dialog which resizes itself on #open: |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
564 |
(thereby ignoring the 200@200 extent) |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
565 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
566 |
|dialog| |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
567 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
568 |
dialog := Dialog new. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
569 |
dialog addInputFieldOn:'' asValue. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
570 |
dialog addOkButton. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
571 |
dialog extent:200@200. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
572 |
dialog open. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
573 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
574 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
575 |
using sizeFixed: |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
576 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
577 |
|dialog| |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
578 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
579 |
dialog := Dialog new. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
580 |
dialog addInputFieldOn:'' asValue. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
581 |
dialog addOkButton. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
582 |
dialog extent:200@200; sizeFixed:true. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
583 |
dialog open. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
584 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
585 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
586 |
using openWithExtent (also sets sizeFixed): |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
587 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
588 |
|dialog| |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
589 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
590 |
dialog := Dialog new. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
591 |
dialog addInputFieldOn:'' asValue. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
592 |
dialog addOkButton. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
593 |
dialog openWithExtent:200@200. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
594 |
" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
595 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
596 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
597 |
!StandardSystemView methodsFor:'accessing-dimensions'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
598 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
599 |
maxExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
600 |
"return the views maximum allowed extent" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
601 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
602 |
^ maxExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
603 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
604 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
605 |
maxExtent:max |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
606 |
"define the maximum extent the view may have - |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
607 |
depends on good-will of window manager" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
608 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
609 |
maxExtent := max. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
610 |
(width notNil and:[height notNil]) ifTrue:[ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
611 |
((width > (maxExtent x)) or: |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
612 |
[height > (maxExtent y)]) ifTrue: [ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
613 |
self extent:maxExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
614 |
] |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
615 |
] |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
616 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
617 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
618 |
maximumSize:anExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
619 |
"same as maxExtent: for ST-80 compatibility" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
620 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
621 |
^ self maxExtent:anExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
622 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
623 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
624 |
minExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
625 |
"return the views minimum allowed extent" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
626 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
627 |
^ minExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
628 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
629 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
630 |
minExtent:min |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
631 |
"define the minimum extent the view may have - |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
632 |
depends on good-will of window manager" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
633 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
634 |
minExtent := min. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
635 |
(width notNil and:[height notNil]) ifTrue:[ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
636 |
((width < (minExtent x)) or: |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
637 |
[height < (minExtent y)]) ifTrue: [ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
638 |
self extent:minExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
639 |
] |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
640 |
] |
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 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
643 |
minimumSize |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
644 |
"same as minExtent for ST-80 compatibility" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
645 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
646 |
^ self minExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
647 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
648 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
649 |
minimumSize:anExtent |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
650 |
"same as minExtent: for ST-80 compatibility" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
651 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
652 |
^ self minExtent:anExtent |
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 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
655 |
!StandardSystemView methodsFor:'accessing-look'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
621
diff
changeset
|
656 |
|
269 | 657 |
icon |
658 |
"return the form defined as icon" |
|
659 |
||
660 |
^ icon |
|
0 | 661 |
! |
662 |
||
1538 | 663 |
icon:aFormOrImage |
664 |
"define the form or image (bitmap) used as icon" |
|
269 | 665 |
|
1538 | 666 |
|i m| |
269 | 667 |
|
1538 | 668 |
icon := aFormOrImage. |
269 | 669 |
icon notNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
670 |
drawableId notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
671 |
i := self convertedIcon:icon. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
672 |
(i notNil and:[i id notNil]) ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
673 |
(m := icon mask) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
674 |
m := self convertedIconMask:m. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
675 |
]. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
676 |
device setWindowIcon:i mask:m in:drawableId |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
677 |
] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
678 |
] |
269 | 679 |
] |
816 | 680 |
|
1538 | 681 |
"Modified: 4.4.1997 / 16:20:52 / cg" |
269 | 682 |
! |
683 |
||
684 |
iconLabel |
|
685 |
"return the name displayed in the icon" |
|
686 |
||
687 |
^ iconLabel |
|
688 |
! |
|
689 |
||
690 |
iconLabel:aString |
|
691 |
"define the name to be displayed in the icon" |
|
692 |
||
693 |
iconLabel := aString. |
|
694 |
drawableId notNil ifTrue:[ |
|
695 |
device setIconName:aString in:drawableId. |
|
696 |
" |
|
697 |
unbuffered - to make it visible right NOW |
|
698 |
" |
|
699 |
device flush. |
|
700 |
] |
|
701 |
! |
|
81 | 702 |
|
1464 | 703 |
iconMask |
704 |
"return the form defined as iconMask. |
|
705 |
Notice, that many windowManagers ignore this mask |
|
706 |
(usually, only managers which place icons on the background desktop |
|
707 |
care for an icon - if at all ...)" |
|
708 |
||
709 |
|mask| |
|
710 |
||
711 |
"/ only images possibly have iconMasks |
|
712 |
icon notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
713 |
(mask := icon mask) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
714 |
^ self convertedIconMask:mask |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
715 |
] |
1464 | 716 |
]. |
717 |
||
718 |
^ nil |
|
1538 | 719 |
|
720 |
"Modified: 4.4.1997 / 16:39:00 / cg" |
|
1464 | 721 |
! |
722 |
||
269 | 723 |
iconName:aString |
724 |
"this method will vanish soon ... - for backward compatibility" |
|
725 |
||
726 |
self iconLabel:aString |
|
727 |
! |
|
728 |
||
729 |
iconView |
|
730 |
"return the view used as icon-view" |
|
731 |
||
732 |
^ iconView |
|
733 |
! |
|
734 |
||
735 |
iconView:aView |
|
1538 | 736 |
"specify the view to be used as icon. |
737 |
This may not be supported on all display types" |
|
269 | 738 |
|
739 |
iconView := aView. |
|
740 |
drawableId notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
741 |
aView create. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
742 |
device setWindowIconWindow:aView in:drawableId. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
743 |
aView setRealized:true. |
269 | 744 |
] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
745 |
|
1538 | 746 |
"Modified: 4.4.1997 / 16:21:37 / cg" |
269 | 747 |
! |
748 |
||
749 |
label |
|
750 |
"return the views name in the title area" |
|
751 |
||
752 |
^ label |
|
753 |
! |
|
754 |
||
755 |
label:aString |
|
756 |
"define the views name in the windows title area. |
|
757 |
If IncludeHostNameInLabel is true, prepend the hostname |
|
758 |
(you will appreciate this, if you are working on multiple |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
759 |
machines simultaneously - as I do ...)" |
269 | 760 |
|
761 |
aString ~= label ifTrue:[ |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
762 |
label := aString. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
763 |
drawableId notNil ifTrue: [ |
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
764 |
device setWindowName:(self windowLabelFor:aString) in:drawableId. |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
765 |
" |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
766 |
unbuffered - to make it visible right NOW |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
767 |
" |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
768 |
device flush. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
769 |
] |
269 | 770 |
] |
771 |
||
772 |
"Created: 8.9.1995 / 19:37:06 / claus" |
|
773 |
"Modified: 8.9.1995 / 19:39:18 / claus" |
|
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
774 |
"Modified: 22.9.1997 / 10:12:23 / cg" |
0 | 775 |
! |
776 |
||
269 | 777 |
label:labelString iconLabel:iconLabelString |
778 |
"set both the label and the iconLabel" |
|
779 |
||
780 |
self label:labelString. |
|
781 |
self iconLabel:iconLabelString |
|
782 |
! ! |
|
783 |
||
784 |
!StandardSystemView methodsFor:'destroying'! |
|
785 |
||
786 |
closeRequest |
|
787 |
"programmatic close request" |
|
788 |
||
789 |
^ self terminate |
|
790 |
! |
|
791 |
||
792 |
destroy |
|
793 |
"destroy the view." |
|
794 |
||
795 |
self removeFromCurrentProject. |
|
796 |
windowGroup notNil ifTrue:[ |
|
797 |
windowGroup focusSequence:nil. |
|
798 |
]. |
|
799 |
application notNil ifTrue:[ |
|
800 |
application windowEvent:(#close -> self) from:self |
|
801 |
]. |
|
802 |
super destroy. |
|
0 | 803 |
! |
804 |
||
269 | 805 |
saveAndTerminate |
806 |
"save & terminate request from the windowManager. The application should |
|
807 |
save its data/files/text etc. somehow and close. |
|
808 |
If there is an application, let it decide how do do that. |
|
809 |
Otherwise, forward it to superclasses which knows how to do this. |
|
810 |
(it defaults to a terminate there). |
|
811 |
Notice, that not all windowmanagers are nice enough |
|
812 |
to send this request; some simply distroy the view." |
|
813 |
||
814 |
application notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
815 |
application saveAndTerminateRequestFor:self |
269 | 816 |
] ifFalse:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
817 |
super saveAndTerminate |
269 | 818 |
] |
819 |
! |
|
820 |
||
821 |
terminate |
|
822 |
"terminate request from the windowManager. If there is an application, |
|
823 |
let it decide if it really wants to be close. Otherwise, forward it to |
|
824 |
superclasses terminate which knows how to do this. |
|
825 |
Notice, that not all windowmanagers are nice enough |
|
826 |
to send this request; some simply distroy the view." |
|
827 |
||
828 |
application notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
829 |
application closeRequestFor:self |
269 | 830 |
] ifFalse:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
831 |
super terminate |
269 | 832 |
] |
833 |
! ! |
|
834 |
||
835 |
!StandardSystemView methodsFor:'event handling'! |
|
836 |
||
837 |
focusIn |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
838 |
"the view got the keyboard focus (via the window manager)" |
269 | 839 |
|
840 |
|v| |
|
841 |
||
842 |
windowGroup notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
843 |
(v := windowGroup focusView) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
844 |
v showFocus:false. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
845 |
^ self |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
846 |
] |
269 | 847 |
]. |
1382 | 848 |
super focusIn |
655 | 849 |
|
1382 | 850 |
"Modified: 25.2.1997 / 23:19:46 / cg" |
269 | 851 |
! |
852 |
||
853 |
focusOut |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
328
diff
changeset
|
854 |
"the view lost keyboard focus (via the window manager)" |
269 | 855 |
|
856 |
|v| |
|
857 |
||
858 |
windowGroup notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
859 |
(v := windowGroup focusView) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
860 |
v showNoFocus:false. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
861 |
^ self |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
862 |
] |
269 | 863 |
]. |
1382 | 864 |
super focusOut |
655 | 865 |
|
1382 | 866 |
"Modified: 25.2.1997 / 23:19:54 / cg" |
269 | 867 |
! |
868 |
||
869 |
mapped |
|
870 |
"the view got mapped" |
|
871 |
||
872 |
super mapped. |
|
873 |
" |
|
874 |
ask for the focus - this avoids having to click on the |
|
875 |
view with WM's which need an explicit click. |
|
876 |
Q: is this a good idea ? |
|
877 |
" |
|
878 |
TakeFocusWhenMapped == true ifTrue:[ |
|
879 |
self getKeyboardFocus. |
|
880 |
] |
|
881 |
! |
|
882 |
||
328 | 883 |
showActivity:someMessage |
597 | 884 |
"some activityNotification shalt be communicated to |
885 |
the user. Forward it to my application (if any). |
|
886 |
(that one should know how to deal with it). |
|
887 |
Otherwise, simply ignore it." |
|
888 |
||
328 | 889 |
application notNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
890 |
application showActivity:someMessage |
328 | 891 |
] |
892 |
||
893 |
"Created: 16.12.1995 / 18:40:44 / cg" |
|
597 | 894 |
"Modified: 23.4.1996 / 21:38:11 / cg" |
0 | 895 |
! ! |
896 |
||
897 |
!StandardSystemView methodsFor:'initialization'! |
|
898 |
||
899 |
addToCurrentProject |
|
46 | 900 |
"add the receiver (a topview) to the current projects set-of-views. |
901 |
(If there is a current project)" |
|
902 |
||
72 | 903 |
|p| |
69 | 904 |
|
905 |
" |
|
72 | 906 |
the following check allows systems |
907 |
without projects and changeSets |
|
69 | 908 |
" |
72 | 909 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
910 |
p addView: self |
|
69 | 911 |
] |
912 |
! |
|
12 | 913 |
|
269 | 914 |
defaultControllerClass |
915 |
"for ST-80 compatibility only - not used in ST/X" |
|
916 |
||
917 |
^ nil "/ StandardSystemController |
|
918 |
! |
|
919 |
||
920 |
initEvents |
|
921 |
super initEvents. |
|
922 |
self enableFocusEvents. |
|
923 |
! |
|
924 |
||
925 |
initialize |
|
926 |
super initialize. |
|
69 | 927 |
|
269 | 928 |
borderWidth := 2. "- notice: many window managers ignore this" |
929 |
minExtent := 10 @ 10. |
|
1703 | 930 |
maxExtent := device usableExtent. |
269 | 931 |
label isNil ifTrue:[label := self class defaultLabel]. |
932 |
icon isNil ifTrue:[icon := self class defaultIcon]. |
|
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
827
diff
changeset
|
933 |
|
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
827
diff
changeset
|
934 |
"Modified: 14.6.1996 / 17:18:28 / stefan" |
269 | 935 |
! |
936 |
||
937 |
reAdjustGeometry |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
938 |
"sent as a final step when an image is restarted. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
939 |
when we come up on a smaller display, |
269 | 940 |
make certain, that the receiver is visible" |
941 |
||
942 |
|dX dY limitRight limitBottom| |
|
943 |
||
944 |
dX := (device horizontalPixelPerMillimeter * 20) rounded. |
|
945 |
dY := (device verticalPixelPerMillimeter * 20) rounded. |
|
69 | 946 |
|
1703 | 947 |
limitRight := device usableWidth - dX. |
948 |
limitBottom := device usableHeight - dY. |
|
269 | 949 |
((self left > limitRight) or:[ |
950 |
self top > limitBottom]) ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
951 |
'StandardSystemView [info]: moving view into visible area' infoPrintCR. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
952 |
self origin:limitRight @ limitBottom |
269 | 953 |
] |
954 |
||
1163 | 955 |
"Modified: 10.1.1997 / 15:12:19 / cg" |
0 | 956 |
! |
957 |
||
24 | 958 |
reinitialize |
46 | 959 |
"reopen the receiver if if was visible before. |
960 |
This is called right after snapIn; Notice, that all instance variables |
|
72 | 961 |
(such as shown, realized etc.) are left-overs from the time the snapout |
46 | 962 |
was done. Remap the receiver, if it was mapped at snapout time" |
24 | 963 |
|
964 |
|myController| |
|
965 |
||
966 |
"if I have already been reinited - return" |
|
967 |
drawableId notNil ifTrue:[ |
|
72 | 968 |
^ self |
24 | 969 |
]. |
970 |
||
46 | 971 |
"have to kludge with the controller |
972 |
- otherwise its startup performs unwanted actions ..." |
|
973 |
||
24 | 974 |
myController := controller. |
975 |
controller := nil. |
|
46 | 976 |
|
977 |
"physically create the view & subviews" |
|
24 | 978 |
self recreate. |
979 |
||
980 |
"if I was mapped, do it again" |
|
981 |
realized ifTrue:[ |
|
72 | 982 |
"if it was iconified, try to remap iconified" |
89 | 983 |
device mapView:self id:drawableId iconified:(shown not) |
984 |
atX:left y:top width:width height:height. |
|
24 | 985 |
|
72 | 986 |
"and restart the window-group process" |
987 |
windowGroup notNil ifTrue:[ |
|
988 |
windowGroup restart |
|
989 |
] |
|
24 | 990 |
]. |
991 |
||
992 |
"restore controller" |
|
993 |
controller := myController |
|
994 |
! |
|
995 |
||
269 | 996 |
removeFromCurrentProject |
997 |
"remove the receiver (a topview) from the current projects set-of-views. |
|
998 |
(If there is a current project)" |
|
46 | 999 |
|
269 | 1000 |
|p| |
12 | 1001 |
|
269 | 1002 |
" |
1003 |
the following check allows systems |
|
1004 |
without projects and changeSets |
|
1005 |
" |
|
1006 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
|
1007 |
p removeView:self |
|
89 | 1008 |
] |
1009 |
! |
|
1010 |
||
140 | 1011 |
restarted |
1012 |
"sent by my windowGroup, when restarted from an image. |
|
1013 |
Nothing done here, but can be redefined to perform any actions |
|
1014 |
required to reset the application after an image-restart. |
|
1015 |
(for example: check if application files are still around, restart |
|
1016 |
subprocesses etc.)." |
|
1017 |
||
1018 |
application notNil ifTrue:[ |
|
1019 |
application restarted |
|
1020 |
]. |
|
0 | 1021 |
! ! |
1022 |
||
269 | 1023 |
!StandardSystemView methodsFor:'printing & storing'! |
142 | 1024 |
|
269 | 1025 |
displayString |
1026 |
"just for your convenience in inspectors ... |
|
1027 |
... add the views label to the displayString." |
|
142 | 1028 |
|
269 | 1029 |
|s| |
142 | 1030 |
|
269 | 1031 |
s := super displayString. |
1032 |
label notNil ifTrue:[ |
|
1033 |
s := s , '(' , label , ')' |
|
157 | 1034 |
]. |
269 | 1035 |
^ s |
0 | 1036 |
! ! |
1037 |
||
24 | 1038 |
!StandardSystemView methodsFor:'private'! |
1039 |
||
1040 |
convertedIcon |
|
1425
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1041 |
"make certain, that the icon is compatible with my device; |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1042 |
this means converting it to a format (typically: monochrome) which |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1043 |
the device supports. Return a compatible version of the icon." |
24 | 1044 |
|
816 | 1045 |
^ self convertedIcon:icon |
1046 |
||
1047 |
"Modified: 10.6.1996 / 19:42:20 / cg" |
|
1048 |
! |
|
1049 |
||
1050 |
convertedIcon:icon |
|
1425
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1051 |
"make certain, that the image argument is compatible with my device; |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1052 |
this means converting it to a format (typically: monochrome) which |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1053 |
the device supports. Return a compatible version of the icon." |
816 | 1054 |
|
825 | 1055 |
|deviceIcon d toMono toDeep| |
24 | 1056 |
|
1057 |
icon isNil ifTrue:[^ nil]. |
|
1058 |
||
825 | 1059 |
toMono := toDeep := false. |
1060 |
||
1061 |
d := icon depth. |
|
81 | 1062 |
device supportsDeepIcons ifFalse:[ |
1755 | 1063 |
(d ~~ 1 or:[icon isImage]) ifTrue:[ |
1064 |
" |
|
1065 |
dither to monochrome |
|
1066 |
" |
|
1067 |
toMono := true. |
|
1068 |
] |
|
816 | 1069 |
] ifTrue:[ |
1755 | 1070 |
d == 1 ifTrue:[ |
1071 |
icon colorMap notNil ifTrue:[ |
|
1072 |
icon isImage ifFalse:[ |
|
1073 |
toMono := true. |
|
1074 |
] ifTrue:[ |
|
1075 |
toDeep := true. |
|
1076 |
] |
|
1077 |
] |
|
1078 |
] ifFalse:[ |
|
1079 |
d ~~ device depth ifTrue:[ |
|
1080 |
icon isImage ifFalse:[ |
|
1081 |
toMono := true. |
|
1082 |
] ifTrue:[ |
|
1083 |
toDeep := true. |
|
1084 |
] |
|
1085 |
] |
|
1086 |
] |
|
825 | 1087 |
]. |
1088 |
||
1089 |
deviceIcon := icon. |
|
1090 |
toMono ifTrue:[ |
|
1755 | 1091 |
deviceIcon := icon asMonochromeFormOn:device. |
825 | 1092 |
]. |
1093 |
toDeep ifTrue:[ |
|
1755 | 1094 |
deviceIcon := (Image implementorForDepth:device depth) |
1095 |
fromImage:icon. |
|
24 | 1096 |
]. |
816 | 1097 |
|
24 | 1098 |
deviceIcon notNil ifTrue:[ |
1755 | 1099 |
" |
1100 |
get device pixmap (i.e. allocate colors & resource) |
|
1101 |
" |
|
1102 |
deviceIcon := deviceIcon onDevice:device |
|
24 | 1103 |
]. |
1104 |
^ deviceIcon |
|
816 | 1105 |
|
1106 |
"Created: 10.6.1996 / 19:41:31 / cg" |
|
1755 | 1107 |
"Modified: 17.6.1997 / 11:46:44 / cg" |
193 | 1108 |
! |
1109 |
||
1425
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1110 |
convertedIconMask:aMask |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1111 |
"return a version of the argument which can be used as an iconMask |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1112 |
on my device. Typically, this means conversion to a monochrome |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1113 |
mask - future versions may add alpha channel masks, if the device supports |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1114 |
them ..." |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1115 |
|
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1116 |
aMask depth ~~ 1 ifTrue:[ |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1117 |
^ aMask asMonochromeFormOn |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1118 |
]. |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1119 |
^ aMask |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1120 |
! |
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1405
diff
changeset
|
1121 |
|
193 | 1122 |
setWindowGroupFromApplication |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1123 |
"get the applications topView and set my windowGroup to its wg." |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1124 |
|
193 | 1125 |
|win| |
1126 |
||
1127 |
windowGroup isNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1128 |
application notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1129 |
(win := application window) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1130 |
windowGroup := win windowGroup. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1131 |
] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1132 |
] |
193 | 1133 |
]. |
1134 |
||
1135 |
"Created: 22.9.1995 / 17:40:36 / claus" |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1136 |
"Modified: 6.3.1996 / 16:17:32 / cg" |
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1137 |
! |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1138 |
|
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1139 |
windowLabelFor:labelString |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1140 |
"return an expanded labelString, according to the hostName-in-window setting" |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1141 |
|
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1142 |
(IncludeHostNameInLabel == true |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1143 |
and:[WindowLabelFormat notNil]) ifTrue:[ |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1144 |
^ WindowLabelFormat bindWith:labelString with:(OperatingSystem getHostName) |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1145 |
]. |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1146 |
^ labelString |
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1147 |
|
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1148 |
"Created: 22.9.1997 / 10:10:32 / cg" |
24 | 1149 |
! ! |
1150 |
||
269 | 1151 |
!StandardSystemView methodsFor:'queries'! |
1152 |
||
1153 |
focusSequence |
|
1154 |
"return a sequence which defines the order in which the focus |
|
1155 |
is passed for FocusNext and FocusPrevious keys. |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1156 |
|
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1157 |
All views which like to support these keys should either redefine |
269 | 1158 |
this method and return a collection of (sub-) views. |
1159 |
Or, if the model is some applicationModel, it may itself define |
|
1160 |
the focusSequence. |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1161 |
Or, somehow let me (via focusSequence:) know about the order. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1162 |
|
269 | 1163 |
Notice: I dont think this is good style: the focusSequence seems |
1944 | 1164 |
to belong into the controller or the builder ..." |
269 | 1165 |
|
1166 |
"/ |
|
1167 |
"/ if I have an application, its supposed to |
|
1168 |
"/ know about the focusSequence |
|
1169 |
"/ |
|
1170 |
application notNil ifTrue:[ |
|
1944 | 1171 |
^ application focusSequence |
269 | 1172 |
]. |
1173 |
||
1944 | 1174 |
"/ is that really a good idea ? |
1175 |
||
269 | 1176 |
(model notNil |
1177 |
and:[(model respondsTo:#focusSequence) |
|
1178 |
and:[model ~~ self]]) ifTrue:[ |
|
1944 | 1179 |
^ model focusSequence |
269 | 1180 |
]. |
1181 |
^ nil |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1182 |
|
1944 | 1183 |
"Modified: / 31.10.1997 / 19:14:02 / cg" |
269 | 1184 |
! |
1185 |
||
298 | 1186 |
isModal |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1187 |
"return true, if the receiver has been opened modal" |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1188 |
|
298 | 1189 |
windowGroup isNil ifTrue:[^ false]. |
1190 |
^ windowGroup isModal |
|
1191 |
||
1192 |
"Created: 10.12.1995 / 13:11:17 / cg" |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1193 |
"Modified: 24.4.1996 / 09:46:31 / cg" |
298 | 1194 |
! |
1195 |
||
269 | 1196 |
processName |
1197 |
"return a string to be shown for my process in the |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1198 |
process monitor. This has no semantic meaning, but exists |
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1199 |
for your convenience only." |
269 | 1200 |
|
1201 |
application notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1202 |
^ application processName |
269 | 1203 |
]. |
1204 |
label notNil ifTrue:[^ label]. |
|
1205 |
^ super processName |
|
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1206 |
|
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1207 |
"Modified: 24.4.1996 / 09:47:01 / cg" |
269 | 1208 |
! ! |
1209 |
||
0 | 1210 |
!StandardSystemView methodsFor:'realization'! |
1211 |
||
1405 | 1212 |
collapse |
1213 |
"iconify the receiver" |
|
1214 |
||
1215 |
shown ifTrue:[ |
|
1820 | 1216 |
self unmap. |
1405 | 1217 |
|
1820 | 1218 |
"if it was iconified, try to remap iconified" |
1219 |
device mapView:self id:drawableId iconified:true |
|
1220 |
atX:left y:top width:width height:height. |
|
1221 |
shown := false. |
|
1405 | 1222 |
]. |
1223 |
||
1224 |
" |
|
1225 |
|top| |
|
1226 |
||
1227 |
top := StandardSystemView new. |
|
1228 |
top label:'hello'. |
|
1229 |
top openAndWait. |
|
1820 | 1230 |
Delay waitForSeconds:2. |
1231 |
top collapse. |
|
1232 |
Delay waitForSeconds:2. |
|
1233 |
top expand. |
|
1405 | 1234 |
" |
1235 |
||
1820 | 1236 |
"Modified: 24.7.1997 / 12:32:17 / cg" |
1405 | 1237 |
! |
1238 |
||
269 | 1239 |
create |
1240 |
"create - make certain that icon is available" |
|
1241 |
||
1242 |
super create. |
|
1243 |
||
1244 |
iconView notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1245 |
iconView create. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1246 |
device setWindowIconWindow:iconView in:drawableId. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1247 |
iconView setRealized:true. |
269 | 1248 |
]. |
1249 |
iconLabel notNil ifTrue:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1250 |
device setIconName:iconLabel in:drawableId |
269 | 1251 |
] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1252 |
|
816 | 1253 |
"Modified: 10.6.1996 / 20:14:50 / cg" |
269 | 1254 |
! |
1255 |
||
1405 | 1256 |
expand |
1257 |
"de-iconify the receiver at its old position" |
|
1258 |
||
1259 |
shown ifFalse:[ |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1260 |
self unmap. |
1405 | 1261 |
|
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1262 |
"if it was iconified, try to remap iconified" |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1263 |
device mapView:self id:drawableId iconified:false |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1264 |
atX:left y:top width:width height:height. |
1405 | 1265 |
]. |
1266 |
||
1267 |
" |
|
1268 |
|top| |
|
1269 |
||
1270 |
top := StandardSystemView new. |
|
1271 |
top label:'hello'. |
|
1272 |
top openAndWait. |
|
1273 |
top collapse. |
|
1274 |
Delay waitForSeconds:5. |
|
1275 |
top expand. |
|
1276 |
" |
|
1277 |
||
1278 |
"Modified: 1.3.1997 / 20:24:53 / cg" |
|
1279 |
! |
|
1280 |
||
46 | 1281 |
physicalCreate |
1282 |
"common code for create & recreate" |
|
1283 |
||
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1284 |
|l icn icnMask org listener ret| |
183 | 1285 |
|
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1286 |
l := self windowLabelFor:label. |
183 | 1287 |
|
1560 | 1288 |
icon notNil ifTrue:[ |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1289 |
icn := self convertedIcon:icon. |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1290 |
(icnMask := icon mask) notNil ifTrue:[ |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1291 |
icnMask := self convertedIconMask:icnMask |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1292 |
] |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1293 |
]. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1294 |
|
1724
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1295 |
org := left @ top. |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1296 |
|
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1297 |
"/ if there is a global eventListener, |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1298 |
"/ give it a chance to intercept windowCreation |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1299 |
"/ and provide another origin. |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1300 |
|
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1301 |
(listener := WindowSensor eventListener) notNil ifTrue:[ |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1302 |
ret := listener preCreateView:self origin:org. |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1303 |
ret isPoint ifTrue:[ |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1304 |
org := ret |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1305 |
] |
1538 | 1306 |
]. |
1724
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1307 |
|
46 | 1308 |
drawableId := device |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1309 |
createWindowFor:self |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1310 |
type:nil |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1311 |
origin:org |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1312 |
extent:(width @ height) |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1313 |
minExtent:minExtent |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1314 |
maxExtent:maxExtent |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1315 |
borderWidth:borderWidth |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1316 |
subViewOf:nil |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1317 |
style:(self windowStyle) |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1318 |
inputOnly:(self isInputOnly) |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1319 |
label:l |
1960 | 1320 |
owner:nil |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1321 |
icon:icn iconMask:icnMask |
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1322 |
iconView:iconView. |
46 | 1323 |
|
641
f265a4c4785f
Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents:
625
diff
changeset
|
1324 |
Lobby registerChange:self. |
1724
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1325 |
|
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1326 |
"/ if there is a global eventListener, |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1327 |
"/ give it a chance to track views |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1328 |
|
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1329 |
listener notNil ifTrue:[ |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1330 |
listener postCreateView:self. |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1331 |
]. |
166073494dcc
pass window styles (normal / dialog / popup)
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1332 |
|
46 | 1333 |
extentChanged := false. |
1334 |
originChanged := false. |
|
1335 |
||
1202 | 1336 |
(borderColor notNil and:[borderColor ~= Black]) ifTrue:[ |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1337 |
self setBorderColor |
72 | 1338 |
]. |
81 | 1339 |
|
1340 |
"/ (viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[ |
|
1341 |
"/ device setWindowGravity:viewGravity in:drawableId |
|
1342 |
"/ ]. |
|
1343 |
||
1344 |
"/ (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[ |
|
1345 |
"/ device setBitGravity:bitGravity in:drawableId |
|
1346 |
"/ ]. |
|
72 | 1347 |
|
1904 | 1348 |
viewShape notNil ifTrue:[ |
1349 |
self setViewShape |
|
46 | 1350 |
]. |
1904 | 1351 |
|
46 | 1352 |
(backed notNil and:[backed ~~ false]) ifTrue:[ |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1353 |
device setBackingStore:backed in:drawableId |
46 | 1354 |
]. |
1355 |
saveUnder ifTrue:[ |
|
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1356 |
device setSaveUnder:true in:drawableId |
46 | 1357 |
]. |
1960 | 1358 |
cursor notNil ifTrue:[ |
1359 |
self setCursor |
|
1360 |
]. |
|
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
827
diff
changeset
|
1361 |
device setWindowClass:('Stx', self className) name:name in:drawableId. |
641
f265a4c4785f
Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents:
625
diff
changeset
|
1362 |
|
857
df5125310d86
New method #setWindowClass:name:in: to give a hint to the window manager.
Stefan Vogel <sv@exept.de>
parents:
827
diff
changeset
|
1363 |
"Modified: 14.6.1996 / 17:14:25 / stefan" |
1915
f86162de1a2f
extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents:
1904
diff
changeset
|
1364 |
"Modified: 22.9.1997 / 10:11:16 / cg" |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1365 |
! |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1366 |
|
1830 | 1367 |
postRealize |
1368 |
"postRealize actions - tell the application (if any)." |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1369 |
|
1830 | 1370 |
"/ |
1371 |
"/ let the application add its views to the current project |
|
1372 |
"/ |
|
1373 |
application notNil ifTrue:[ |
|
1374 |
application opened. |
|
1375 |
] ifFalse:[ |
|
1376 |
self addToCurrentProject. |
|
1377 |
]. |
|
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1378 |
|
1830 | 1379 |
"Created: 24.7.1997 / 18:11:26 / cg" |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1380 |
! |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1381 |
|
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1382 |
recreate |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1383 |
"recreate the view after a snap-in" |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1384 |
|
1538 | 1385 |
|i m| |
1386 |
||
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1387 |
super recreate. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1388 |
|
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1389 |
iconView notNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1390 |
iconView recreate. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1391 |
device setWindowIconWindow:iconView in:drawableId. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1392 |
iconView setRealized:true. |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1393 |
] ifFalse:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1394 |
icon notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1395 |
i := self convertedIcon:icon. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1396 |
(i notNil and:[i id notNil]) ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1397 |
(m := icon mask) notNil ifTrue:[ |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1398 |
m := self convertedIconMask:m. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1399 |
]. |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1400 |
device setWindowIcon:i mask:m in:drawableId |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1401 |
] |
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1402 |
]. |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1403 |
]. |
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1404 |
|
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1405 |
iconLabel notNil ifTrue:[ |
1696
ba6085a629e0
replaced isPopUp flag in #createWindow by a more general #style symbol argument
Claus Gittinger <cg@exept.de>
parents:
1612
diff
changeset
|
1406 |
device setIconName:iconLabel in:drawableId |
504
bc7734000bd3
windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
1407 |
] |
604
672ecb7ec347
fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1408 |
|
1538 | 1409 |
"Modified: 4.4.1997 / 16:16:40 / cg" |
141 | 1410 |
! ! |
1411 |
||
269 | 1412 |
!StandardSystemView class methodsFor:'documentation'! |
0 | 1413 |
|
269 | 1414 |
version |
1960 | 1415 |
^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.90 1997-11-21 12:57:41 cg Exp $' |
0 | 1416 |
! ! |
1878
76e9bc8e1b9c
new hostName in label format
Claus Gittinger <cg@exept.de>
parents:
1865
diff
changeset
|
1417 |
StandardSystemView initialize! |