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