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