author | Claus Gittinger <cg@exept.de> |
Thu, 06 Mar 1997 16:18:25 +0100 | |
changeset 497 | 6544ec670fe0 |
parent 480 | 40218790e4ba |
child 502 | 43ca81bcde49 |
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 |
||
100 | 13 |
Object subclass:#WindowBuilder |
480 | 14 |
instanceVariableNames:'window windowView application bindings visuals focusSequence |
15 |
namedComponents componentCreationHook applicationClass |
|
16 |
keyboardProcessor' |
|
436 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Support-UI' |
|
66 | 20 |
! |
21 |
||
22 |
!WindowBuilder class methodsFor:'documentation'! |
|
23 |
||
89 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
434 | 27 |
All Rights Reserved |
89 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
66 | 38 |
documentation |
39 |
" |
|
69 | 40 |
a no-op class, for systems which do not use the UIBuilder. |
66 | 41 |
Concrete subclasses know how to create a view (with components) from |
42 |
some interface spec. Currently, an experimantal version of UIBuilder exists, |
|
43 |
and more may be added in the future (for example, to parse different UI |
|
44 |
specs - thinking of motifs UIL specs etc). |
|
223 | 45 |
|
46 |
[author:] |
|
47 |
Claus Gittinger |
|
66 | 48 |
" |
49 |
! ! |
|
50 |
||
51 |
!WindowBuilder methodsFor:'accessing'! |
|
52 |
||
463 | 53 |
addBindings:moreBindings |
54 |
"used with subDialogs, which provide local bindings. |
|
55 |
All bindings from moreBindings overwrite any local bindings." |
|
56 |
||
57 |
moreBindings notNil ifTrue:[ |
|
58 |
moreBindings keysAndValuesDo:[:aKey :aValue | |
|
59 |
bindings at:aKey put:aValue |
|
60 |
] |
|
61 |
] |
|
62 |
||
63 |
"Created: 28.2.1997 / 14:14:33 / cg" |
|
64 |
! |
|
65 |
||
100 | 66 |
application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
67 |
"return the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
68 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
69 |
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
|
70 |
|
100 | 71 |
^ application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
72 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
73 |
"Modified: 17.1.1997 / 19:04:40 / cg" |
66 | 74 |
! |
75 |
||
125 | 76 |
application:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
77 |
"set the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
78 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
79 |
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
|
80 |
|
125 | 81 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
82 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
83 |
"Modified: 17.1.1997 / 19:04:47 / cg" |
66 | 84 |
! |
85 |
||
422 | 86 |
applicationClass:something |
87 |
"set the value of the instance variable 'applicationClass' (automatically generated)" |
|
88 |
||
89 |
applicationClass := something.! |
|
90 |
||
66 | 91 |
aspectAt:aSymbol |
433 | 92 |
|b| |
93 |
||
473 | 94 |
aSymbol notNil ifTrue:[ |
95 |
bindings notNil ifTrue:[ |
|
96 |
b := bindings at:aSymbol ifAbsent:nil. |
|
97 |
b notNil ifTrue:[^ b]. |
|
98 |
]. |
|
434 | 99 |
|
473 | 100 |
application notNil ifTrue:[ |
101 |
Object messageNotUnderstoodSignal catch:[ |
|
102 |
^ application aspectFor:aSymbol |
|
103 |
] |
|
450 | 104 |
] |
433 | 105 |
]. |
106 |
^ nil |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
107 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
108 |
"Modified: 17.1.1997 / 19:28:32 / cg" |
66 | 109 |
! |
110 |
||
125 | 111 |
aspectAt:aSymbol put:aModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
112 |
bindings isNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
113 |
bindings := IdentityDictionary new |
125 | 114 |
]. |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
115 |
^ bindings at:aSymbol put:aModel |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
116 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
117 |
"Modified: 17.1.1997 / 19:28:37 / cg" |
100 | 118 |
! |
119 |
||
450 | 120 |
bindingAt:aSymbol |
121 |
bindings notNil ifTrue:[ |
|
122 |
^ bindings at:aSymbol ifAbsent:nil. |
|
123 |
]. |
|
124 |
^ nil |
|
125 |
! |
|
126 |
||
100 | 127 |
bindings |
128 |
^ bindings |
|
129 |
! |
|
130 |
||
131 |
bindings:aDictionary |
|
132 |
bindings := aDictionary |
|
133 |
! |
|
134 |
||
125 | 135 |
componentAt:name |
450 | 136 |
namedComponents isNil ifTrue:[^ nil]. |
137 |
^ namedComponents at:name asSymbol ifAbsent:nil |
|
125 | 138 |
! |
139 |
||
100 | 140 |
componentAt:name put:aComponent |
450 | 141 |
namedComponents isNil ifTrue:[ |
142 |
namedComponents := IdentityDictionary new. |
|
100 | 143 |
]. |
450 | 144 |
namedComponents at:name asSymbol put:aComponent |
100 | 145 |
! |
146 |
||
410 | 147 |
componentCreationHook:something |
148 |
"set the value of the instance variable 'componentCreationHook' (automatically generated)" |
|
149 |
||
150 |
componentCreationHook := something.! |
|
151 |
||
125 | 152 |
focusSequence |
153 |
^ focusSequence |
|
66 | 154 |
! |
155 |
||
477 | 156 |
keyboardProcessor |
157 |
keyboardProcessor isNil ifTrue:[ |
|
158 |
keyboardProcessor := KeyboardProcessor new |
|
159 |
]. |
|
160 |
^ keyboardProcessor |
|
161 |
||
162 |
"Created: 3.3.1997 / 18:31:37 / cg" |
|
163 |
"Modified: 3.3.1997 / 18:32:27 / cg" |
|
164 |
! |
|
165 |
||
86 | 166 |
namedComponents |
450 | 167 |
^ namedComponents |
86 | 168 |
! |
169 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
170 |
source |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
171 |
"same as #application, for ST-80 compatibility" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
172 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
173 |
^ application |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
174 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
175 |
"Created: 17.1.1997 / 19:03:51 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
176 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
177 |
|
125 | 178 |
source:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
179 |
"same as #application:, for ST-80 compatibility" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
180 |
|
125 | 181 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
182 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
183 |
"Modified: 17.1.1997 / 19:03:57 / cg" |
125 | 184 |
! |
185 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
186 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
187 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
188 |
^ visuals at:name asSymbol ifAbsent:nil |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
189 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
190 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
191 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
192 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
193 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
194 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
195 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
196 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
197 |
visuals at:name asSymbol put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
198 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
199 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
200 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
201 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
202 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
203 |
^ visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
204 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
205 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
206 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
207 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
208 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
209 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
210 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
211 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
212 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
213 |
|
125 | 214 |
window |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
215 |
"return the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
216 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
217 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
218 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
219 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
220 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 221 |
! |
222 |
||
223 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
224 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
225 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
226 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
227 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
228 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
229 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 230 |
! |
231 |
||
232 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
233 |
self halt. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
234 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
235 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
236 |
"Modified: 17.1.1997 / 19:30:26 / cg" |
66 | 237 |
! ! |
238 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
239 |
!WindowBuilder methodsFor:'building'! |
66 | 240 |
|
125 | 241 |
buildFromSpec:aSpec |
176 | 242 |
^ self subclassResponsibility |
408 | 243 |
! |
244 |
||
245 |
makeTabable:aComponent |
|
246 |
focusSequence isNil ifTrue:[ |
|
247 |
focusSequence := OrderedCollection new. |
|
248 |
]. |
|
249 |
focusSequence add:aComponent |
|
66 | 250 |
! ! |
100 | 251 |
|
422 | 252 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 253 |
|
374 | 254 |
actionFor:aKey |
450 | 255 |
"return an action for aKey. This is invoked during window building |
256 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
257 |
Here, first the local bindings are searched, then the application and |
|
258 |
finally the applications class is asked for a corresponding action. |
|
259 |
The returned object is typically a block." |
|
260 |
||
434 | 261 |
|b| |
262 |
||
263 |
bindings notNil ifTrue:[ |
|
264 |
b := bindings at:aKey ifAbsent:nil. |
|
265 |
b notNil ifTrue:[^ b]. |
|
266 |
]. |
|
267 |
||
374 | 268 |
application notNil ifTrue:[ |
450 | 269 |
Object messageNotUnderstoodSignal catch:[ |
270 |
^ application actionFor:aKey |
|
271 |
] |
|
374 | 272 |
]. |
422 | 273 |
applicationClass notNil ifTrue:[ |
424 | 274 |
(applicationClass respondsTo:#actionFor:) ifTrue:[ |
275 |
^ applicationClass actionFor:aKey |
|
276 |
] |
|
422 | 277 |
]. |
278 |
^ [] |
|
374 | 279 |
|
280 |
"Created: 17.1.1997 / 21:08:22 / cg" |
|
281 |
! |
|
282 |
||
283 |
aspectFor:aKey |
|
450 | 284 |
"return a model for aKey. This is invoked during window building |
285 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
286 |
Here, first the local bindings are searched, then the application and |
|
287 |
finally the applications class is asked for a corresponding action. |
|
288 |
The returned object is typically a valueHolder." |
|
289 |
||
434 | 290 |
|b| |
291 |
||
292 |
bindings notNil ifTrue:[ |
|
293 |
b := bindings at:aKey ifAbsent:nil. |
|
294 |
b notNil ifTrue:[^ b]. |
|
295 |
]. |
|
296 |
||
374 | 297 |
application notNil ifTrue:[ |
450 | 298 |
Object messageNotUnderstoodSignal catch:[ |
299 |
^ application aspectFor:aKey |
|
300 |
] |
|
374 | 301 |
]. |
422 | 302 |
applicationClass notNil ifTrue:[ |
424 | 303 |
(applicationClass respondsTo:#aspectFor:) ifTrue:[ |
304 |
^ applicationClass aspectFor:aKey |
|
305 |
] |
|
422 | 306 |
]. |
374 | 307 |
^ self aspectAt:aKey |
308 |
||
309 |
"Created: 17.1.1997 / 21:06:16 / cg" |
|
310 |
! |
|
311 |
||
423 | 312 |
componentFor:aKey |
450 | 313 |
"return a component for aKey. This is invoked during window building |
314 |
(by the builder) to ask for an ArbitraryComponents view. |
|
315 |
Here, first the local bindings are searched, then the application and |
|
316 |
finally the applications class is asked for a corresponding action. |
|
317 |
The returned object is typically a view." |
|
318 |
||
423 | 319 |
|cls| |
320 |
||
321 |
application notNil ifTrue:[ |
|
450 | 322 |
Object messageNotUnderstoodSignal catch:[ |
323 |
^ application componentFor:aKey |
|
324 |
] |
|
423 | 325 |
]. |
326 |
applicationClass notNil ifTrue:[ |
|
424 | 327 |
(applicationClass respondsTo:#componentFor:) ifTrue:[ |
328 |
^ applicationClass componentFor:aKey |
|
329 |
] |
|
423 | 330 |
]. |
331 |
^ self aspectAt:aKey |
|
332 |
||
333 |
! |
|
334 |
||
422 | 335 |
labelFor:aKey |
450 | 336 |
"return a label for aKey. This is invoked during window building |
337 |
(by the builder) to ask for a ???'s label. |
|
338 |
Here, first the local bindings are searched, then the application and |
|
339 |
finally the applications class is asked for a corresponding action. |
|
340 |
The returned object is typically a string." |
|
341 |
||
422 | 342 |
|cls| |
343 |
||
344 |
application notNil ifTrue:[ |
|
450 | 345 |
Object messageNotUnderstoodSignal catch:[ |
346 |
^ application labelFor:aKey |
|
347 |
] |
|
422 | 348 |
]. |
349 |
applicationClass notNil ifTrue:[ |
|
424 | 350 |
(applicationClass respondsTo:#labelFor:) ifTrue:[ |
351 |
^ applicationClass labelFor:aKey |
|
352 |
] |
|
422 | 353 |
]. |
354 |
^ self aspectAt:aKey |
|
355 |
||
356 |
! |
|
357 |
||
358 |
listFor:aKey |
|
450 | 359 |
"return a list for aKey. This is invoked during window building |
360 |
(by the builder) to ask for a ???'s label. |
|
361 |
Here, first the local bindings are searched, then the application and |
|
362 |
finally the applications class is asked for a corresponding action. |
|
363 |
The returned object is typically a list." |
|
364 |
||
422 | 365 |
application notNil ifTrue:[ |
450 | 366 |
Object messageNotUnderstoodSignal catch:[ |
367 |
^ application listFor:aKey |
|
368 |
] |
|
422 | 369 |
]. |
370 |
applicationClass notNil ifTrue:[ |
|
424 | 371 |
(applicationClass respondsTo:#listFor:) ifTrue:[ |
372 |
^ applicationClass listFor:aKey |
|
373 |
] |
|
422 | 374 |
]. |
375 |
^ self aspectAt:aKey |
|
376 |
||
377 |
"Created: 17.1.1997 / 21:08:45 / cg" |
|
378 |
! ! |
|
379 |
||
380 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
381 |
||
100 | 382 |
createdComponent:aView forSpec:spec |
410 | 383 |
componentCreationHook notNil ifTrue:[ |
384 |
componentCreationHook value:aView value:spec value:self |
|
385 |
] |
|
100 | 386 |
|
387 |
"Modified: 5.9.1995 / 21:42:54 / claus" |
|
388 |
! ! |
|
389 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
390 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
391 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
392 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
393 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
394 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
395 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
396 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
397 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
398 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
399 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
400 |
|
477 | 401 |
|type| |
402 |
||
403 |
application isNil ifTrue:[ |
|
404 |
type := #normal |
|
405 |
] ifFalse:[ |
|
406 |
type := application defaultWindowType |
|
407 |
]. |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
408 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
409 |
openWithExtent:nil |
477 | 410 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
411 |
|
477 | 412 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
413 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
414 |
|
428 | 415 |
openAt:aPoint |
416 |
"open my topView at some location" |
|
417 |
||
418 |
self |
|
467 | 419 |
openAt:aPoint |
420 |
withExtent:nil |
|
428 | 421 |
andType:(application defaultWindowType) |
422 |
||
423 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 424 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 425 |
! |
426 |
||
436 | 427 |
openAt:origin withExtent:ext andType:type |
428 | 428 |
"open my window, as previously created, optionally defining the |
429 |
windows origin and/or extent. |
|
430 |
The type argument may be #dialog or #normal, and specifies if the view |
|
431 |
should be opened as a modal view, blocking interaction to the currently |
|
432 |
active view, or as a normal view." |
|
433 |
||
480 | 434 |
|mainSubView| |
435 |
||
428 | 436 |
origin notNil ifTrue:[ |
437 |
window origin:origin |
|
438 |
]. |
|
439 |
ext notNil ifTrue:[ |
|
480 | 440 |
window extent:ext. |
441 |
] ifFalse:[ |
|
442 |
type == #dialog ifTrue:[ |
|
443 |
window fixSize |
|
444 |
] |
|
445 |
]. |
|
446 |
||
447 |
(windowView notNil and:[windowView ~~ window]) ifTrue:[ |
|
448 |
windowView extent:(window extent). |
|
428 | 449 |
]. |
450 |
||
451 |
type == #dialog ifTrue:[ |
|
467 | 452 |
window fixPosition:(window device pointerPosition - window positionOffset). |
428 | 453 |
window openModal. |
454 |
^ self |
|
455 |
]. |
|
456 |
||
457 |
type == #normal ifTrue:[ |
|
480 | 458 |
window isNil ifTrue:[ |
459 |
self setupWindowFor:(StandardSystemView new). |
|
460 |
]. |
|
461 |
||
428 | 462 |
window open. |
463 |
^ self |
|
464 |
]. |
|
465 |
||
466 |
type == #popUp ifTrue:[ |
|
467 | 467 |
window fixPosition:(window device pointerPosition). |
468 |
window openAsPopUp. |
|
428 | 469 |
^ self |
470 |
]. |
|
471 |
||
472 |
" |
|
473 |
if ST-80 supports more types - these may be added later |
|
474 |
" |
|
475 |
self halt:'unimplemented' |
|
476 |
||
477 |
"Created: 14.2.1997 / 20:22:24 / cg" |
|
480 | 478 |
"Modified: 3.3.1997 / 22:27:52 / cg" |
428 | 479 |
! |
480 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
481 |
openDialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
482 |
"open my topView, as previously created as a modal view, |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
483 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
484 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
485 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
486 |
openWithExtent:nil |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
487 |
andType:#dialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
488 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
489 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
490 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
491 |
|
428 | 492 |
openDialogAt:aPoint withExtent:ext |
493 |
"open my topView, as previously created as a modal view, |
|
494 |
blocking interaction to the currently active view." |
|
495 |
||
496 |
self |
|
497 |
openAt:aPoint withExtent:ext |
|
498 |
andType:#dialog |
|
499 |
||
500 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
|
501 |
"Created: 14.2.1997 / 20:24:19 / cg" |
|
502 |
! |
|
503 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
504 |
openDialogWithExtent:ext |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
505 |
"open my topView, as previously created as a modal view, |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
506 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
507 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
508 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
509 |
openWithExtent:ext |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
510 |
andType:#dialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
511 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
512 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
513 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
514 |
|
428 | 515 |
openPopUpAt:aPoint |
516 |
"open my topView, as previously created as a popUp view, |
|
517 |
blocking interaction to the currently active view." |
|
518 |
||
519 |
self |
|
520 |
openAt:aPoint withExtent:nil |
|
521 |
andType:#popUp |
|
522 |
||
523 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
|
524 |
"Created: 14.2.1997 / 20:24:38 / cg" |
|
525 |
! |
|
526 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
527 |
openPopUpIn:aRectangle |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
528 |
"open my topView, as previously created as a popUp view, |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
529 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
530 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
531 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
532 |
openWithExtent:nil |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
533 |
andType:#popUp |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
534 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
535 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
536 |
"Created: 17.1.1997 / 20:01:24 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
537 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
538 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
539 |
openWithExtent:aPoint |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
540 |
"open my topView, as previously created, but override |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
541 |
the extent." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
542 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
543 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
544 |
openWithExtent:aPoint |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
545 |
andType:(application defaultWindowType) |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
546 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
547 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
548 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
549 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
550 |
openWithExtent:ext andType:type |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
551 |
"open my window, as previously created. The type argument |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
552 |
may be #dialog or #normal, and specifies if the view should |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
553 |
be opened as a modal view, blocking interaction to the currently |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
554 |
active view, or as a normal view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
555 |
|
428 | 556 |
^ self openAt:nil withExtent:ext andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
557 |
|
428 | 558 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
559 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
560 |
|
132 | 561 |
!WindowBuilder class methodsFor:'documentation'! |
562 |
||
563 |
version |
|
480 | 564 |
^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.32 1997-03-03 21:28:34 cg Exp $' |
132 | 565 |
! ! |