author | Claus Gittinger <cg@exept.de> |
Fri, 21 Mar 2003 18:31:50 +0100 | |
changeset 1722 | 7d37db741aa4 |
parent 1673 | de7dabc35768 |
child 1723 | d5408b5f1d72 |
permissions | -rw-r--r-- |
89 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
434 | 3 |
All Rights Reserved |
89 | 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 |
||
1395 | 13 |
"{ Package: 'stx:libview2' }" |
14 |
||
100 | 15 |
Object subclass:#WindowBuilder |
855
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
16 |
instanceVariableNames:'window application bindings visuals labels focusSequence |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
17 |
namedComponents helpKeys componentCreationHook applicationClass |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
18 |
keyboardProcessor subCanvasSpecs' |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
19 |
classVariableNames:'StopOnError Verbose' |
436 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-Support-UI' |
|
66 | 22 |
! |
23 |
||
24 |
!WindowBuilder class methodsFor:'documentation'! |
|
25 |
||
89 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
434 | 29 |
All Rights Reserved |
89 | 30 |
|
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
66 | 40 |
documentation |
41 |
" |
|
69 | 42 |
a no-op class, for systems which do not use the UIBuilder. |
66 | 43 |
Concrete subclasses know how to create a view (with components) from |
848 | 44 |
some interface spec. |
45 |
||
46 |
The order of the lookup sequence to access an aspect is defined: |
|
47 |
application |
|
48 |
application class |
|
49 |
additional class (applicationClass). |
|
50 |
||
51 |
Methods to access any aspect are located in the category |
|
52 |
'spec creation aspect fetch'. |
|
53 |
||
735 | 54 |
Currently, an experimantal version of UIBuilder exists, |
66 | 55 |
and more may be added in the future (for example, to parse different UI |
735 | 56 |
specs - thinking of motifs UIL specs, Windows DialogSpecs etc.). |
223 | 57 |
|
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
58 |
[instance variables:] |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
59 |
window <View> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
60 |
the topView into which the components |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
61 |
are (have been) created from the specification |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
62 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
63 |
application <ApplicationModel> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
64 |
the application object (typically an instance |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
65 |
of a subclass of ApplicationModel). |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
66 |
That one is usually supposed to provide |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
67 |
valueHolders for aspects, action methods |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
68 |
menuSpecs and possibly more windowSpecs. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
69 |
Usually means, that most of those can also be |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
70 |
provided to the builder via a set of bindings, |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
71 |
which overrides those. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
72 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
73 |
bindings <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
74 |
can be set (or filled) with bindings for |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
75 |
aspects to be used when setting up the models |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
76 |
for components. Useful either to overwrite |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
77 |
corresponding appModel aspects or if the appModel |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
78 |
does not want to procide those. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
79 |
(for example, to open a dialog and provide the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
80 |
bindings in a dictionary - as opposed to |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
81 |
providing them via aspect methods) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
82 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
83 |
visuals not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
84 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
85 |
focusSequence <Collection> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
86 |
maintained during the build process; |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
87 |
contains tabable components. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
88 |
This will be replaced by a more intelligent |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
89 |
mechanism in the near future. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
90 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
91 |
namedComponents <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
92 |
contains name->component associations for |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
93 |
all components which have a non-nil component |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
94 |
name. Created during the build process. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
95 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
96 |
helpKeys not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
97 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
98 |
componentCreationHook <BlockOrNil> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
99 |
can be set before the components are built |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
100 |
from the spec, to provide an arbitrary |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
101 |
callBacks-hook which will be invoked after |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
102 |
a component has been created from a spec. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
103 |
The UIPainter uses this to maintain its |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
104 |
component<->spec assiciations. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
105 |
Can be set by the app, to catch creation of |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
106 |
components and fiddle around during the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
107 |
creation process (change extents, colors or whatever) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
108 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
109 |
applicationClass <ClassOrNil> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
110 |
can be set to provide an additional class which |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
111 |
is asked for aspects during the build process. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
112 |
If not set, the app is asked, which itself asks |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
113 |
its class. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
114 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
115 |
keyboardProcessor not yet used - for compatibility |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
116 |
Will eventually takeover the functionality |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
117 |
of the focusSequence, shortcuts & provide a hook |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
118 |
for the app. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
119 |
|
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
120 |
subCanvasSpecs <Dictionary> |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
121 |
can be set by the app to provide subcanvas |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
122 |
specs (much like the bindings dictionary) |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
123 |
|
223 | 124 |
[author:] |
125 |
Claus Gittinger |
|
66 | 126 |
" |
127 |
! ! |
|
128 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
129 |
!WindowBuilder class methodsFor:'debugging'! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
130 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
131 |
stopOnError:aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
132 |
"enable/disable debug halt when aspects are missing. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
133 |
Useful during development, to detect missing aspects. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
134 |
The default is off." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
135 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
136 |
StopOnError := aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
137 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
138 |
"Modified: / 4.8.1998 / 19:40:09 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
139 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
140 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
141 |
verbose:aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
142 |
"enable/disable debug messages on the Transcript. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
143 |
Useful during development, to detect missing aspects. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
144 |
The default is off." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
145 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
146 |
Verbose := aBoolean |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
147 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
148 |
"Created: / 4.8.1998 / 19:39:37 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
149 |
"Modified: / 4.8.1998 / 19:40:14 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
150 |
! ! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
151 |
|
1498 | 152 |
!WindowBuilder methodsFor:'Compatibility - VW'! |
974 | 153 |
|
154 |
source |
|
155 |
"same as #application, for ST-80 compatibility" |
|
156 |
||
157 |
^ application |
|
158 |
||
159 |
"Created: 17.1.1997 / 19:03:51 / cg" |
|
160 |
! |
|
161 |
||
162 |
source:anApplicationModel |
|
163 |
"same as #application:, for ST-80 compatibility" |
|
164 |
||
165 |
application := anApplicationModel |
|
166 |
||
167 |
"Modified: 17.1.1997 / 19:03:57 / cg" |
|
168 |
! ! |
|
169 |
||
66 | 170 |
!WindowBuilder methodsFor:'accessing'! |
171 |
||
463 | 172 |
addBindings:moreBindings |
173 |
"used with subDialogs, which provide local bindings. |
|
174 |
All bindings from moreBindings overwrite any local bindings." |
|
175 |
||
176 |
moreBindings notNil ifTrue:[ |
|
1564
7647fb7ddd61
lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents:
1563
diff
changeset
|
177 |
bindings isNil ifTrue:[ |
7647fb7ddd61
lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents:
1563
diff
changeset
|
178 |
bindings := IdentityDictionary new |
7647fb7ddd61
lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents:
1563
diff
changeset
|
179 |
]. |
7647fb7ddd61
lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents:
1563
diff
changeset
|
180 |
bindings declareAllFrom:moreBindings |
463 | 181 |
] |
182 |
||
183 |
"Created: 28.2.1997 / 14:14:33 / cg" |
|
184 |
! |
|
185 |
||
100 | 186 |
application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
187 |
"return the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
188 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
189 |
This one is supposed to provide the aspects, menus etc." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
190 |
|
100 | 191 |
^ application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
192 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
193 |
"Modified: 17.1.1997 / 19:04:40 / cg" |
66 | 194 |
! |
195 |
||
125 | 196 |
application:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
197 |
"set the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
198 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
199 |
This one is supposed to provide the aspects, menus etc." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
200 |
|
125 | 201 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
202 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
203 |
"Modified: 17.1.1997 / 19:04:47 / cg" |
66 | 204 |
! |
205 |
||
1155 | 206 |
applicationClass |
207 |
"return the value of the instance variable 'applicationClass' (automatically generated). |
|
1585 | 208 |
WARNING: |
209 |
This is a private interface for the UIPainter to pass down the app-class |
|
210 |
to the specs when editing." |
|
1155 | 211 |
|
212 |
^ applicationClass |
|
213 |
! |
|
214 |
||
422 | 215 |
applicationClass:something |
1155 | 216 |
"set the value of the instance variable 'applicationClass' (automatically generated). |
1585 | 217 |
WARNING: |
218 |
This is a private interface for the UIPainter to pass down the app-class |
|
219 |
to the specs when editing." |
|
422 | 220 |
|
1155 | 221 |
applicationClass := something. |
222 |
! |
|
422 | 223 |
|
66 | 224 |
aspectAt:aSymbol |
848 | 225 |
"return the aspect for a symbol or nil. |
226 |
" |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
227 |
^ self |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
228 |
aspectAt:aSymbol |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
229 |
ifAbsent:[self aspectNotFound:aSymbol error:'no aspect for:'] |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
230 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
231 |
"Modified: / 4.8.1998 / 19:29:36 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
232 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
233 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
234 |
aspectAt:aSymbol ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
235 |
"return the aspect for a symbol or the value from exceptionBlock. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
236 |
" |
433 | 237 |
|b| |
238 |
||
473 | 239 |
aSymbol notNil ifTrue:[ |
240 |
bindings notNil ifTrue:[ |
|
241 |
b := bindings at:aSymbol ifAbsent:nil. |
|
242 |
b notNil ifTrue:[^ b]. |
|
243 |
]. |
|
434 | 244 |
|
473 | 245 |
application notNil ifTrue:[ |
1585 | 246 |
MessageNotUnderstood |
247 |
ignoreNotUnderstoodOf:aSymbol |
|
248 |
in:[ |
|
249 |
^ application aspectFor:aSymbol |
|
250 |
]. |
|
251 |
MessageNotUnderstood |
|
252 |
ignoreNotUnderstoodOf:aSymbol |
|
253 |
in:[ |
|
254 |
^ application class aspectFor:aSymbol |
|
255 |
]. |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
256 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
257 |
^ exceptionBlock value. |
848 | 258 |
] |
433 | 259 |
]. |
260 |
^ nil |
|
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
261 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
262 |
"Created: / 4.8.1998 / 19:28:30 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
263 |
"Modified: / 4.8.1998 / 19:37:02 / cg" |
66 | 264 |
! |
265 |
||
125 | 266 |
aspectAt:aSymbol put:aModel |
848 | 267 |
"store an aspect identified by its symbol and its value |
268 |
" |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
269 |
bindings isNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
270 |
bindings := IdentityDictionary new |
125 | 271 |
]. |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
272 |
^ bindings at:aSymbol put:aModel |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
273 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
274 |
"Modified: 17.1.1997 / 19:28:37 / cg" |
100 | 275 |
! |
276 |
||
450 | 277 |
bindingAt:aSymbol |
1344 | 278 |
"return the binding for a symbol or nil if there is none |
848 | 279 |
" |
450 | 280 |
bindings notNil ifTrue:[ |
281 |
^ bindings at:aSymbol ifAbsent:nil. |
|
282 |
]. |
|
283 |
^ nil |
|
284 |
! |
|
285 |
||
100 | 286 |
bindings |
848 | 287 |
"return my bindings |
288 |
" |
|
100 | 289 |
^ bindings |
290 |
! |
|
291 |
||
292 |
bindings:aDictionary |
|
848 | 293 |
"set bindings to a dictionary |
294 |
" |
|
100 | 295 |
bindings := aDictionary |
296 |
! |
|
297 |
||
125 | 298 |
componentAt:name |
1673 | 299 |
"return a component identified by its name" |
1208 | 300 |
|
1673 | 301 |
|widget| |
1208 | 302 |
|
303 |
namedComponents notNil ifTrue:[ |
|
304 |
widget := namedComponents at:name asSymbol ifAbsent:nil. |
|
305 |
widget notNil ifTrue:[^ widget]. |
|
306 |
]. |
|
307 |
||
308 |
"/ cg the following code looks in any application- |
|
309 |
"/ or master applications builder for the component. |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
310 |
"/ This has an effect, if a subcanvases builder is asked for |
1208 | 311 |
"/ a component, which is actually held by the real-apps builder |
312 |
"/ (in case they have different builders). |
|
313 |
"/ For now, this code is disabled, since I dont know what effect this |
|
314 |
"/ has to existing code ... |
|
315 |
||
316 |
"/ application notNil ifTrue:[ |
|
1673 | 317 |
"/ |appBuilder masterApplication masterBuilder| |
318 |
"/ |
|
1208 | 319 |
"/ (appBuilder := application builder) notNil ifTrue:[ |
320 |
"/ appBuilder ~~ self ifTrue:[ |
|
321 |
"/ ^ appBuilder componentAt:name |
|
322 |
"/ ] |
|
323 |
"/ ]. |
|
324 |
"/ |
|
325 |
"/ (masterApplication := application masterApplication) notNil ifTrue:[ |
|
326 |
"/ (masterBuilder := masterApplication builder) notNil ifTrue:[ |
|
327 |
"/ masterBuilder ~~ self ifTrue:[ |
|
328 |
"/ ^ masterBuilder componentAt:name |
|
329 |
"/ ] |
|
330 |
"/ ] |
|
331 |
"/ ] |
|
332 |
"/ ]. |
|
333 |
^ nil |
|
125 | 334 |
! |
335 |
||
100 | 336 |
componentAt:name put:aComponent |
848 | 337 |
"store a component identified by its name. |
338 |
" |
|
450 | 339 |
namedComponents isNil ifTrue:[ |
340 |
namedComponents := IdentityDictionary new. |
|
100 | 341 |
]. |
450 | 342 |
namedComponents at:name asSymbol put:aComponent |
100 | 343 |
! |
344 |
||
410 | 345 |
componentCreationHook:something |
346 |
"set the value of the instance variable 'componentCreationHook' (automatically generated)" |
|
347 |
||
1447 | 348 |
componentCreationHook := something. |
349 |
! |
|
410 | 350 |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
351 |
findComponentAt:name |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
352 |
"recursively search for a component identified by its name in myself |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
353 |
and all of my subApplications. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
354 |
" |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
355 |
|
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
356 |
^ self findComponentAt:name ignoringViews:(IdentitySet new). |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
357 |
! |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
358 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
359 |
findComponentAt:name ignoringViews:triedViews |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
360 |
"recursively search for a component identified by its name in myself |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
361 |
and all of my subApplications. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
362 |
As a builders applications view might be different from the builders view, |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
363 |
we must be careful to avoid endless recursion if a subview refers to the topviews builder, |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
364 |
(sigh) |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
365 |
" |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
366 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
367 |
|comp window app b| |
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
368 |
|
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
369 |
(comp := self componentAt:name) notNil ifTrue:[^ comp]. |
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
370 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
371 |
window := self application window. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
372 |
(triedViews includes:window) ifTrue:[^ nil]. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
373 |
triedViews add:window. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
374 |
|
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
375 |
window allSubViewsDo:[:v | |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
376 |
triedViews add:v. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
377 |
|
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
378 |
((app := v application) notNil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
379 |
and:[(b := app builder) notNil |
1563
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
380 |
and:[b ~~ self]]) |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
381 |
ifTrue:[ |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
382 |
comp := b findComponentAt:name ignoringViews:triedViews. |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
383 |
comp notNil ifTrue:[ |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
384 |
^ comp |
166f840701bf
avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
385 |
] |
1357
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
386 |
] |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
387 |
]. |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
388 |
^ nil |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
389 |
! |
facab5c393b9
added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents:
1351
diff
changeset
|
390 |
|
125 | 391 |
focusSequence |
848 | 392 |
"return my focus sequence |
393 |
" |
|
1139 | 394 |
|
395 |
focusSequence isNil ifTrue:[ |
|
396 |
focusSequence := OrderedCollection new |
|
397 |
]. |
|
125 | 398 |
^ focusSequence |
1139 | 399 |
|
400 |
"Modified: / 12.3.1999 / 00:02:04 / cg" |
|
66 | 401 |
! |
402 |
||
600 | 403 |
helpKeyFor:aComponent |
848 | 404 |
"return the helpkey for a component or nil |
405 |
" |
|
600 | 406 |
|v key| |
407 |
||
408 |
helpKeys isNil ifTrue:[^ nil]. |
|
409 |
v := aComponent. |
|
410 |
[v notNil] whileTrue:[ |
|
411 |
(key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[ |
|
412 |
^ key |
|
413 |
]. |
|
414 |
v := v superView |
|
415 |
]. |
|
595 | 416 |
^ nil |
600 | 417 |
! |
595 | 418 |
|
600 | 419 |
helpKeyFor:aComponent put:aKey |
848 | 420 |
"assign a key for a component which is used to access the help text |
421 |
from the application. |
|
422 |
" |
|
600 | 423 |
aKey isNil ifTrue:[ |
424 |
helpKeys isNil ifFalse:[ |
|
425 |
helpKeys removeKey:aComponent ifAbsent:nil |
|
426 |
] |
|
427 |
] ifFalse:[ |
|
428 |
helpKeys isNil ifTrue:[ |
|
429 |
helpKeys := IdentityDictionary new |
|
430 |
]. |
|
431 |
helpKeys at:aComponent put:aKey |
|
432 |
] |
|
595 | 433 |
|
434 |
! |
|
435 |
||
477 | 436 |
keyboardProcessor |
848 | 437 |
"return my keyboard processor |
438 |
" |
|
477 | 439 |
keyboardProcessor isNil ifTrue:[ |
440 |
keyboardProcessor := KeyboardProcessor new |
|
441 |
]. |
|
442 |
^ keyboardProcessor |
|
443 |
||
444 |
"Created: 3.3.1997 / 18:31:37 / cg" |
|
445 |
"Modified: 3.3.1997 / 18:32:27 / cg" |
|
446 |
! |
|
447 |
||
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
448 |
keyboardProcessor:aKeyboardProcessor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
449 |
"set my keyboard processor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
450 |
" |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
451 |
keyboardProcessor := aKeyboardProcessor |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
452 |
|
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
453 |
"Created: / 18.6.1998 / 19:59:38 / cg" |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
454 |
! |
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
455 |
|
855
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
456 |
labelAt:name |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
457 |
labels isNil ifTrue:[^ nil]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
458 |
^ labels at:name asSymbol ifAbsent:nil |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
459 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
460 |
"Created: / 27.2.1998 / 13:52:28 / cg" |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
461 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
462 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
463 |
labelAt:name put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
464 |
labels isNil ifTrue:[ |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
465 |
labels := IdentityDictionary new. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
466 |
]. |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
467 |
labels at:name asSymbol put:aLabelString |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
468 |
|
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
469 |
"Created: / 27.2.1998 / 02:30:54 / cg" |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
470 |
! |
baf65c4e2bed
added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
848
diff
changeset
|
471 |
|
848 | 472 |
menuAt:aKey |
473 |
"Find a binding for the menu named aKey, either in the bindings |
|
474 |
or from the source" |
|
475 |
||
476 |
^ self menuFor:aKey |
|
477 |
||
478 |
||
479 |
! |
|
480 |
||
481 |
menuAt:aSymbol put:someMenuOrHolder |
|
482 |
"add someMenuOrHolder as the binding for the menu named aSymbol to the bindings" |
|
483 |
||
484 |
^ self aspectAt:aSymbol put:someMenuOrHolder |
|
485 |
||
486 |
! |
|
487 |
||
86 | 488 |
namedComponents |
848 | 489 |
"return list of named components |
490 |
" |
|
450 | 491 |
^ namedComponents |
86 | 492 |
! |
493 |
||
1585 | 494 |
resources |
495 |
application notNil ifTrue:[ |
|
496 |
^ application resources |
|
497 |
]. |
|
498 |
^ Dialog classResources. |
|
499 |
! |
|
500 |
||
502 | 501 |
subCanvasAt:majorKey at:minorKey |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
502 |
"get the subCanvas or subSpec specification from major and minor key. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
503 |
Here, we first look for a spec in the private subCanvasSpecs dictionary, |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
504 |
which can be filled via #specificationAt:at:put: messages. |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
505 |
If not present, or none is found there, we bounce back trying |
824 | 506 |
#specificationFor: (if majorKey is nil) or by sending the minorKey |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
507 |
message to the class named as majorKey. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
508 |
Notice, that the class named majorKey is first searched in the |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
509 |
application classes namespace - allowing private classes as majorKey. |
586 | 510 |
" |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
511 |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
512 |
|spec cls dict dkey| |
502 | 513 |
|
1351
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
514 |
minorKey isNil ifTrue:[^ nil]. |
42d9de8818bf
care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
515 |
|
502 | 516 |
subCanvasSpecs notNil ifTrue:[ |
586 | 517 |
dkey := majorKey ? #NoMajorKey. |
518 |
dict := subCanvasSpecs at:dkey ifAbsent:nil. |
|
519 |
||
520 |
dict notNil ifTrue:[ |
|
521 |
spec := dict at:minorKey ifAbsent:nil. |
|
502 | 522 |
spec notNil ifTrue:[^ spec]. |
523 |
]. |
|
524 |
]. |
|
586 | 525 |
|
502 | 526 |
majorKey isNil ifTrue:[ |
848 | 527 |
^ self specificationFor:minorKey |
528 |
]. |
|
529 |
||
530 |
application notNil ifTrue:[ |
|
531 |
"/ look for class in applications namespace ... |
|
532 |
cls := application resolveName:majorKey. |
|
502 | 533 |
] ifFalse:[ |
848 | 534 |
"/ fallBack - use that global, if it exists |
535 |
cls := Smalltalk at:majorKey. |
|
536 |
cls isNil ifTrue:[ |
|
537 |
Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey). |
|
735 | 538 |
]. |
502 | 539 |
]. |
586 | 540 |
|
848 | 541 |
cls notNil ifTrue:[ |
1585 | 542 |
MessageNotUnderstood catch:[ |
848 | 543 |
^ cls specificationFor:minorKey |
544 |
]. |
|
1586 | 545 |
MessageNotUnderstood catch:[ |
546 |
^ cls perform:minorKey. |
|
547 |
] |
|
848 | 548 |
]. |
549 |
^ nil |
|
502 | 550 |
! |
551 |
||
552 |
subCanvasAt:majorKey at:minorKey put:aSpec |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
553 |
"deposit an interfaceSpecification for major and minor key |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
554 |
in my private subCanvasSpecs dictionary. |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
555 |
This will be used later, when building, |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
556 |
to provide an interfaceSpec for a subcanvas or subSpecification |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
557 |
(or possibly override an application provided interfaceSpec). |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
558 |
See #subCanvasAt:at:." |
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
559 |
|
502 | 560 |
|dict key| |
561 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
562 |
subCanvasSpecs isNil ifTrue:[ |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
563 |
"/ lazyly initialize |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
564 |
subCanvasSpecs := IdentityDictionary new |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
565 |
]. |
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
566 |
|
502 | 567 |
key := majorKey ? #NoMajorKey. |
568 |
dict := subCanvasSpecs at:key ifAbsent:nil. |
|
569 |
dict isNil ifTrue:[ |
|
570 |
dict := IdentityDictionary new. |
|
571 |
subCanvasSpecs at:key put:dict |
|
572 |
]. |
|
573 |
dict at:minorKey put:aSpec |
|
574 |
||
774
fb8810086f95
removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
575 |
"Modified: / 27.1.1998 / 12:21:27 / cg" |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
576 |
"Modified: / 5.2.1998 / 12:05:32 / stefan" |
502 | 577 |
! |
578 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
579 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
580 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
581 |
^ visuals at:name asSymbol ifAbsent:nil |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
582 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
583 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
584 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
585 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
586 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
587 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
588 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
589 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
590 |
visuals at:name asSymbol put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
591 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
592 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
593 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
594 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
595 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
596 |
^ visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
597 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
598 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
599 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
600 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
601 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
602 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
603 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
604 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
605 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
606 |
|
125 | 607 |
window |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
608 |
"return the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
609 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
610 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
611 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
612 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
613 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 614 |
! |
615 |
||
616 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
617 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
618 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
619 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
620 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
621 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
622 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 623 |
! |
624 |
||
625 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
626 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
627 |
|
608 | 628 |
"Modified: 17.6.1997 / 18:04:01 / cg" |
66 | 629 |
! ! |
630 |
||
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
631 |
!WindowBuilder methodsFor:'aspect access support'! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
632 |
|
675 | 633 |
booleanValueAspectFor:aKey |
674 | 634 |
"helper (common code) to generate a boolean aspect if required. |
635 |
If no binding exists for aKey, a valueHolder holding false is |
|
636 |
created and added to the bindings. |
|
637 |
Otherwise, the existing binding is returned." |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
638 |
|
676 | 639 |
^ self valueAspectFor:aKey initialValue:false |
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
640 |
|
676 | 641 |
"Modified: 28.7.1997 / 12:53:57 / cg" |
675 | 642 |
! |
643 |
||
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
644 |
listAspectFor:aKey |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
645 |
"helper (common code) to generate a list model aspect if required. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
646 |
If no binding exists for aKey, a new List is |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
647 |
created and added to the bindings. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
648 |
Otherwise, the existing binding is returned." |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
649 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
650 |
|list| |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
651 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
652 |
(list := self bindingAt:aKey) isNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
653 |
self aspectAt:aKey put:(list := List new). |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
654 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
655 |
^ list |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
656 |
|
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
657 |
"Created: 28.7.1997 / 12:53:45 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
658 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
659 |
! |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
660 |
|
675 | 661 |
nilValueAspectFor:aKey |
662 |
"helper (common code) to generate a valueHolder aspect if required. |
|
663 |
If no binding exists for aKey, a valueHolder holding nil is |
|
664 |
created and added to the bindings. |
|
665 |
Otherwise, the existing binding is returned." |
|
666 |
||
676 | 667 |
^ self valueAspectFor:aKey initialValue:nil |
668 |
||
669 |
"Modified: 28.7.1997 / 12:54:06 / cg" |
|
670 |
! |
|
671 |
||
672 |
valueAspectFor:aKey initialValue:initialValue |
|
673 |
"helper (common code) to generate a valueHolder aspect if required. |
|
674 |
If no binding exists for aKey, a valueHolder holding initialValue is |
|
675 |
created and added to the bindings. |
|
676 |
Otherwise, the existing binding is returned." |
|
677 |
||
675 | 678 |
|holder| |
679 |
||
680 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
|
676 | 681 |
self aspectAt:aKey put:(holder := initialValue asValue). |
675 | 682 |
]. |
683 |
^ holder |
|
684 |
||
676 | 685 |
"Created: 28.7.1997 / 12:53:45 / cg" |
686 |
"Modified: 28.7.1997 / 12:54:13 / cg" |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
687 |
! ! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
688 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
689 |
!WindowBuilder methodsFor:'building'! |
66 | 690 |
|
125 | 691 |
buildFromSpec:aSpec |
176 | 692 |
^ self subclassResponsibility |
408 | 693 |
! |
694 |
||
695 |
makeTabable:aComponent |
|
735 | 696 |
"add a component to the list of tabable components" |
697 |
||
1315 | 698 |
aComponent canTab:true |
735 | 699 |
|
1123 | 700 |
! |
701 |
||
702 |
setupWindowFor:aWindow |
|
703 |
self subclassResponsibility |
|
66 | 704 |
! ! |
100 | 705 |
|
848 | 706 |
!WindowBuilder methodsFor:'error handling'! |
707 |
||
708 |
aspectNotFound:anAspect error:aString |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
709 |
"show error message on transcript (if Verbose is true) |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
710 |
and/or stop (if StopOnError) is true. |
848 | 711 |
" |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
712 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
713 |
Verbose == true ifTrue:[ |
1395 | 714 |
Transcript showCR:('WindowBuilder: %1 aspect: <%2>' bindWith:aString with:anAspect storeString). |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
715 |
application notNil ifTrue:[ |
1395 | 716 |
Transcript showCR:('WindowBuilder: (while building for %1)' bindWith:application class name). |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
717 |
]. |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
718 |
]. |
848 | 719 |
|
720 |
StopOnError == true ifTrue:[ |
|
1395 | 721 |
self halt:'aspect not found' "/ avoids debugger in end-user apps |
848 | 722 |
]. |
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
723 |
^ nil |
1028
4f3401b606bd
better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents:
1010
diff
changeset
|
724 |
|
1395 | 725 |
"Modified: / 18.8.2000 / 14:10:59 / cg" |
848 | 726 |
! ! |
727 |
||
586 | 728 |
!WindowBuilder methodsFor:'message sending'! |
729 |
||
848 | 730 |
safelyPerform:aSelector ifNone:aBlock |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
731 |
"send the message aSelector to the application; |
586 | 732 |
the result returned from the send or nil is returned |
733 |
" |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
734 |
|cls handlerBlock| |
586 | 735 |
|
848 | 736 |
aSelector notNil ifTrue:[ |
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
737 |
handlerBlock := [:ex| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
738 |
(ex parameter selector ~~ aSelector) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
739 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
740 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
741 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
742 |
|
595 | 743 |
application notNil ifTrue:[ |
1585 | 744 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 745 |
^ application perform:aSelector |
746 |
]. |
|
747 |
cls := application class. |
|
748 |
||
1585 | 749 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 750 |
^ cls perform:aSelector |
595 | 751 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
752 |
]. |
1585 | 753 |
" |
754 |
WARNING: |
|
755 |
This is a private interface for the UIPainter to pass down the app-class |
|
756 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
757 |
applicationClass notNil ifTrue:[ |
1585 | 758 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 759 |
^ applicationClass perform:aSelector |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
760 |
] |
586 | 761 |
] |
762 |
]. |
|
848 | 763 |
^ aBlock value |
981
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
764 |
|
6a9c975543ad
also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents:
974
diff
changeset
|
765 |
"Modified: / 20.6.1998 / 11:52:19 / cg" |
586 | 766 |
! |
767 |
||
848 | 768 |
safelyPerform:aSelector with:anArgument ifNone:aBlock |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
769 |
"send the one-arg-message aSelector to the application; |
586 | 770 |
the result returned from the send or nil is returned |
771 |
" |
|
1587 | 772 |
|handlerBlock| |
586 | 773 |
|
848 | 774 |
aSelector notNil ifTrue:[ |
1587 | 775 |
handlerBlock := [:ex| |badSel| |
776 |
badSel := ex selector. |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
777 |
(badSel ~~ aSelector and:[badSel ~~ anArgument]) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
778 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
779 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
780 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
781 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
782 |
application notNil ifTrue:[ |
1585 | 783 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 784 |
^ application perform:aSelector with:anArgument |
785 |
]. |
|
1585 | 786 |
MessageNotUnderstood handle:handlerBlock do:[ |
1587 | 787 |
^ application class perform:aSelector with:anArgument |
595 | 788 |
] |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
789 |
]. |
1585 | 790 |
" |
791 |
WARNING: |
|
792 |
This is a private interface for the UIPainter to pass down the app-class |
|
793 |
" |
|
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
794 |
applicationClass notNil ifTrue:[ |
1585 | 795 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 796 |
^ applicationClass perform:aSelector with:anArgument |
797 |
]. |
|
798 |
] |
|
799 |
]. |
|
1587 | 800 |
^ aBlock value |
961 | 801 |
|
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
802 |
"Modified: / 4.8.1998 / 19:33:52 / cg" |
848 | 803 |
! |
804 |
||
805 |
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock |
|
806 |
"send the two-arg-message aSelector to the application; |
|
807 |
the result returned from the send or nil is returned |
|
808 |
" |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
809 |
|cls handlerBlock| |
848 | 810 |
|
811 |
aSelector notNil ifTrue:[ |
|
1096
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
812 |
handlerBlock := [:ex| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
813 |
|badSel| |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
814 |
|
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
815 |
badSel := ex parameter selector. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
816 |
(badSel ~~ aSelector and:[badSel ~~ arg1]) ifTrue:[ |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
817 |
ex reject |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
818 |
] |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
819 |
]. |
14a4fdeecd02
avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents:
1092
diff
changeset
|
820 |
|
848 | 821 |
application notNil ifTrue:[ |
1585 | 822 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 823 |
^ application perform:aSelector with:arg1 with:arg2 |
824 |
]. |
|
825 |
cls := application class. |
|
826 |
||
1585 | 827 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 828 |
^ cls perform:aSelector with:arg1 with:arg2 |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
829 |
] |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
830 |
]. |
1585 | 831 |
" |
832 |
WARNING: |
|
833 |
This is a private interface for the UIPainter to pass down the app-class |
|
834 |
" |
|
848 | 835 |
applicationClass notNil ifTrue:[ |
1585 | 836 |
MessageNotUnderstood handle:handlerBlock do:[ |
848 | 837 |
^ applicationClass perform:aSelector with:arg1 with:arg2 |
838 |
]. |
|
839 |
] |
|
586 | 840 |
]. |
848 | 841 |
^ aBlock value |
970
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
842 |
|
d8920428eb28
undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents:
965
diff
changeset
|
843 |
"Modified: / 18.6.1998 / 21:40:13 / cg" |
586 | 844 |
! ! |
845 |
||
422 | 846 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 847 |
|
374 | 848 |
actionFor:aKey |
450 | 849 |
"return an action for aKey. This is invoked during window building |
850 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
851 |
Here, first the local bindings are searched, then the application and |
|
852 |
finally the applications class is asked for a corresponding action. |
|
853 |
The returned object is typically a block." |
|
854 |
||
434 | 855 |
|b| |
856 |
||
857 |
bindings notNil ifTrue:[ |
|
858 |
b := bindings at:aKey ifAbsent:nil. |
|
859 |
b notNil ifTrue:[^ b]. |
|
860 |
]. |
|
861 |
||
848 | 862 |
^ self safelyPerform:#actionFor: |
863 |
with:aKey |
|
864 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ] |
|
374 | 865 |
! |
866 |
||
716 | 867 |
actionFor:aKey withValue:aValue |
868 |
"return an action for aKey/value combonation. |
|
869 |
This is invoked during window building |
|
870 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
871 |
specified an action with an argument value. |
|
872 |
Here, first the local bindings are searched, then the application and |
|
873 |
finally the applications class is asked for a corresponding action. |
|
874 |
The returned object is typically a block." |
|
875 |
||
876 |
|b| |
|
877 |
||
878 |
bindings notNil ifTrue:[ |
|
879 |
b := bindings at:aKey ifAbsent:nil. |
|
1198
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
880 |
b notNil ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
881 |
(b isBlock and:[b numArgs == 1]) ifTrue:[ |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
882 |
^ [:arg | b value:arg] |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
883 |
]. |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
884 |
^ b |
b10129322a0c
another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
885 |
]. |
716 | 886 |
]. |
887 |
||
848 | 888 |
^ self safelyPerform:#actionFor:withValue: |
889 |
with:aKey |
|
890 |
with:aValue |
|
891 |
ifNone:[ self aspectNotFound:aKey error:'no action for:'. [:dummy |] ] |
|
716 | 892 |
! |
893 |
||
374 | 894 |
aspectFor:aKey |
450 | 895 |
"return a model for aKey. This is invoked during window building |
896 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
897 |
Here, first the local bindings are searched, then the application and |
|
898 |
finally the applications class is asked for a corresponding action. |
|
899 |
The returned object is typically a valueHolder." |
|
900 |
||
434 | 901 |
|b| |
902 |
||
903 |
bindings notNil ifTrue:[ |
|
904 |
b := bindings at:aKey ifAbsent:nil. |
|
905 |
b notNil ifTrue:[^ b]. |
|
906 |
]. |
|
907 |
||
848 | 908 |
^ self safelyPerform:#aspectFor: |
909 |
with:aKey |
|
910 |
ifNone:[ self aspectAt:aKey ] |
|
374 | 911 |
! |
912 |
||
1031
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
913 |
aspectFor:aKey ifAbsent:exceptionBlock |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
914 |
"return a model for aKey. This is invoked during window building |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
915 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
916 |
Here, first the local bindings are searched, then the application and |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
917 |
finally the applications class is asked for a corresponding action. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
918 |
The returned object is typically a valueHolder." |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
919 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
920 |
|b| |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
921 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
922 |
bindings notNil ifTrue:[ |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
923 |
b := bindings at:aKey ifAbsent:nil. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
924 |
b notNil ifTrue:[^ b]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
925 |
]. |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
926 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
927 |
^ self safelyPerform:#aspectFor: |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
928 |
with:aKey |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
929 |
ifNone:[self aspectAt:aKey ifAbsent:exceptionBlock] |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
930 |
|
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
931 |
"Created: / 4.8.1998 / 19:36:39 / cg" |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
932 |
! |
0f80a655cf09
allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents:
1028
diff
changeset
|
933 |
|
423 | 934 |
componentFor:aKey |
450 | 935 |
"return a component for aKey. This is invoked during window building |
936 |
(by the builder) to ask for an ArbitraryComponents view. |
|
937 |
Here, first the local bindings are searched, then the application and |
|
938 |
finally the applications class is asked for a corresponding action. |
|
939 |
The returned object is typically a view." |
|
940 |
||
848 | 941 |
^ self safelyPerform:#componentFor: |
942 |
with:aKey |
|
943 |
ifNone:[ self aspectAt:aKey ] |
|
423 | 944 |
! |
945 |
||
422 | 946 |
labelFor:aKey |
450 | 947 |
"return a label for aKey. This is invoked during window building |
948 |
(by the builder) to ask for a ???'s label. |
|
949 |
Here, first the local bindings are searched, then the application and |
|
950 |
finally the applications class is asked for a corresponding action. |
|
951 |
The returned object is typically a string." |
|
952 |
||
848 | 953 |
^ self safelyPerform:#labelFor: |
954 |
with:aKey |
|
955 |
ifNone:[ self aspectAt:aKey ] |
|
422 | 956 |
! |
957 |
||
958 |
listFor:aKey |
|
450 | 959 |
"return a list for aKey. This is invoked during window building |
960 |
(by the builder) to ask for a ???'s label. |
|
961 |
Here, first the local bindings are searched, then the application and |
|
962 |
finally the applications class is asked for a corresponding action. |
|
963 |
The returned object is typically a list." |
|
964 |
||
848 | 965 |
^ self safelyPerform:#listFor: |
966 |
with:aKey |
|
967 |
ifNone:[ self aspectAt:aKey ] |
|
968 |
! |
|
969 |
||
970 |
menuFor:aKey |
|
971 |
"Find a binding for the menu named aKey, either in the bindings |
|
972 |
or from the source" |
|
973 |
||
974 |
|menu| |
|
975 |
||
961 | 976 |
aKey isNil ifTrue:[^ nil]. |
977 |
||
848 | 978 |
(menu := self bindingAt:aKey) notNil ifTrue:[ |
979 |
^ menu |
|
980 |
]. |
|
981 |
||
982 |
menu := self safelyPerform:#menuFor: with:aKey ifNone:[ |
|
983 |
self safelyPerform:aKey ifNone:[ |
|
984 |
self aspectNotFound:aKey error:'no menu for:'. |
|
985 |
nil |
|
986 |
] |
|
987 |
]. |
|
988 |
||
862 | 989 |
menu isBlock ifFalse:[ |
990 |
((menu := menu value) notNil and:[application notNil]) ifTrue:[ |
|
991 |
menu isArray ifTrue:[ |
|
992 |
menu := Menu new fromLiteralArrayEncoding:menu. |
|
1533
b6b2f8ab4e4a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1520
diff
changeset
|
993 |
"/ menu receiver:application. -- now done in findGuiResources ... |
924
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
994 |
]. |
4680e2fe4728
must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
995 |
menu findGuiResourcesIn:application |
450 | 996 |
] |
422 | 997 |
]. |
848 | 998 |
^ menu |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
999 |
|
961 | 1000 |
"Modified: / 18.6.1998 / 16:30:31 / cg" |
829
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1001 |
! |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1002 |
|
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1003 |
specificationFor:aKey |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1004 |
"return a specification for aKey. This is invoked during window building |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1005 |
(by the builder) to ask for the interfaceSpec for a subCanvas or subSpecification. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1006 |
Here, first the local bindings are searched, then the application and |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1007 |
finally the applications class is asked for a corresponding interfaceSPec. |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1008 |
The returned object is typically an interfaceSpec array." |
d4cd3635d64e
Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents:
824
diff
changeset
|
1009 |
|
1585 | 1010 |
^ self |
1011 |
safelyPerform:#specificationFor: |
|
1012 |
with:aKey |
|
1013 |
ifNone:[ self aspectFor:aKey ] |
|
422 | 1014 |
! ! |
1015 |
||
1016 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
1017 |
||
735 | 1018 |
createdComponent:aView forSpec:spec named:name |
1019 |
"callback from the UISpec after a view has been |
|
1020 |
created for a spec. |
|
1021 |
If it has a name, add it to the namedComponents dictionary; |
|
1022 |
if I have a creationHook (application callBack), evaluate it." |
|
1023 |
||
1222 | 1024 |
|nameKey| |
1025 |
||
735 | 1026 |
name notNil ifTrue:[ |
1027 |
"/ self componentAt:name put:aView. |
|
1028 |
namedComponents isNil ifTrue:[ |
|
1029 |
namedComponents := IdentityDictionary new. |
|
1030 |
]. |
|
1222 | 1031 |
nameKey := name asSymbol. |
1032 |
"/ debugging ... |
|
1225 | 1033 |
"/ (namedComponents includesKey:nameKey) ifTrue:[ |
1034 |
"/ Transcript showCR:'WARNING multiple UI-build of: ',nameKey |
|
1035 |
"/ ]. |
|
1222 | 1036 |
namedComponents at:nameKey put:aView |
735 | 1037 |
]. |
410 | 1038 |
componentCreationHook notNil ifTrue:[ |
1039 |
componentCreationHook value:aView value:spec value:self |
|
1040 |
] |
|
100 | 1041 |
|
735 | 1042 |
"Modified: / 5.9.1995 / 21:42:54 / claus" |
1043 |
"Created: / 31.10.1997 / 18:47:01 / cg" |
|
1044 |
"Modified: / 31.10.1997 / 18:51:22 / cg" |
|
100 | 1045 |
! ! |
1046 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1047 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1048 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1049 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1050 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1051 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1052 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1053 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1054 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1055 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1056 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1057 |
|
477 | 1058 |
|type| |
1059 |
||
1060 |
application isNil ifTrue:[ |
|
1061 |
type := #normal |
|
1062 |
] ifFalse:[ |
|
1063 |
type := application defaultWindowType |
|
1064 |
]. |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1065 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1066 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1067 |
withExtent:nil |
477 | 1068 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1069 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1070 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1071 |
|
428 | 1072 |
openAt:aPoint |
1073 |
"open my topView at some location" |
|
1074 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1075 |
^ self |
467 | 1076 |
openAt:aPoint |
1077 |
withExtent:nil |
|
428 | 1078 |
andType:(application defaultWindowType) |
1079 |
||
1080 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 1081 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 1082 |
! |
1083 |
||
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1084 |
openDialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1085 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1086 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1087 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1088 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1089 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1090 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1091 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1092 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1093 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1094 |
openDialogAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1095 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1096 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1097 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1098 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1099 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1100 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1101 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1102 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1103 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1104 |
"Created: 14.2.1997 / 20:24:19 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1105 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1106 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1107 |
openDialogAt:aPoint withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1108 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1109 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1110 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1111 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1112 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1113 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1114 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1115 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1116 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1117 |
"Created: 14.2.1997 / 20:24:19 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1118 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1119 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1120 |
openDialogWithExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1121 |
"open my topView, as previously created as a modal view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1122 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1123 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1124 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1125 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1126 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1127 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1128 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1129 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1130 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1131 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1132 |
openModal |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1133 |
"open my topView as a modal dialog, as previously created, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1134 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1135 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1136 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1137 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1138 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1139 |
andType:#dialog |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1140 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1141 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1142 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1143 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1144 |
openPopUpAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1145 |
"open my topView, as previously created as a popUp view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1146 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1147 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1148 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1149 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1150 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1151 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1152 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1153 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1154 |
"Created: 14.2.1997 / 20:24:38 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1155 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1156 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1157 |
openPopUpIn:aRectangle |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1158 |
"open my topView, as previously created as a popUp view, |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1159 |
blocking interaction to the currently active view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1160 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1161 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1162 |
openAt:aRectangle origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1163 |
withExtent:aRectangle extent |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1164 |
andType:#popUp |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1165 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1166 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1167 |
openWindow |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1168 |
"open my topView" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1169 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1170 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1171 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1172 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1173 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1174 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1175 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1176 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1177 |
openWindowAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1178 |
"open my topView at some location" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1179 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1180 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1181 |
openAt:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1182 |
withExtent:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1183 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1184 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1185 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1186 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1187 |
openWindowAt:origin withExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1188 |
"open my window, as previously created, optionally defining the |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1189 |
windows origin and/or extent. |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1190 |
The type argument may be #dialog or #normal, and specifies if the view |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1191 |
should be opened as a modal view, blocking interaction to the currently |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1192 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1193 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1194 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1195 |
openAt:origin |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1196 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1197 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1198 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1199 |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1200 |
openWindowCenter |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1201 |
"open my topView centered on the screen (dialog & normal only)" |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1202 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1203 |
^ self |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1204 |
openAt:#center |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1205 |
withExtent:nil |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1206 |
andType:(application defaultWindowType) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1207 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1208 |
! |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1209 |
|
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1210 |
openWithExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1211 |
"open my topView, as previously created, but override |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1212 |
the extent." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1213 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1214 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1215 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1216 |
withExtent:aPoint |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1217 |
andType:(application defaultWindowType) |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1218 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1219 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1220 |
! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1221 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1222 |
openWithExtent:ext andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1223 |
"open my window, as previously created. The type argument |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1224 |
may be #dialog or #normal, and specifies if the view should |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1225 |
be opened as a modal view, blocking interaction to the currently |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1226 |
active view, or as a normal view." |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1227 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1228 |
^ self |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1229 |
openAt:nil |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1230 |
withExtent:ext |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1231 |
andType:type |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1232 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1233 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1234 |
! ! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1235 |
|
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1236 |
!WindowBuilder methodsFor:'startup - basic'! |
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1237 |
|
436 | 1238 |
openAt:origin withExtent:ext andType:type |
428 | 1239 |
"open my window, as previously created, optionally defining the |
1240 |
windows origin and/or extent. |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1241 |
The type argument may be #dialog, #popup or #normal, |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1242 |
and specifies if the view should be opened as a |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1243 |
modal view (blocking interaction to the currently active view), |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1244 |
as popUp (also blocking) |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1245 |
or as a normal view." |
428 | 1246 |
|
1672 | 1247 |
|appWinClass device| |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1248 |
|
1672 | 1249 |
device := window device. |
428 | 1250 |
origin notNil ifTrue:[ |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1251 |
"/ kludge |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1252 |
origin ~~ #center ifTrue:[ |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1253 |
window origin:origin |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1254 |
] |
428 | 1255 |
]. |
1256 |
ext notNil ifTrue:[ |
|
480 | 1257 |
window extent:ext. |
1258 |
] ifFalse:[ |
|
1259 |
type == #dialog ifTrue:[ |
|
1260 |
window fixSize |
|
1261 |
] |
|
1262 |
]. |
|
1263 |
||
428 | 1264 |
type == #dialog ifTrue:[ |
1520 | 1265 |
((origin isNil and:[window class forceModalBoxesToOpenAtCenter]) |
1266 |
or:[origin == #center]) ifTrue:[ |
|
1672 | 1267 |
window origin:(device center - (window extent // 2)) |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1268 |
] ifFalse:[ |
1672 | 1269 |
window fixPosition:(device pointerPosition - window positionOffset). |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1270 |
]. |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1271 |
^ window openModal. |
428 | 1272 |
]. |
1273 |
||
1634 | 1274 |
(type == #normal or:[type = #slave or:[type = #partner]]) ifTrue:[ |
480 | 1275 |
window isNil ifTrue:[ |
1359
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1276 |
application notNil ifTrue:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1277 |
appWinClass := application applicationWindowClass |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1278 |
] ifFalse:[ |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1279 |
appWinClass := ApplicationWindow |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1280 |
]. |
f40bfb94f862
allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents:
1357
diff
changeset
|
1281 |
self setupWindowFor:(appWinClass new). |
480 | 1282 |
]. |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1283 |
origin == #center ifTrue:[ |
1672 | 1284 |
window origin:(device center - window extent // 2) |
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1096
diff
changeset
|
1285 |
]. |
480 | 1286 |
|
1634 | 1287 |
"/ the following code creates a master-slave relationship, if |
1288 |
"/ the masterApplication is not nil. |
|
1289 |
"/ Disabled, because: the masterApplication is used to fulfill missing aspects, |
|
1290 |
"/ which has nothing to do with a window master-slave relationship. |
|
1291 |
||
1292 |
"/ application masterApplication notNil ifTrue:[ |
|
1293 |
"/ masterWindow := application masterApplication window. |
|
1294 |
"/ (masterWindow isMaster or:[masterWindow isSlave or:[masterWindow isPartner]]) |
|
1295 |
"/ ifFalse:[ |
|
1296 |
"/ "/ master is neutral - make him a master |
|
1297 |
"/ masterWindow beMaster |
|
1298 |
"/ ]. |
|
1299 |
"/ window beSlave. |
|
1300 |
"/ ]. |
|
1301 |
||
1722 | 1302 |
"/ must be done explicit, by passing an appropriate windowType |
1303 |
||
1634 | 1304 |
type = #slave ifTrue:[ |
1305 |
window beSlave. |
|
1306 |
]. |
|
1307 |
type = #partner ifTrue:[ |
|
1308 |
window bePartner. |
|
1309 |
]. |
|
1722 | 1310 |
|
1311 |
"/ the following automatism is probably too cryptic and has too many |
|
1312 |
"/ side effects on the currently active group. |
|
1313 |
"/ I prefer to leave things as they are: i.e. enforce the programmer to |
|
1314 |
"/ do thinks explicit. |
|
1315 |
||
1316 |
"/ ((type = #slave or:[type = #partner]) |
|
1317 |
"/ and:[ window windowGroup isNil ]) |
|
1318 |
"/ ifTrue:[ |
|
1319 |
"/ window openInGroup:(WindowGroup activeGroup). |
|
1320 |
"/ ] ifFalse:[ |
|
1321 |
"/ window open. |
|
1322 |
"/ ]. |
|
1323 |
"/ type = #slave ifTrue:[ |
|
1324 |
"/ window windowGroup topViews first beMaster |
|
1325 |
"/ ]. |
|
1326 |
||
428 | 1327 |
^ self |
1328 |
]. |
|
1329 |
||
1330 |
type == #popUp ifTrue:[ |
|
1672 | 1331 |
window fixPosition:(device pointerPosition). |
1092
20104ea94915
cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents:
1031
diff
changeset
|
1332 |
^ window openAsPopUp. |
428 | 1333 |
]. |
1334 |
||
1335 |
" |
|
1336 |
if ST-80 supports more types - these may be added later |
|
1337 |
" |
|
1338 |
self halt:'unimplemented' |
|
1339 |
||
735 | 1340 |
"Created: / 14.2.1997 / 20:22:24 / cg" |
965
04cadbd21aac
use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents:
961
diff
changeset
|
1341 |
"Modified: / 18.6.1998 / 19:10:07 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1342 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1343 |
|
132 | 1344 |
!WindowBuilder class methodsFor:'documentation'! |
1345 |
||
1346 |
version |
|
1722 | 1347 |
^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.104 2003-03-21 17:31:50 cg Exp $' |
132 | 1348 |
! ! |