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