author | Claus Gittinger <cg@exept.de> |
Mon, 01 Dec 1997 19:51:00 +0100 | |
changeset 744 | 363d53be9eb0 |
parent 735 | 4b66677877e8 |
child 774 | fb8810086f95 |
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 |
600 | 15 |
namedComponents helpKeys componentCreationHook applicationClass |
502 | 16 |
keyboardProcessor subCanvasSpecs' |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
17 |
classVariableNames:'StopOnError' |
436 | 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 |
735 | 42 |
some interface spec. |
43 |
Currently, an experimantal version of UIBuilder exists, |
|
66 | 44 |
and more may be added in the future (for example, to parse different UI |
735 | 45 |
specs - thinking of motifs UIL specs, Windows DialogSpecs etc.). |
223 | 46 |
|
47 |
[author:] |
|
48 |
Claus Gittinger |
|
66 | 49 |
" |
50 |
! ! |
|
51 |
||
52 |
!WindowBuilder methodsFor:'accessing'! |
|
53 |
||
463 | 54 |
addBindings:moreBindings |
55 |
"used with subDialogs, which provide local bindings. |
|
56 |
All bindings from moreBindings overwrite any local bindings." |
|
57 |
||
58 |
moreBindings notNil ifTrue:[ |
|
59 |
moreBindings keysAndValuesDo:[:aKey :aValue | |
|
60 |
bindings at:aKey put:aValue |
|
61 |
] |
|
62 |
] |
|
63 |
||
64 |
"Created: 28.2.1997 / 14:14:33 / cg" |
|
65 |
! |
|
66 |
||
100 | 67 |
application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
68 |
"return the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
69 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
70 |
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
|
71 |
|
100 | 72 |
^ application |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
73 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
74 |
"Modified: 17.1.1997 / 19:04:40 / cg" |
66 | 75 |
! |
76 |
||
125 | 77 |
application:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
78 |
"set the application (an ApplicationModel), |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
79 |
for which the view is built. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
80 |
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
|
81 |
|
125 | 82 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
83 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
84 |
"Modified: 17.1.1997 / 19:04:47 / cg" |
66 | 85 |
! |
86 |
||
422 | 87 |
applicationClass:something |
88 |
"set the value of the instance variable 'applicationClass' (automatically generated)" |
|
89 |
||
90 |
applicationClass := something.! |
|
91 |
||
66 | 92 |
aspectAt:aSymbol |
433 | 93 |
|b| |
94 |
||
473 | 95 |
aSymbol notNil ifTrue:[ |
96 |
bindings notNil ifTrue:[ |
|
97 |
b := bindings at:aSymbol ifAbsent:nil. |
|
98 |
b notNil ifTrue:[^ b]. |
|
99 |
]. |
|
434 | 100 |
|
473 | 101 |
application notNil ifTrue:[ |
577 | 102 |
Object messageNotUnderstoodSignal handle:[:ex | |
727 | 103 |
ex parameter selector == aSymbol ifFalse:[ |
104 |
ex reject |
|
105 |
] |
|
577 | 106 |
] do:[ |
473 | 107 |
^ application aspectFor:aSymbol |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
108 |
]. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
109 |
Object messageNotUnderstoodSignal handle:[:ex | |
727 | 110 |
ex parameter selector == aSymbol ifFalse:[ |
111 |
ex reject |
|
112 |
] |
|
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
113 |
] do:[ |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
114 |
^ application class aspectFor:aSymbol |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
115 |
]. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
116 |
Transcript showCR:'WindowBuilder: no aspect for ' , aSymbol storeString. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
117 |
StopOnError == true ifTrue:[self halt]. "/ avoids debugger in end-user apps |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
118 |
]. |
433 | 119 |
]. |
120 |
^ nil |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
121 |
|
727 | 122 |
"Modified: / 29.10.1997 / 17:26:16 / cg" |
66 | 123 |
! |
124 |
||
125 | 125 |
aspectAt:aSymbol put:aModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
126 |
bindings isNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
127 |
bindings := IdentityDictionary new |
125 | 128 |
]. |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
129 |
^ bindings at:aSymbol put:aModel |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
130 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
131 |
"Modified: 17.1.1997 / 19:28:37 / cg" |
100 | 132 |
! |
133 |
||
450 | 134 |
bindingAt:aSymbol |
135 |
bindings notNil ifTrue:[ |
|
136 |
^ bindings at:aSymbol ifAbsent:nil. |
|
137 |
]. |
|
138 |
^ nil |
|
139 |
! |
|
140 |
||
100 | 141 |
bindings |
142 |
^ bindings |
|
143 |
! |
|
144 |
||
145 |
bindings:aDictionary |
|
146 |
bindings := aDictionary |
|
147 |
! |
|
148 |
||
125 | 149 |
componentAt:name |
450 | 150 |
namedComponents isNil ifTrue:[^ nil]. |
151 |
^ namedComponents at:name asSymbol ifAbsent:nil |
|
125 | 152 |
! |
153 |
||
100 | 154 |
componentAt:name put:aComponent |
450 | 155 |
namedComponents isNil ifTrue:[ |
156 |
namedComponents := IdentityDictionary new. |
|
100 | 157 |
]. |
450 | 158 |
namedComponents at:name asSymbol put:aComponent |
100 | 159 |
! |
160 |
||
410 | 161 |
componentCreationHook:something |
162 |
"set the value of the instance variable 'componentCreationHook' (automatically generated)" |
|
163 |
||
164 |
componentCreationHook := something.! |
|
165 |
||
125 | 166 |
focusSequence |
167 |
^ focusSequence |
|
66 | 168 |
! |
169 |
||
600 | 170 |
helpKeyFor:aComponent |
171 |
|v key| |
|
172 |
||
173 |
helpKeys isNil ifTrue:[^ nil]. |
|
174 |
v := aComponent. |
|
175 |
[v notNil] whileTrue:[ |
|
176 |
(key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[ |
|
177 |
^ key |
|
178 |
]. |
|
179 |
v := v superView |
|
180 |
]. |
|
595 | 181 |
^ nil |
600 | 182 |
! |
595 | 183 |
|
600 | 184 |
helpKeyFor:aComponent put:aKey |
595 | 185 |
|
600 | 186 |
aKey isNil ifTrue:[ |
187 |
helpKeys isNil ifFalse:[ |
|
188 |
helpKeys removeKey:aComponent ifAbsent:nil |
|
189 |
] |
|
190 |
] ifFalse:[ |
|
191 |
helpKeys isNil ifTrue:[ |
|
192 |
helpKeys := IdentityDictionary new |
|
193 |
]. |
|
194 |
helpKeys at:aComponent put:aKey |
|
195 |
] |
|
595 | 196 |
|
197 |
! |
|
198 |
||
477 | 199 |
keyboardProcessor |
200 |
keyboardProcessor isNil ifTrue:[ |
|
201 |
keyboardProcessor := KeyboardProcessor new |
|
202 |
]. |
|
203 |
^ keyboardProcessor |
|
204 |
||
205 |
"Created: 3.3.1997 / 18:31:37 / cg" |
|
206 |
"Modified: 3.3.1997 / 18:32:27 / cg" |
|
207 |
! |
|
208 |
||
86 | 209 |
namedComponents |
450 | 210 |
^ namedComponents |
86 | 211 |
! |
212 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
213 |
source |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
214 |
"same as #application, for ST-80 compatibility" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
215 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
216 |
^ application |
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 |
"Created: 17.1.1997 / 19:03:51 / cg" |
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 |
|
125 | 221 |
source:anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
222 |
"same as #application:, for ST-80 compatibility" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
223 |
|
125 | 224 |
application := anApplicationModel |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
225 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
226 |
"Modified: 17.1.1997 / 19:03:57 / cg" |
125 | 227 |
! |
228 |
||
502 | 229 |
subCanvasAt:majorKey at:minorKey |
586 | 230 |
"get the subCanvas specification from major and minor key |
231 |
" |
|
735 | 232 |
|spec cls app dict dkey| |
502 | 233 |
|
234 |
subCanvasSpecs notNil ifTrue:[ |
|
586 | 235 |
dkey := majorKey ? #NoMajorKey. |
236 |
dict := subCanvasSpecs at:dkey ifAbsent:nil. |
|
237 |
||
238 |
dict notNil ifTrue:[ |
|
239 |
spec := dict at:minorKey ifAbsent:nil. |
|
502 | 240 |
spec notNil ifTrue:[^ spec]. |
241 |
]. |
|
242 |
]. |
|
586 | 243 |
|
502 | 244 |
majorKey isNil ifTrue:[ |
586 | 245 |
spec := self safelyPerform:#specificationFor: with:minorKey. |
246 |
||
247 |
spec isNil ifTrue:[ |
|
248 |
spec := self safelyPerform:minorKey |
|
249 |
] |
|
502 | 250 |
] ifFalse:[ |
701 | 251 |
"/ look for class in applications namespace ... |
735 | 252 |
app := self application. |
253 |
app isNil ifTrue:[ |
|
254 |
"/ fallBack - use that global, if it exists |
|
255 |
cls := Smalltalk at:majorKey. |
|
256 |
cls isNil ifTrue:[ |
|
257 |
Transcript showCR:('missing application when fetching majorKey:' , majorKey). |
|
258 |
] |
|
259 |
] ifFalse:[ |
|
260 |
cls := app resolveName:majorKey. |
|
261 |
]. |
|
586 | 262 |
(cls notNil and:[cls respondsTo:minorKey]) ifTrue:[ |
502 | 263 |
spec := cls perform:minorKey |
264 |
] |
|
265 |
]. |
|
586 | 266 |
^ spec |
267 |
||
735 | 268 |
"Modified: / 1.11.1997 / 13:38:04 / cg" |
502 | 269 |
! |
270 |
||
271 |
subCanvasAt:majorKey at:minorKey put:aSpec |
|
272 |
|dict key| |
|
273 |
||
274 |
key := majorKey ? #NoMajorKey. |
|
275 |
dict := subCanvasSpecs at:key ifAbsent:nil. |
|
276 |
dict isNil ifTrue:[ |
|
277 |
dict := IdentityDictionary new. |
|
278 |
subCanvasSpecs at:key put:dict |
|
279 |
]. |
|
280 |
dict at:minorKey put:aSpec |
|
281 |
||
282 |
! |
|
283 |
||
475
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
284 |
visualAt:name |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
285 |
visuals isNil ifTrue:[^ nil]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
286 |
^ visuals at:name asSymbol ifAbsent:nil |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
287 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
288 |
"Created: 3.3.1997 / 16:24:17 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
289 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
290 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
291 |
visualAt:name put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
292 |
visuals isNil ifTrue:[ |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
293 |
visuals := IdentityDictionary new. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
294 |
]. |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
295 |
visuals at:name asSymbol put:aVisual |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
296 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
297 |
"Created: 3.3.1997 / 16:24:41 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
298 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
299 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
300 |
visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
301 |
^ visuals |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
302 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
303 |
"Created: 3.3.1997 / 16:24:00 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
304 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
305 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
306 |
visuals:aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
307 |
visuals := aDictionary |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
308 |
|
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
309 |
"Created: 3.3.1997 / 16:24:06 / cg" |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
310 |
! |
fd94f2bc8b9e
added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents:
473
diff
changeset
|
311 |
|
125 | 312 |
window |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
313 |
"return the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
314 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
315 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
316 |
^ window |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
317 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
318 |
"Modified: 17.1.1997 / 19:30:00 / cg" |
125 | 319 |
! |
320 |
||
321 |
window:aView |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
322 |
"set the top window (view), for which an interface |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
323 |
is (being) built" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
324 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
325 |
window := aView |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
326 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
327 |
"Modified: 17.1.1997 / 19:30:22 / cg" |
66 | 328 |
! |
329 |
||
330 |
windowGroup |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
331 |
^ window windowGroup |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
332 |
|
608 | 333 |
"Modified: 17.6.1997 / 18:04:01 / cg" |
66 | 334 |
! ! |
335 |
||
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
336 |
!WindowBuilder methodsFor:'aspect access support'! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
337 |
|
675 | 338 |
booleanValueAspectFor:aKey |
674 | 339 |
"helper (common code) to generate a boolean aspect if required. |
340 |
If no binding exists for aKey, a valueHolder holding false is |
|
341 |
created and added to the bindings. |
|
342 |
Otherwise, the existing binding is returned." |
|
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
343 |
|
676 | 344 |
^ self valueAspectFor:aKey initialValue:false |
673
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
345 |
|
676 | 346 |
"Modified: 28.7.1997 / 12:53:57 / cg" |
675 | 347 |
! |
348 |
||
349 |
nilValueAspectFor:aKey |
|
350 |
"helper (common code) to generate a valueHolder aspect if required. |
|
351 |
If no binding exists for aKey, a valueHolder holding nil is |
|
352 |
created and added to the bindings. |
|
353 |
Otherwise, the existing binding is returned." |
|
354 |
||
676 | 355 |
^ self valueAspectFor:aKey initialValue:nil |
356 |
||
357 |
"Modified: 28.7.1997 / 12:54:06 / cg" |
|
358 |
! |
|
359 |
||
360 |
valueAspectFor:aKey initialValue:initialValue |
|
361 |
"helper (common code) to generate a valueHolder aspect if required. |
|
362 |
If no binding exists for aKey, a valueHolder holding initialValue is |
|
363 |
created and added to the bindings. |
|
364 |
Otherwise, the existing binding is returned." |
|
365 |
||
675 | 366 |
|holder| |
367 |
||
368 |
(holder := self bindingAt:aKey) isNil ifTrue:[ |
|
676 | 369 |
self aspectAt:aKey put:(holder := initialValue asValue). |
675 | 370 |
]. |
371 |
^ holder |
|
372 |
||
676 | 373 |
"Created: 28.7.1997 / 12:53:45 / cg" |
374 |
"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
|
375 |
! ! |
5e342b1ebe45
added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
376 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
377 |
!WindowBuilder methodsFor:'building'! |
66 | 378 |
|
125 | 379 |
buildFromSpec:aSpec |
176 | 380 |
^ self subclassResponsibility |
408 | 381 |
! |
382 |
||
383 |
makeTabable:aComponent |
|
735 | 384 |
"add a component to the list of tabable components" |
385 |
||
408 | 386 |
focusSequence isNil ifTrue:[ |
387 |
focusSequence := OrderedCollection new. |
|
388 |
]. |
|
389 |
focusSequence add:aComponent |
|
735 | 390 |
|
391 |
"Modified: / 31.10.1997 / 18:39:30 / cg" |
|
66 | 392 |
! ! |
100 | 393 |
|
586 | 394 |
!WindowBuilder methodsFor:'message sending'! |
395 |
||
396 |
safelyPerform:aSelector |
|
397 |
"send the message aSelector to the receiver self or application; |
|
398 |
the result returned from the send or nil is returned |
|
399 |
" |
|
400 |
|res| |
|
401 |
||
595 | 402 |
aSelector isSymbol ifTrue:[ |
403 |
Object messageNotUnderstoodSignal handle:[:ex | |
|
404 |
] do:[ |
|
405 |
(res := self perform:aSelector) notNil ifTrue:[^ res] |
|
406 |
]. |
|
407 |
||
408 |
application notNil ifTrue:[ |
|
409 |
Object messageNotUnderstoodSignal handle:[:ex | |
|
410 |
] do:[ |
|
411 |
(res := application perform:aSelector) notNil ifTrue:[^ res] |
|
412 |
] |
|
586 | 413 |
] |
414 |
]. |
|
595 | 415 |
^ nil |
586 | 416 |
! |
417 |
||
418 |
safelyPerform:aSelector with:anArgument |
|
419 |
"send the one-arg-message aSelector to the receiver self or application; |
|
420 |
the result returned from the send or nil is returned |
|
421 |
" |
|
422 |
|res| |
|
423 |
||
595 | 424 |
aSelector isSymbol ifTrue:[ |
425 |
Object messageNotUnderstoodSignal handle:[:ex | |
|
426 |
] do:[ |
|
427 |
(res := self perform:aSelector with:anArgument) notNil ifTrue:[^ res] |
|
428 |
]. |
|
429 |
||
430 |
application notNil ifTrue:[ |
|
431 |
Object messageNotUnderstoodSignal handle:[:ex | |
|
432 |
] do:[ |
|
433 |
(res := application perform:aSelector with:anArgument) notNil ifTrue:[^ res] |
|
434 |
] |
|
586 | 435 |
] |
436 |
]. |
|
595 | 437 |
^ nil |
586 | 438 |
! ! |
439 |
||
422 | 440 |
!WindowBuilder methodsFor:'spec creation aspect fetch'! |
100 | 441 |
|
374 | 442 |
actionFor:aKey |
450 | 443 |
"return an action for aKey. This is invoked during window building |
444 |
(by the builder) to ask for an ActionButtons actionBlock. |
|
445 |
Here, first the local bindings are searched, then the application and |
|
446 |
finally the applications class is asked for a corresponding action. |
|
447 |
The returned object is typically a block." |
|
448 |
||
434 | 449 |
|b| |
450 |
||
451 |
bindings notNil ifTrue:[ |
|
452 |
b := bindings at:aKey ifAbsent:nil. |
|
453 |
b notNil ifTrue:[^ b]. |
|
454 |
]. |
|
455 |
||
374 | 456 |
application notNil ifTrue:[ |
577 | 457 |
Object messageNotUnderstoodSignal handle:[:ex | |
458 |
] do:[ |
|
450 | 459 |
^ application actionFor:aKey |
460 |
] |
|
374 | 461 |
]. |
422 | 462 |
applicationClass notNil ifTrue:[ |
424 | 463 |
(applicationClass respondsTo:#actionFor:) ifTrue:[ |
464 |
^ applicationClass actionFor:aKey |
|
465 |
] |
|
422 | 466 |
]. |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
467 |
|
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
468 |
Transcript showCR:'WindowBuilder: no action for: ' , aKey storeString. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
469 |
StopOnError == true ifTrue:[self halt]. "/ avoids debugger in end-user apps |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
470 |
|
422 | 471 |
^ [] |
374 | 472 |
|
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
473 |
"Created: / 17.1.1997 / 21:08:22 / cg" |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
474 |
"Modified: / 28.10.1997 / 12:52:57 / cg" |
374 | 475 |
! |
476 |
||
716 | 477 |
actionFor:aKey withValue:aValue |
478 |
"return an action for aKey/value combonation. |
|
479 |
This is invoked during window building |
|
480 |
(by the builder) to ask for an ActionButtons actionBlock if that button |
|
481 |
specified an action with an argument value. |
|
482 |
Here, first the local bindings are searched, then the application and |
|
483 |
finally the applications class is asked for a corresponding action. |
|
484 |
The returned object is typically a block." |
|
485 |
||
486 |
|b| |
|
487 |
||
488 |
bindings notNil ifTrue:[ |
|
489 |
b := bindings at:aKey ifAbsent:nil. |
|
490 |
b notNil ifTrue:[^ b]. |
|
491 |
]. |
|
492 |
||
493 |
application notNil ifTrue:[ |
|
494 |
Object messageNotUnderstoodSignal handle:[:ex | |
|
495 |
] do:[ |
|
496 |
^ application actionFor:aKey withValue:aValue |
|
497 |
] |
|
498 |
]. |
|
499 |
applicationClass notNil ifTrue:[ |
|
500 |
(applicationClass respondsTo:#actionFor:withValue:) ifTrue:[ |
|
501 |
^ applicationClass actionFor:aKey withValue:aValue |
|
502 |
] |
|
503 |
]. |
|
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
504 |
|
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
505 |
Transcript showCR:'WindowBuilder: no action for: ' , aKey storeString. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
506 |
StopOnError == true ifTrue:[self halt]. "/ avoids debugger in end-user apps |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
507 |
|
716 | 508 |
^ [:dummy | ] |
509 |
||
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
510 |
"Created: / 17.1.1997 / 21:08:22 / cg" |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
511 |
"Modified: / 28.10.1997 / 12:53:22 / cg" |
716 | 512 |
! |
513 |
||
374 | 514 |
aspectFor:aKey |
450 | 515 |
"return a model for aKey. This is invoked during window building |
516 |
(by the builder) to ask for an Editfields, a Toggles etc. model. |
|
517 |
Here, first the local bindings are searched, then the application and |
|
518 |
finally the applications class is asked for a corresponding action. |
|
519 |
The returned object is typically a valueHolder." |
|
520 |
||
434 | 521 |
|b| |
522 |
||
523 |
bindings notNil ifTrue:[ |
|
524 |
b := bindings at:aKey ifAbsent:nil. |
|
525 |
b notNil ifTrue:[^ b]. |
|
526 |
]. |
|
527 |
||
374 | 528 |
application notNil ifTrue:[ |
577 | 529 |
Object messageNotUnderstoodSignal handle:[:ex | |
530 |
] do:[ |
|
450 | 531 |
^ application aspectFor:aKey |
532 |
] |
|
374 | 533 |
]. |
422 | 534 |
applicationClass notNil ifTrue:[ |
735 | 535 |
Object messageNotUnderstoodSignal handle:[:ex | |
536 |
] do:[ |
|
424 | 537 |
^ applicationClass aspectFor:aKey |
538 |
] |
|
422 | 539 |
]. |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
540 |
|
374 | 541 |
^ self aspectAt:aKey |
542 |
||
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
543 |
"Created: / 17.1.1997 / 21:06:16 / cg" |
735 | 544 |
"Modified: / 1.11.1997 / 13:40:24 / cg" |
374 | 545 |
! |
546 |
||
423 | 547 |
componentFor:aKey |
450 | 548 |
"return a component for aKey. This is invoked during window building |
549 |
(by the builder) to ask for an ArbitraryComponents view. |
|
550 |
Here, first the local bindings are searched, then the application and |
|
551 |
finally the applications class is asked for a corresponding action. |
|
552 |
The returned object is typically a view." |
|
553 |
||
677 | 554 |
|component| |
423 | 555 |
|
556 |
application notNil ifTrue:[ |
|
611
10d6eccf083c
dont catch errors in componentFor (makes debugging easier)
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
557 |
component := application componentFor:aKey. |
10d6eccf083c
dont catch errors in componentFor (makes debugging easier)
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
558 |
component notNil ifTrue:[^ component]. |
423 | 559 |
]. |
560 |
applicationClass notNil ifTrue:[ |
|
424 | 561 |
(applicationClass respondsTo:#componentFor:) ifTrue:[ |
562 |
^ applicationClass componentFor:aKey |
|
563 |
] |
|
423 | 564 |
]. |
565 |
^ self aspectAt:aKey |
|
566 |
||
611
10d6eccf083c
dont catch errors in componentFor (makes debugging easier)
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
567 |
"Modified: 20.6.1997 / 11:40:22 / cg" |
423 | 568 |
! |
569 |
||
422 | 570 |
labelFor:aKey |
450 | 571 |
"return a label for aKey. This is invoked during window building |
572 |
(by the builder) to ask for a ???'s label. |
|
573 |
Here, first the local bindings are searched, then the application and |
|
574 |
finally the applications class is asked for a corresponding action. |
|
575 |
The returned object is typically a string." |
|
576 |
||
422 | 577 |
application notNil ifTrue:[ |
577 | 578 |
Object messageNotUnderstoodSignal handle:[:ex | |
579 |
] do:[ |
|
450 | 580 |
^ application labelFor:aKey |
581 |
] |
|
422 | 582 |
]. |
583 |
applicationClass notNil ifTrue:[ |
|
424 | 584 |
(applicationClass respondsTo:#labelFor:) ifTrue:[ |
585 |
^ applicationClass labelFor:aKey |
|
586 |
] |
|
422 | 587 |
]. |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
588 |
|
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
589 |
"/ Transcript showCR:'WindowBuilder: no label for: ' , aKey storeString. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
590 |
"/ StopOnError == true ifTrue:[self halt]. "/ avoids debugger in end-user apps |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
591 |
|
422 | 592 |
^ self aspectAt:aKey |
593 |
||
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
594 |
"Modified: / 28.10.1997 / 12:54:10 / cg" |
422 | 595 |
! |
596 |
||
597 |
listFor:aKey |
|
450 | 598 |
"return a list for aKey. This is invoked during window building |
599 |
(by the builder) to ask for a ???'s label. |
|
600 |
Here, first the local bindings are searched, then the application and |
|
601 |
finally the applications class is asked for a corresponding action. |
|
602 |
The returned object is typically a list." |
|
603 |
||
422 | 604 |
application notNil ifTrue:[ |
577 | 605 |
Object messageNotUnderstoodSignal handle:[:ex | |
606 |
] do:[ |
|
450 | 607 |
^ application listFor:aKey |
608 |
] |
|
422 | 609 |
]. |
610 |
applicationClass notNil ifTrue:[ |
|
424 | 611 |
(applicationClass respondsTo:#listFor:) ifTrue:[ |
612 |
^ applicationClass listFor:aKey |
|
613 |
] |
|
422 | 614 |
]. |
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
615 |
|
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
616 |
"/ Transcript showCR:'WindowBuilder: no list for: ' , aKey storeString. |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
617 |
"/ StopOnError == true ifTrue:[self halt]. "/ avoids debugger in end-user apps |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
618 |
|
422 | 619 |
^ self aspectAt:aKey |
620 |
||
717
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
621 |
"Created: / 17.1.1997 / 21:08:45 / cg" |
b89142a61d05
#aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents:
716
diff
changeset
|
622 |
"Modified: / 28.10.1997 / 12:54:32 / cg" |
422 | 623 |
! ! |
624 |
||
625 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
626 |
||
735 | 627 |
createdComponent:aView forSpec:spec named:name |
628 |
"callback from the UISpec after a view has been |
|
629 |
created for a spec. |
|
630 |
If it has a name, add it to the namedComponents dictionary; |
|
631 |
if I have a creationHook (application callBack), evaluate it." |
|
632 |
||
633 |
name notNil ifTrue:[ |
|
634 |
"/ self componentAt:name put:aView. |
|
635 |
namedComponents isNil ifTrue:[ |
|
636 |
namedComponents := IdentityDictionary new. |
|
637 |
]. |
|
638 |
namedComponents at:name asSymbol put:aView |
|
639 |
]. |
|
410 | 640 |
componentCreationHook notNil ifTrue:[ |
641 |
componentCreationHook value:aView value:spec value:self |
|
642 |
] |
|
100 | 643 |
|
735 | 644 |
"Modified: / 5.9.1995 / 21:42:54 / claus" |
645 |
"Created: / 31.10.1997 / 18:47:01 / cg" |
|
646 |
"Modified: / 31.10.1997 / 18:51:22 / cg" |
|
100 | 647 |
! ! |
648 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
649 |
!WindowBuilder methodsFor:'startup'! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
650 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
651 |
closeRequest |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
652 |
window destroy |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
653 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
654 |
"Modified: 17.1.1997 / 19:30:32 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
655 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
656 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
657 |
open |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
658 |
"open my topView, as previously created" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
659 |
|
477 | 660 |
|type| |
661 |
||
662 |
application isNil ifTrue:[ |
|
663 |
type := #normal |
|
664 |
] ifFalse:[ |
|
665 |
type := application defaultWindowType |
|
666 |
]. |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
667 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
668 |
openWithExtent:nil |
477 | 669 |
andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
670 |
|
477 | 671 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
672 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
673 |
|
428 | 674 |
openAt:aPoint |
675 |
"open my topView at some location" |
|
676 |
||
677 |
self |
|
467 | 678 |
openAt:aPoint |
679 |
withExtent:nil |
|
428 | 680 |
andType:(application defaultWindowType) |
681 |
||
682 |
"Created: 14.2.1997 / 20:21:57 / cg" |
|
467 | 683 |
"Modified: 28.2.1997 / 22:50:29 / cg" |
428 | 684 |
! |
685 |
||
436 | 686 |
openAt:origin withExtent:ext andType:type |
428 | 687 |
"open my window, as previously created, optionally defining the |
688 |
windows origin and/or extent. |
|
689 |
The type argument may be #dialog or #normal, and specifies if the view |
|
690 |
should be opened as a modal view, blocking interaction to the currently |
|
691 |
active view, or as a normal view." |
|
692 |
||
693 |
origin notNil ifTrue:[ |
|
694 |
window origin:origin |
|
695 |
]. |
|
696 |
ext notNil ifTrue:[ |
|
480 | 697 |
window extent:ext. |
698 |
] ifFalse:[ |
|
699 |
type == #dialog ifTrue:[ |
|
700 |
window fixSize |
|
701 |
] |
|
702 |
]. |
|
703 |
||
704 |
(windowView notNil and:[windowView ~~ window]) ifTrue:[ |
|
705 |
windowView extent:(window extent). |
|
428 | 706 |
]. |
707 |
||
708 |
type == #dialog ifTrue:[ |
|
467 | 709 |
window fixPosition:(window device pointerPosition - window positionOffset). |
428 | 710 |
window openModal. |
711 |
^ self |
|
712 |
]. |
|
713 |
||
714 |
type == #normal ifTrue:[ |
|
480 | 715 |
window isNil ifTrue:[ |
716 |
self setupWindowFor:(StandardSystemView new). |
|
717 |
]. |
|
718 |
||
428 | 719 |
window open. |
720 |
^ self |
|
721 |
]. |
|
722 |
||
723 |
type == #popUp ifTrue:[ |
|
467 | 724 |
window fixPosition:(window device pointerPosition). |
725 |
window openAsPopUp. |
|
428 | 726 |
^ self |
727 |
]. |
|
728 |
||
729 |
" |
|
730 |
if ST-80 supports more types - these may be added later |
|
731 |
" |
|
732 |
self halt:'unimplemented' |
|
733 |
||
735 | 734 |
"Created: / 14.2.1997 / 20:22:24 / cg" |
735 |
"Modified: / 30.10.1997 / 19:32:56 / cg" |
|
428 | 736 |
! |
737 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
738 |
openDialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
739 |
"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
|
740 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
741 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
742 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
743 |
openWithExtent:nil |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
744 |
andType:#dialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
745 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
746 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
747 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
748 |
|
428 | 749 |
openDialogAt:aPoint withExtent:ext |
750 |
"open my topView, as previously created as a modal view, |
|
751 |
blocking interaction to the currently active view." |
|
752 |
||
753 |
self |
|
754 |
openAt:aPoint withExtent:ext |
|
755 |
andType:#dialog |
|
756 |
||
757 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
|
758 |
"Created: 14.2.1997 / 20:24:19 / cg" |
|
759 |
! |
|
760 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
761 |
openDialogWithExtent:ext |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
762 |
"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
|
763 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
764 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
765 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
766 |
openWithExtent:ext |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
767 |
andType:#dialog |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
768 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
769 |
"Modified: 17.1.1997 / 19:59:36 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
770 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
771 |
|
664 | 772 |
openModal |
773 |
"open my topView, as previously created" |
|
774 |
||
775 |
self |
|
776 |
openWithExtent:nil |
|
777 |
andType:#dialog |
|
778 |
||
779 |
"Modified: 3.3.1997 / 19:43:57 / cg" |
|
780 |
! |
|
781 |
||
428 | 782 |
openPopUpAt:aPoint |
783 |
"open my topView, as previously created as a popUp view, |
|
784 |
blocking interaction to the currently active view." |
|
785 |
||
786 |
self |
|
787 |
openAt:aPoint withExtent:nil |
|
788 |
andType:#popUp |
|
789 |
||
790 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
|
791 |
"Created: 14.2.1997 / 20:24:38 / cg" |
|
792 |
! |
|
793 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
794 |
openPopUpIn:aRectangle |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
795 |
"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
|
796 |
blocking interaction to the currently active view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
797 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
798 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
799 |
openWithExtent:nil |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
800 |
andType:#popUp |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
801 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
802 |
"Modified: 17.1.1997 / 19:59:29 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
803 |
"Created: 17.1.1997 / 20:01:24 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
804 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
805 |
|
587 | 806 |
openWindowAt:aPoint |
807 |
"open my topView at some location" |
|
808 |
||
809 |
self openAt:aPoint |
|
810 |
! |
|
811 |
||
812 |
openWindowAt:origin withExtent:ext andType:type |
|
813 |
"open my window, as previously created, optionally defining the |
|
814 |
windows origin and/or extent. |
|
815 |
The type argument may be #dialog or #normal, and specifies if the view |
|
816 |
should be opened as a modal view, blocking interaction to the currently |
|
817 |
active view, or as a normal view." |
|
818 |
||
819 |
^ self openAt:origin withExtent:ext andType:type |
|
820 |
! |
|
821 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
822 |
openWithExtent:aPoint |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
823 |
"open my topView, as previously created, but override |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
824 |
the extent." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
825 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
826 |
self |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
827 |
openWithExtent:aPoint |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
828 |
andType:(application defaultWindowType) |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
829 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
830 |
"Modified: 17.1.1997 / 19:58:48 / cg" |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
831 |
! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
832 |
|
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
833 |
openWithExtent:ext andType:type |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
834 |
"open my window, as previously created. The type argument |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
835 |
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
|
836 |
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
|
837 |
active view, or as a normal view." |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
838 |
|
428 | 839 |
^ self openAt:nil withExtent:ext andType:type |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
840 |
|
428 | 841 |
"Modified: 14.2.1997 / 20:22:47 / cg" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
842 |
! ! |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
843 |
|
132 | 844 |
!WindowBuilder class methodsFor:'documentation'! |
845 |
||
846 |
version |
|
735 | 847 |
^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.54 1997-11-02 18:49:30 cg Exp $' |
132 | 848 |
! ! |