42
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
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 |
|
|
13 |
ApplicationModel subclass:#UIPainter
|
|
14 |
instanceVariableNames:'menu nameField elementMenu workView treeView outletView stringBox
|
|
15 |
actionBox listBox fileBox currentFileName topView propertyFrame
|
58
|
16 |
whichProperty nameChannel applyAction specClass specSelector
|
|
17 |
specSuperclass aspectHolders specShown specSpecificAspectHolders
|
|
18 |
claus'
|
42
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
|
21 |
category:'Interface-UIPainter'
|
|
22 |
!
|
|
23 |
|
58
|
24 |
HorizontalPanelView subclass:#ButtonPanel
|
|
25 |
instanceVariableNames:'receiver argumentToSelector'
|
|
26 |
classVariableNames:''
|
|
27 |
poolDictionaries:''
|
|
28 |
privateIn:UIPainter
|
|
29 |
!
|
|
30 |
|
42
|
31 |
!UIPainter class methodsFor:'documentation'!
|
|
32 |
|
|
33 |
copyright
|
|
34 |
"
|
|
35 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
36 |
All Rights Reserved
|
|
37 |
|
|
38 |
This software is furnished under a license and may be used
|
|
39 |
only in accordance with the terms of that license and with the
|
|
40 |
inclusion of the above copyright notice. This software may not
|
|
41 |
be provided or otherwise made available to, or used by, any
|
|
42 |
other person. No title to or ownership of the software is
|
|
43 |
hereby transferred.
|
|
44 |
"
|
|
45 |
!
|
|
46 |
|
|
47 |
documentation
|
|
48 |
"
|
|
49 |
not yet finished, not yet published, not yet released.
|
|
50 |
|
|
51 |
[start with:]
|
46
|
52 |
UIPainter open
|
42
|
53 |
"
|
|
54 |
! !
|
|
55 |
|
|
56 |
!UIPainter class methodsFor:'interface specs'!
|
|
57 |
|
|
58 |
actionButtonModelSpec
|
|
59 |
"UIPainter new openOnClass:self andSelector:#actionButtonModelSpec"
|
|
60 |
|
|
61 |
<resource: #canvas>
|
|
62 |
|
|
63 |
^
|
|
64 |
|
|
65 |
#(#FullSpec
|
|
66 |
#'component:'
|
|
67 |
#(#SpecCollection
|
|
68 |
#'collection:'
|
|
69 |
#(
|
|
70 |
#(#FramedBoxSpec
|
|
71 |
#'layout:' #(#LayoutFrame 0 0 -1 0 251 0 289 0)
|
|
72 |
#'component:'
|
|
73 |
#(#SpecCollection
|
|
74 |
#'collection:'
|
|
75 |
#(
|
|
76 |
#(#VerticalPanelViewSpec
|
|
77 |
#'layout:' #(#LayoutFrame 6 0 26 0 78 0 216 0)
|
|
78 |
#'component:'
|
|
79 |
#(#SpecCollection
|
|
80 |
#'collection:'
|
|
81 |
#(
|
|
82 |
#(#LabelSpec
|
|
83 |
#'name:' 'label'
|
|
84 |
#'layout:' #(#LayoutFrame 0 0 47 0 57 0 71 0)
|
|
85 |
#'label:' 'aspect:'
|
|
86 |
)
|
|
87 |
#(#LabelSpec
|
|
88 |
#'name:' 'label'
|
|
89 |
#'layout:' #(#LayoutFrame 0 0 119 0 62 0 143 0)
|
|
90 |
#'label:' 'change:'
|
|
91 |
)
|
|
92 |
)
|
|
93 |
)
|
|
94 |
#'horizontalLayout:' #left
|
|
95 |
#'verticalLayout:' #spreadSpace
|
|
96 |
)
|
|
97 |
#(#VerticalPanelViewSpec
|
|
98 |
#'layout:' #(#LayoutFrame 80 0 24 0 231 0 214 0)
|
|
99 |
#'component:'
|
|
100 |
#(#SpecCollection
|
|
101 |
#'collection:'
|
|
102 |
#(
|
|
103 |
#(#InputFieldSpec
|
|
104 |
#'name:' 'aspectInput'
|
|
105 |
#'layout:' #(#LayoutFrame 0 0 49 0 163 0 69 0)
|
|
106 |
#model: #aspectChannel
|
|
107 |
#acceptOnLostFocus: true
|
|
108 |
#tabable: true
|
|
109 |
)
|
|
110 |
#(#InputFieldSpec
|
|
111 |
#'name:' 'changeInput'
|
|
112 |
#'layout:' #(#LayoutFrame 0 0 119 0 163 0 142 0)
|
|
113 |
#model: #changeChannel
|
|
114 |
#acceptOnLostFocus: true
|
|
115 |
#tabable: true
|
|
116 |
)
|
|
117 |
)
|
|
118 |
)
|
|
119 |
#'horizontalLayout:' #fit
|
|
120 |
#'verticalLayout:' #spreadSpace
|
|
121 |
)
|
|
122 |
#(#ActionButtonSpec
|
|
123 |
#'name:' 'button'
|
|
124 |
#'layout:' #(#LayoutFrame 102 0 246 0 153 0 272 0)
|
|
125 |
#'label:' 'apply'
|
|
126 |
#'model:' #setModelAspects
|
|
127 |
)
|
|
128 |
)
|
|
129 |
)
|
|
130 |
#'labelPosition:' #topLeft
|
|
131 |
#'showFrame:' false
|
|
132 |
)
|
|
133 |
)
|
|
134 |
)
|
|
135 |
#'window:'
|
|
136 |
#(#WindowSpec
|
|
137 |
#'label:' 'unnamed'
|
|
138 |
#'bounds:' #(#Rectangle 0 0 255 292)
|
|
139 |
)
|
|
140 |
)
|
|
141 |
!
|
|
142 |
|
58
|
143 |
cancelAndApplySpec
|
|
144 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
145 |
|
|
146 |
"do not manually edit this - the painter/builder may not be able to
|
|
147 |
handle the specification if its corrupted."
|
|
148 |
|
|
149 |
"
|
|
150 |
UIPainter new openOnClass:UIPainter andSelector:#cancelAndApplySpec
|
|
151 |
UIPainter new openInterface:#cancelAndApplySpec
|
|
152 |
"
|
|
153 |
|
|
154 |
<resource: #canvas>
|
|
155 |
|
|
156 |
^
|
|
157 |
|
|
158 |
#(#FullSpec
|
|
159 |
#'window:'
|
|
160 |
#(#WindowSpec
|
|
161 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
162 |
#'label:' 'unnamed'
|
|
163 |
#'bounds:' #(#Rectangle 0 0 225 45)
|
|
164 |
)
|
|
165 |
#'component:'
|
|
166 |
#(#SpecCollection
|
|
167 |
#'collection:'
|
|
168 |
#(
|
|
169 |
#(#ActionButtonSpec
|
|
170 |
#'name:' 'cancel'
|
|
171 |
#'layout:' #(#LayoutFrame 26 0 13 0 77 0 35 0)
|
|
172 |
#'label:' 'cancel'
|
|
173 |
#'model:' #cancel
|
|
174 |
)
|
|
175 |
#(#ActionButtonSpec
|
|
176 |
#'name:' 'apply'
|
|
177 |
#'layout:' #(#LayoutFrame 139 0 13 0 190 0 35 0)
|
|
178 |
#'label:' 'apply'
|
|
179 |
#'model:' #apply
|
|
180 |
)
|
|
181 |
)
|
|
182 |
)
|
|
183 |
)
|
|
184 |
!
|
|
185 |
|
42
|
186 |
colorSpec
|
|
187 |
"UIBuilder new openOnClass:self andSelector:#colorSpec"
|
|
188 |
"Builder new openInterface:#colorSpec"
|
|
189 |
|
|
190 |
<resource: #canvas>
|
|
191 |
^
|
|
192 |
|
|
193 |
#(#FullSpec
|
|
194 |
#'component:'
|
|
195 |
#(#SpecCollection
|
|
196 |
#'collection:'
|
|
197 |
#(
|
|
198 |
#(#FramedBoxSpec
|
|
199 |
#'layout:' #(#LayoutFrame 0 0 -1 0 252 0 290 0)
|
|
200 |
#'component:'
|
|
201 |
#(#SpecCollection
|
|
202 |
#'collection:'
|
|
203 |
#(
|
|
204 |
#(#VerticalPanelViewSpec
|
|
205 |
#'layout:' #(#LayoutFrame 6 0 26 0 100 0 215 0)
|
|
206 |
#'component:'
|
|
207 |
#(#SpecCollection
|
|
208 |
#'collection:'
|
|
209 |
#(
|
|
210 |
#(#LabelSpec
|
|
211 |
#'name:' 'label'
|
|
212 |
#'layout:' #(#LayoutFrame 0 0 47 0 87 0 71 0)
|
|
213 |
#'label:' 'foreground:'
|
|
214 |
)
|
|
215 |
#(#LabelSpec
|
|
216 |
#'name:' 'label'
|
|
217 |
#'layout:' #(#LayoutFrame 0 0 119 0 93 0 143 0)
|
|
218 |
#'label:' 'background:'
|
|
219 |
)
|
|
220 |
)
|
|
221 |
)
|
|
222 |
#'horizontalLayout:' #left
|
|
223 |
#'verticalLayout:' #spreadSpace
|
|
224 |
)
|
|
225 |
#(#VerticalPanelViewSpec
|
|
226 |
#'layout:' #(#LayoutFrame 114 0 24 0 233 0 213 0)
|
|
227 |
#'component:'
|
|
228 |
#(#SpecCollection
|
|
229 |
#'collection:'
|
|
230 |
#(
|
|
231 |
#(#InputFieldSpec
|
|
232 |
#'layout:' #(#LayoutFrame 0 0 49 0 163 0 69 0)
|
58
|
233 |
#model: #foregroundColor
|
55
|
234 |
#acceptOnLostFocus: true
|
|
235 |
#tabable: true
|
|
236 |
|
42
|
237 |
)
|
|
238 |
#(#InputFieldSpec
|
|
239 |
#'layout:' #(#LayoutFrame 0 0 119 0 163 0 142 0)
|
58
|
240 |
#model: #backgroundColor
|
55
|
241 |
#acceptOnLostFocus: true
|
|
242 |
#tabable: true
|
|
243 |
|
42
|
244 |
)
|
|
245 |
)
|
|
246 |
)
|
|
247 |
#'horizontalLayout:' #fit
|
|
248 |
#'verticalLayout:' #spreadSpace
|
|
249 |
)
|
|
250 |
#(#ActionButtonSpec
|
|
251 |
#'name:' 'button'
|
|
252 |
#'layout:' #(#LayoutFrame 102 0 246 0 153 0 272 0)
|
|
253 |
#'label:' 'apply'
|
|
254 |
#'model:' #setColors
|
55
|
255 |
#tabable: true
|
|
256 |
|
42
|
257 |
)
|
|
258 |
)
|
|
259 |
)
|
|
260 |
#'labelPosition:' #topLeft
|
|
261 |
#'showFrame:' false
|
|
262 |
)
|
|
263 |
)
|
|
264 |
)
|
|
265 |
#'window:'
|
|
266 |
#(#WindowSpec
|
|
267 |
#'label:' 'unnamed'
|
|
268 |
#'bounds:' #(#Rectangle 0 0 255 292)
|
|
269 |
)
|
|
270 |
)
|
|
271 |
!
|
|
272 |
|
|
273 |
geometrySpecForAlignmentOrigin
|
58
|
274 |
"
|
|
275 |
UIPainter new openOnClass:self andSelector:#geometrySpecForAlignmentOrigin
|
|
276 |
"
|
42
|
277 |
<resource: #canvas>
|
|
278 |
|
|
279 |
^
|
58
|
280 |
|
42
|
281 |
#(#FullSpec
|
58
|
282 |
#'window:'
|
|
283 |
#(#WindowSpec
|
|
284 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
285 |
#'label:' 'unnamed'
|
|
286 |
#'bounds:' #(#Rectangle 0 0 248 304)
|
|
287 |
)
|
42
|
288 |
#'component:'
|
|
289 |
#(#SpecCollection
|
|
290 |
#'collection:'
|
|
291 |
#(
|
58
|
292 |
#(#LabelSpec
|
|
293 |
#'name:' 'label1'
|
|
294 |
#'layout:' #(#LayoutFrame 5 0 42 0 48 0 60 0)
|
|
295 |
#'label:' 'left'
|
|
296 |
)
|
|
297 |
#(#LabelSpec
|
|
298 |
#'name:' 'label2'
|
|
299 |
#'layout:' #(#LayoutFrame 5 0 69 0 48 0 87 0)
|
|
300 |
#'label:' 'top'
|
|
301 |
)
|
|
302 |
#(#LabelSpec
|
|
303 |
#'name:' 'label3'
|
|
304 |
#'layout:' #(#LayoutFrame 57 0 10 0 103 0 27 0)
|
|
305 |
#'label:' 'relative'
|
|
306 |
)
|
|
307 |
#(#LabelSpec
|
|
308 |
#'name:' 'label4'
|
|
309 |
#'layout:' #(#LayoutFrame 154 0 11 0 190 0 28 0)
|
|
310 |
#'label:' 'offset'
|
|
311 |
)
|
|
312 |
#(#LabelSpec
|
|
313 |
#'name:' 'label5'
|
|
314 |
#'layout:' #(#LayoutFrame 5 0 96 0 48 0 114 0)
|
|
315 |
#'label:' 'align H'
|
|
316 |
)
|
|
317 |
#(#LabelSpec
|
|
318 |
#'name:' 'label6'
|
|
319 |
#'layout:' #(#LayoutFrame 5 0 122 0 48 0 140 0)
|
|
320 |
#'label:' 'align V'
|
|
321 |
)
|
|
322 |
#(#InputFieldSpec
|
|
323 |
#'name:' 'editField1'
|
|
324 |
#'type:' #numberOrNil
|
|
325 |
#'layout:' #(#LayoutFrame 57 0 42 0 114 0 60 0)
|
|
326 |
#'model:' #leftFraction
|
|
327 |
#acceptOnLostFocus: true
|
|
328 |
#tabable: true
|
|
329 |
)
|
|
330 |
#(#InputFieldSpec
|
|
331 |
#'name:' 'editField2'
|
|
332 |
#'type:' #numberOrNil
|
|
333 |
#'layout:' #(#LayoutFrame 57 0 69 0 114 0 87 0)
|
|
334 |
#'model:' #topFraction
|
|
335 |
#acceptOnLostFocus: true
|
|
336 |
#tabable: true
|
|
337 |
)
|
|
338 |
#(#InputFieldSpec
|
|
339 |
#'name:' 'editField5'
|
|
340 |
#'type:' #numberOrNil
|
|
341 |
#'layout:' #(#LayoutFrame 57 0 96 0 114 0 114 0)
|
|
342 |
#'model:' #leftAlignmentFraction
|
|
343 |
#acceptOnLostFocus: true
|
|
344 |
#tabable: true
|
|
345 |
)
|
|
346 |
#(#InputFieldSpec
|
|
347 |
#'name:' 'editField6'
|
|
348 |
#'type:' #numberOrNil
|
|
349 |
#'layout:' #(#LayoutFrame 56 0 122 0 113 0 140 0)
|
|
350 |
#'model:' #topAlignmentFraction
|
|
351 |
#acceptOnLostFocus: true
|
|
352 |
#tabable: true
|
42
|
353 |
)
|
58
|
354 |
#(#InputFieldSpec
|
|
355 |
#'name:' 'editField3'
|
|
356 |
#'type:' #numberOrNil
|
|
357 |
#'layout:' #(#LayoutFrame 154 0 42 0 212 0 60 0)
|
|
358 |
#'model:' #leftOffset
|
|
359 |
#acceptOnLostFocus: true
|
|
360 |
#tabable: true
|
|
361 |
)
|
|
362 |
#(#InputFieldSpec
|
|
363 |
#'name:' 'editField4'
|
|
364 |
#'type:' #numberOrNil
|
|
365 |
#'layout:' #(#LayoutFrame 154 0 69 0 212 0 87 0)
|
|
366 |
#'model:' #topOffset
|
|
367 |
#acceptOnLostFocus: true
|
|
368 |
#tabable: true
|
|
369 |
)
|
|
370 |
#(#ActionButtonSpec
|
|
371 |
#'name:' 'button1'
|
|
372 |
#'layout:' #(#LayoutFrame 119 0 42 0 138 0 60 0)
|
|
373 |
#'label:' ''
|
|
374 |
#'model:' #makeRelativeLeft
|
|
375 |
)
|
|
376 |
#(#ActionButtonSpec
|
|
377 |
#'name:' 'button2'
|
|
378 |
#'layout:' #(#LayoutFrame 119 0 69 0 138 0 87 0)
|
|
379 |
#'label:' ''
|
|
380 |
#'model:' #makeRelativeTop
|
|
381 |
)
|
|
382 |
#(#ActionButtonSpec
|
|
383 |
#'name:' 'button3'
|
|
384 |
#'layout:' #(#LayoutFrame 216 0 42 0 235 0 60 0)
|
|
385 |
#'label:' ''
|
|
386 |
#'model:' #makeOffsetLeft
|
|
387 |
)
|
|
388 |
#(#ActionButtonSpec
|
|
389 |
#'name:' 'button4'
|
|
390 |
#'layout:' #(#LayoutFrame 216 0 69 0 235 0 87 0)
|
|
391 |
#'label:' ''
|
|
392 |
#'model:' #makeOffsetTop
|
|
393 |
)
|
|
394 |
|
|
395 |
|
|
396 |
#(#ActionButtonSpec
|
|
397 |
#'name:' 'button'
|
|
398 |
#'layout:' #(#LayoutFrame 16 0 210 0 76 0 240 0)
|
|
399 |
#'label:' 'frame'
|
|
400 |
#'model:' #setLayoutFrame
|
|
401 |
)
|
|
402 |
#(#ActionButtonSpec
|
|
403 |
#'name:' 'button'
|
|
404 |
#'layout:' #(#LayoutFrame 96 0 210 0 156 0 240 0)
|
|
405 |
#'label:' 'origin'
|
|
406 |
#'model:' #setLayoutOrigin
|
|
407 |
)
|
|
408 |
#(#ActionButtonSpec
|
|
409 |
#'name:' 'button'
|
|
410 |
#'layout:' #(#LayoutFrame 176 0 210 0 236 0 240 0)
|
|
411 |
#'label:' 'align'
|
|
412 |
#'model:' #setAlignmentOrigin
|
|
413 |
#'initiallyDisabled:' true
|
|
414 |
)
|
|
415 |
#(#ActionButtonSpec
|
|
416 |
#'layout:' #(#LayoutFrame 96 0 260 0 156 0 290 0)
|
|
417 |
#'label:' 'apply'
|
|
418 |
#'model:' #setDimensionForLayoutFrame
|
|
419 |
#tabable: true
|
|
420 |
)
|
|
421 |
|
42
|
422 |
)
|
|
423 |
)
|
|
424 |
)
|
58
|
425 |
|
|
426 |
|
42
|
427 |
!
|
|
428 |
|
|
429 |
geometrySpecForLayoutFrame
|
58
|
430 |
"
|
|
431 |
UIPainter new openOnClass:self andSelector:#geometrySpecForLayoutFrame
|
|
432 |
"
|
42
|
433 |
<resource: #canvas>
|
|
434 |
|
|
435 |
^
|
|
436 |
|
|
437 |
#(#FullSpec
|
58
|
438 |
#'window:'
|
|
439 |
#(#WindowSpec
|
|
440 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
441 |
#'label:' 'unnamed'
|
|
442 |
#'bounds:' #(#Rectangle 0 0 300 300)
|
|
443 |
)
|
42
|
444 |
#'component:'
|
|
445 |
#(#SpecCollection
|
|
446 |
#'collection:'
|
|
447 |
#(
|
58
|
448 |
#(#LabelSpec
|
|
449 |
#'name:' 'label left'
|
|
450 |
#'layout:' #(#LayoutFrame 12 0 39 0 53 0 57 0)
|
|
451 |
#'label:' 'left'
|
|
452 |
)
|
|
453 |
#(#LabelSpec
|
|
454 |
#'name:' 'label top'
|
|
455 |
#'layout:' #(#LayoutFrame 12 0 67 0 53 0 85 0)
|
|
456 |
#'label:' 'top'
|
|
457 |
)
|
|
458 |
#(#LabelSpec
|
|
459 |
#'name:' 'label right'
|
|
460 |
#'layout:' #(#LayoutFrame 12 0 95 0 53 0 113 0)
|
|
461 |
#'label:' 'right'
|
|
462 |
)
|
|
463 |
#(#LabelSpec
|
|
464 |
#'name:' 'label bottom'
|
|
465 |
#'layout:' #(#LayoutFrame 12 0 123 0 53 0 141 0)
|
|
466 |
#'label:' 'bottom'
|
|
467 |
)
|
|
468 |
#(#LabelSpec
|
|
469 |
#'name:' 'label relative'
|
|
470 |
#'layout:' #(#LayoutFrame 65 0 6 0 110 0 24 0)
|
|
471 |
#'label:' 'relative'
|
|
472 |
)
|
|
473 |
#(#LabelSpec
|
|
474 |
#'name:' 'label offset'
|
|
475 |
#'layout:' #(#LayoutFrame 159 0 6 0 190 0 24 0)
|
|
476 |
#'label:' 'offset'
|
|
477 |
)
|
|
478 |
#(#LabelSpec
|
|
479 |
#'name:' 'label all relative'
|
|
480 |
#'layout:' #(#LayoutFrame 12 0 157 0 53 0 175 0)
|
|
481 |
#'label:' 'all'
|
|
482 |
)
|
|
483 |
#(#LabelSpec
|
|
484 |
#'name:' 'label all absolute'
|
|
485 |
#'layout:' #(#LayoutFrame 159 0 157 0 210 0 175 0)
|
|
486 |
#'label:' 'all'
|
|
487 |
)
|
|
488 |
#(#InputFieldSpec
|
|
489 |
#'name:' 'relative E1'
|
|
490 |
#'layout:' #(#LayoutFrame 65 0 39 0 113 0 57 0)
|
|
491 |
#'model:' #leftFraction
|
|
492 |
#'type:' #numberOrNil
|
|
493 |
#'immediateAccept:' false
|
|
494 |
#'acceptOnLeave:' true
|
|
495 |
#'acceptOnReturn:' true
|
|
496 |
#'acceptOnTab:' true
|
|
497 |
#'acceptOnLostFocus:' true
|
|
498 |
)
|
|
499 |
#(#InputFieldSpec
|
|
500 |
#'name:' 'relative E2'
|
|
501 |
#'layout:' #(#LayoutFrame 65 0 67 0 113 0 85 0)
|
|
502 |
#'model:' #topFraction
|
|
503 |
#'type:' #numberOrNil
|
|
504 |
#'immediateAccept:' false
|
|
505 |
#'acceptOnLeave:' true
|
|
506 |
#'acceptOnReturn:' true
|
|
507 |
#'acceptOnTab:' true
|
|
508 |
#'acceptOnLostFocus:' true
|
|
509 |
)
|
|
510 |
#(#InputFieldSpec
|
|
511 |
#'name:' 'relative E3'
|
|
512 |
#'layout:' #(#LayoutFrame 65 0 95 0 113 0 113 0)
|
|
513 |
#'model:' #rightFraction
|
|
514 |
#'type:' #numberOrNil
|
|
515 |
#'immediateAccept:' false
|
|
516 |
#'acceptOnLeave:' true
|
|
517 |
#'acceptOnReturn:' true
|
|
518 |
#'acceptOnTab:' true
|
|
519 |
#'acceptOnLostFocus:' true
|
|
520 |
)
|
|
521 |
#(#InputFieldSpec
|
|
522 |
#'name:' 'relative E4'
|
|
523 |
#'layout:' #(#LayoutFrame 65 0 123 0 113 0 141 0)
|
|
524 |
#'model:' #bottomFraction
|
|
525 |
#'type:' #numberOrNil
|
|
526 |
#'immediateAccept:' false
|
|
527 |
#'acceptOnLeave:' true
|
|
528 |
#'acceptOnReturn:' true
|
|
529 |
#'acceptOnTab:' true
|
|
530 |
#'acceptOnLostFocus:' true
|
|
531 |
)
|
|
532 |
#(#InputFieldSpec
|
|
533 |
#'name:' 'offset E1'
|
|
534 |
#'layout:' #(#LayoutFrame 159 0 39 0 210 0 57 0)
|
|
535 |
#'model:' #leftOffset
|
|
536 |
#'type:' #numberOrNil
|
|
537 |
#'immediateAccept:' false
|
|
538 |
#'acceptOnLeave:' true
|
|
539 |
#'acceptOnReturn:' true
|
|
540 |
#'acceptOnTab:' true
|
|
541 |
#'acceptOnLostFocus:' true
|
|
542 |
)
|
|
543 |
#(#InputFieldSpec
|
|
544 |
#'name:' 'offset E2'
|
|
545 |
#'layout:' #(#LayoutFrame 159 0 67 0 210 0 85 0)
|
|
546 |
#'model:' #topOffset
|
|
547 |
#'type:' #numberOrNil
|
|
548 |
#'immediateAccept:' false
|
|
549 |
#'acceptOnLeave:' true
|
|
550 |
#'acceptOnReturn:' true
|
|
551 |
#'acceptOnTab:' true
|
|
552 |
#'acceptOnLostFocus:' true
|
|
553 |
)
|
|
554 |
#(#InputFieldSpec
|
|
555 |
#'name:' 'offset E3'
|
|
556 |
#'layout:' #(#LayoutFrame 159 0 95 0 210 0 113 0)
|
|
557 |
#'model:' #rightOffset
|
|
558 |
#'type:' #numberOrNil
|
|
559 |
#'immediateAccept:' false
|
|
560 |
#'acceptOnLeave:' true
|
|
561 |
#'acceptOnReturn:' true
|
|
562 |
#'acceptOnTab:' true
|
|
563 |
#'acceptOnLostFocus:' true
|
|
564 |
)
|
|
565 |
#(#InputFieldSpec
|
|
566 |
#'name:' 'offset E4'
|
|
567 |
#'layout:' #(#LayoutFrame 159 0 123 0 210 0 141 0)
|
|
568 |
#'model:' #bottomOffset
|
|
569 |
#'type:' #numberOrNil
|
|
570 |
#'immediateAccept:' false
|
|
571 |
#'acceptOnLeave:' true
|
|
572 |
#'acceptOnReturn:' true
|
|
573 |
#'acceptOnTab:' true
|
|
574 |
#'acceptOnLostFocus:' true
|
|
575 |
)
|
|
576 |
#(#ActionButtonSpec
|
|
577 |
#'name:' 'relative B1'
|
|
578 |
#'layout:' #(#LayoutFrame 117 0 39 0 136 0 57 0)
|
|
579 |
#'label:' ''
|
|
580 |
#'model:' #makeRelativeLeft
|
|
581 |
)
|
|
582 |
#(#ActionButtonSpec
|
|
583 |
#'name:' 'relative B2'
|
|
584 |
#'layout:' #(#LayoutFrame 117 0 67 0 136 0 85 0)
|
|
585 |
#'label:' ''
|
|
586 |
#'model:' #makeRelativeTop
|
|
587 |
)
|
|
588 |
#(#ActionButtonSpec
|
|
589 |
#'name:' 'relative B3'
|
|
590 |
#'layout:' #(#LayoutFrame 117 0 95 0 136 0 113 0)
|
|
591 |
#'label:' ''
|
|
592 |
#'model:' #makeRelativeRight
|
|
593 |
)
|
|
594 |
#(#ActionButtonSpec
|
|
595 |
#'name:' 'relative B4'
|
|
596 |
#'layout:' #(#LayoutFrame 117 0 123 0 136 0 141 0)
|
|
597 |
#'label:' ''
|
|
598 |
#'model:' #makeRelativeBottom
|
|
599 |
)
|
|
600 |
#(#ActionButtonSpec
|
|
601 |
#'name:' 'relative BAll'
|
|
602 |
#'layout:' #(#LayoutFrame 117 0 157 0 136 0 175 0)
|
|
603 |
#'label:' ''
|
|
604 |
#'model:' #makeRelativeAll
|
|
605 |
)
|
|
606 |
#(#ActionButtonSpec
|
|
607 |
#'name:' 'offset B1'
|
|
608 |
#'layout:' #(#LayoutFrame 214 0 39 0 233 0 57 0)
|
|
609 |
#'label:' ''
|
|
610 |
#'model:' #makeOffsetLeft
|
|
611 |
)
|
|
612 |
#(#ActionButtonSpec
|
|
613 |
#'name:' 'offset B2'
|
|
614 |
#'layout:' #(#LayoutFrame 214 0 67 0 233 0 85 0)
|
|
615 |
#'label:' ''
|
|
616 |
#'model:' #makeOffsetTop
|
|
617 |
)
|
|
618 |
#(#ActionButtonSpec
|
|
619 |
#'name:' 'offset B3'
|
|
620 |
#'layout:' #(#LayoutFrame 214 0 95 0 233 0 113 0)
|
|
621 |
#'label:' ''
|
|
622 |
#'model:' #makeOffsetRight
|
|
623 |
)
|
|
624 |
#(#ActionButtonSpec
|
|
625 |
#'name:' 'offset B4'
|
|
626 |
#'layout:' #(#LayoutFrame 214 0 123 0 233 0 141 0)
|
|
627 |
#'label:' ''
|
|
628 |
#'model:' #makeOffsetBottom
|
|
629 |
)
|
|
630 |
#(#ActionButtonSpec
|
|
631 |
#'name:' 'offset BAll'
|
|
632 |
#'layout:' #(#LayoutFrame 214 0 157 0 233 0 175 0)
|
|
633 |
#'label:' ''
|
|
634 |
#'model:' #makeOffsetAll
|
|
635 |
)
|
|
636 |
#(#ActionButtonSpec
|
|
637 |
#'name:' 'button'
|
|
638 |
#'layout:' #(#LayoutFrame 16 0 210 0 76 0 240 0)
|
|
639 |
#'label:' 'frame'
|
|
640 |
#'model:' #setLayoutFrame
|
|
641 |
)
|
|
642 |
#(#ActionButtonSpec
|
|
643 |
#'name:' 'button10'
|
|
644 |
#'layout:' #(#LayoutFrame 96 0 210 0 156 0 240 0)
|
|
645 |
#'label:' 'origin'
|
|
646 |
#'model:' #setLayoutOrigin
|
|
647 |
)
|
|
648 |
#(#ActionButtonSpec
|
|
649 |
#'name:' 'button11'
|
|
650 |
#'layout:' #(#LayoutFrame 176 0 210 0 236 0 240 0)
|
|
651 |
#'label:' 'align'
|
|
652 |
#'model:' #setAlignmentOrigin
|
|
653 |
)
|
|
654 |
#(#ActionButtonSpec
|
|
655 |
#'name:' 'button12'
|
|
656 |
#'layout:' #(#LayoutFrame 96 0 260 0 156 0 290 0)
|
|
657 |
#'label:' 'apply'
|
|
658 |
#'model:' #setDimensionForLayoutFrame
|
42
|
659 |
)
|
|
660 |
)
|
|
661 |
)
|
58
|
662 |
)
|
|
663 |
|
|
664 |
|
|
665 |
!
|
|
666 |
|
|
667 |
geometrySpecForLayoutOrigin
|
|
668 |
"
|
|
669 |
UIPainter new openOnClass:self andSelector:#geometrySpecForLayoutOrigin
|
|
670 |
"
|
|
671 |
<resource: #canvas>
|
|
672 |
|
|
673 |
^
|
|
674 |
|
|
675 |
#(#FullSpec
|
42
|
676 |
#'window:'
|
|
677 |
#(#WindowSpec
|
58
|
678 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
679 |
#'label:' 'unnamed'
|
|
680 |
#'bounds:' #(#Rectangle 0 0 248 304)
|
|
681 |
)
|
|
682 |
#'component:'
|
|
683 |
#(#SpecCollection
|
|
684 |
#'collection:'
|
|
685 |
#(
|
|
686 |
#(#LabelSpec
|
|
687 |
#'name:' 'label1'
|
|
688 |
#'layout:' #(#LayoutFrame 16 0 42 0 44 0 60 0)
|
|
689 |
#'label:' 'left'
|
|
690 |
)
|
|
691 |
#(#LabelSpec
|
|
692 |
#'name:' 'label2'
|
|
693 |
#'layout:' #(#LayoutFrame 16 0 69 0 44 0 87 0)
|
|
694 |
#'label:' 'top'
|
|
695 |
)
|
|
696 |
#(#LabelSpec
|
|
697 |
#'name:' 'label3'
|
|
698 |
#'layout:' #(#LayoutFrame 57 0 10 0 103 0 27 0)
|
|
699 |
#'label:' 'relative'
|
|
700 |
)
|
|
701 |
#(#LabelSpec
|
|
702 |
#'name:' 'label4'
|
|
703 |
#'layout:' #(#LayoutFrame 154 0 11 0 190 0 28 0)
|
|
704 |
#'label:' 'offset'
|
|
705 |
)
|
|
706 |
#(#InputFieldSpec
|
|
707 |
#'name:' 'editField1'
|
|
708 |
#'type:' #numberOrNil
|
|
709 |
#'layout:' #(#LayoutFrame 57 0 42 0 114 0 60 0)
|
|
710 |
#'model:' #leftFraction
|
|
711 |
#acceptOnLostFocus: true
|
|
712 |
#tabable: true
|
|
713 |
)
|
|
714 |
#(#InputFieldSpec
|
|
715 |
#'name:' 'editField2'
|
|
716 |
#'type:' #numberOrNil
|
|
717 |
#'layout:' #(#LayoutFrame 57 0 69 0 114 0 87 0)
|
|
718 |
#'model:' #topFraction
|
|
719 |
#acceptOnLostFocus: true
|
|
720 |
#tabable: true
|
|
721 |
)
|
|
722 |
#(#InputFieldSpec
|
|
723 |
#'name:' 'editField3'
|
|
724 |
#'type:' #numberOrNil
|
|
725 |
#'layout:' #(#LayoutFrame 154 0 42 0 212 0 60 0)
|
|
726 |
#'model:' #leftOffset
|
|
727 |
#acceptOnLostFocus: true
|
|
728 |
#tabable: true
|
|
729 |
)
|
|
730 |
#(#InputFieldSpec
|
|
731 |
#'name:' 'editField4'
|
|
732 |
#'type:' #numberOrNil
|
|
733 |
#'layout:' #(#LayoutFrame 154 0 69 0 212 0 87 0)
|
|
734 |
#'model:' #topOffset
|
|
735 |
#acceptOnLostFocus: true
|
|
736 |
#tabable: true
|
|
737 |
)
|
|
738 |
#(#ActionButtonSpec
|
|
739 |
#'name:' 'button1'
|
|
740 |
#'layout:' #(#LayoutFrame 119 0 42 0 138 0 60 0)
|
|
741 |
#'label:' ''
|
|
742 |
#'model:' #makeRelativeLeft
|
|
743 |
)
|
|
744 |
#(#ActionButtonSpec
|
|
745 |
#'name:' 'button2'
|
|
746 |
#'layout:' #(#LayoutFrame 119 0 69 0 138 0 87 0)
|
|
747 |
#'label:' ''
|
|
748 |
#'model:' #makeRelativeTop
|
|
749 |
)
|
|
750 |
#(#ActionButtonSpec
|
|
751 |
#'name:' 'button3'
|
|
752 |
#'layout:' #(#LayoutFrame 216 0 42 0 235 0 60 0)
|
|
753 |
#'label:' ''
|
|
754 |
#'model:' #makeOffsetLeft
|
|
755 |
)
|
|
756 |
#(#ActionButtonSpec
|
|
757 |
#'name:' 'button4'
|
|
758 |
#'layout:' #(#LayoutFrame 216 0 69 0 235 0 87 0)
|
|
759 |
#'label:' ''
|
|
760 |
#'model:' #makeOffsetTop
|
|
761 |
)
|
|
762 |
|
|
763 |
|
|
764 |
#(#ActionButtonSpec
|
|
765 |
#'name:' 'button'
|
|
766 |
#'layout:' #(#LayoutFrame 16 0 210 0 76 0 240 0)
|
|
767 |
#'label:' 'frame'
|
|
768 |
#'model:' #setLayoutFrame
|
|
769 |
)
|
|
770 |
#(#ActionButtonSpec
|
|
771 |
#'name:' 'button'
|
|
772 |
#'layout:' #(#LayoutFrame 96 0 210 0 156 0 240 0)
|
|
773 |
#'label:' 'origin'
|
|
774 |
#'model:' #setLayoutOrigin
|
|
775 |
#'initiallyDisabled:' true
|
|
776 |
)
|
|
777 |
#(#ActionButtonSpec
|
|
778 |
#'name:' 'button'
|
|
779 |
#'layout:' #(#LayoutFrame 176 0 210 0 236 0 240 0)
|
|
780 |
#'label:' 'align'
|
|
781 |
#'model:' #setAlignmentOrigin
|
|
782 |
)
|
|
783 |
#(#ActionButtonSpec
|
|
784 |
#'layout:' #(#LayoutFrame 96 0 260 0 156 0 290 0)
|
|
785 |
#'label:' 'apply'
|
|
786 |
#'model:' #setDimensionForLayoutFrame
|
|
787 |
#tabable: true
|
|
788 |
)
|
|
789 |
|
|
790 |
)
|
42
|
791 |
)
|
|
792 |
)
|
|
793 |
|
58
|
794 |
|
42
|
795 |
!
|
|
796 |
|
|
797 |
miscSpec
|
|
798 |
"UIBuilder new openOnClass:self andSelector:#miscSpec"
|
|
799 |
"Builder new openInterface:#miscSpec"
|
|
800 |
|
|
801 |
<resource: #canvas>
|
|
802 |
|
|
803 |
^
|
|
804 |
|
|
805 |
#(#FullSpec
|
|
806 |
#'component:'
|
|
807 |
#(#SpecCollection
|
|
808 |
#'collection:'
|
|
809 |
#(
|
|
810 |
#(#FramedBoxSpec
|
|
811 |
#'layout:' #(#LayoutFrame 0 0 -1 0 251 0 289 0)
|
|
812 |
#'component:'
|
|
813 |
#(#SpecCollection
|
|
814 |
#'collection:'
|
|
815 |
#(
|
|
816 |
#(#VerticalPanelViewSpec
|
|
817 |
#'layout:' #(#LayoutFrame 6 0 26 0 61 0 215 0)
|
|
818 |
#'component:'
|
|
819 |
#(#SpecCollection
|
|
820 |
#'collection:'
|
|
821 |
#(
|
|
822 |
#(#LabelSpec
|
|
823 |
#'layout:' #(#LayoutFrame 0 0 47 0 57 0 71 0)
|
|
824 |
#'label:' 'name:'
|
|
825 |
)
|
|
826 |
)
|
|
827 |
)
|
|
828 |
#'horizontalLayout:' #left
|
|
829 |
#'verticalLayout:' #spreadSpace
|
|
830 |
)
|
|
831 |
#(#VerticalPanelViewSpec
|
|
832 |
#'layout:' #(#LayoutFrame 60 0 24 0 230 0 213 0)
|
|
833 |
#'component:'
|
|
834 |
#(#SpecCollection
|
|
835 |
#'collection:'
|
|
836 |
#(
|
|
837 |
#(#InputFieldSpec
|
|
838 |
#model: #nameChannel
|
|
839 |
#'layout:' #(#LayoutFrame 0 0 49 0 163 0 69 0)
|
|
840 |
#acceptOnLostFocus: true
|
|
841 |
#tabable: true
|
|
842 |
)
|
|
843 |
)
|
|
844 |
)
|
|
845 |
#'horizontalLayout:' #fit
|
|
846 |
#'verticalLayout:' #spreadSpace
|
|
847 |
)
|
|
848 |
#(#ActionButtonSpec
|
|
849 |
#'layout:' #(#LayoutFrame 102 0 246 0 153 0 272 0)
|
|
850 |
#'label:' 'apply'
|
|
851 |
#'model:' #setMiscAspects
|
|
852 |
#tabable: true
|
|
853 |
)
|
|
854 |
)
|
|
855 |
)
|
|
856 |
#'labelPosition:' #topLeft
|
|
857 |
#'showFrame:' false
|
|
858 |
)
|
|
859 |
)
|
|
860 |
)
|
|
861 |
#'window:'
|
|
862 |
#(#WindowSpec
|
|
863 |
#'label:' 'unnamed'
|
|
864 |
#'bounds:' #(#Rectangle 0 0 255 292)
|
|
865 |
)
|
|
866 |
)
|
|
867 |
!
|
|
868 |
|
|
869 |
modelSpec
|
|
870 |
"UIBuilder new openOnClass:self andSelector:#modelSpec"
|
|
871 |
"Builder new openInterface:#modelSpec"
|
|
872 |
|
|
873 |
<resource: #canvas>
|
|
874 |
|
|
875 |
^
|
|
876 |
|
|
877 |
#(#FullSpec
|
|
878 |
#'component:'
|
|
879 |
#(#SpecCollection
|
|
880 |
#'collection:'
|
|
881 |
#(
|
|
882 |
#(#FramedBoxSpec
|
|
883 |
#'layout:' #(#LayoutFrame 0 0 -1 0 251 0 289 0)
|
|
884 |
#'component:'
|
|
885 |
#(#SpecCollection
|
|
886 |
#'collection:'
|
|
887 |
#(
|
|
888 |
#(#VerticalPanelViewSpec
|
|
889 |
#'layout:' #(#LayoutFrame 6 0 26 0 78 0 216 0)
|
|
890 |
#'component:'
|
|
891 |
#(#SpecCollection
|
|
892 |
#'collection:'
|
|
893 |
#(
|
|
894 |
#(#LabelSpec
|
|
895 |
#'name:' 'label'
|
|
896 |
#'layout:' #(#LayoutFrame 0 0 47 0 57 0 71 0)
|
|
897 |
#'label:' 'aspect:'
|
|
898 |
)
|
|
899 |
#(#LabelSpec
|
|
900 |
#'name:' 'label'
|
|
901 |
#'layout:' #(#LayoutFrame 0 0 119 0 62 0 143 0)
|
|
902 |
#'label:' 'change:'
|
|
903 |
)
|
|
904 |
)
|
|
905 |
)
|
|
906 |
#'horizontalLayout:' #left
|
|
907 |
#'verticalLayout:' #spreadSpace
|
|
908 |
)
|
|
909 |
#(#VerticalPanelViewSpec
|
|
910 |
#'layout:' #(#LayoutFrame 80 0 24 0 231 0 214 0)
|
|
911 |
#'component:'
|
|
912 |
#(#SpecCollection
|
|
913 |
#'collection:'
|
|
914 |
#(
|
|
915 |
#(#InputFieldSpec
|
|
916 |
#'name:' 'aspectInput'
|
|
917 |
#'layout:' #(#LayoutFrame 0 0 49 0 163 0 69 0)
|
|
918 |
#model: #aspectChannel
|
|
919 |
#acceptOnLostFocus: true
|
|
920 |
#tabable: true
|
|
921 |
)
|
|
922 |
#(#InputFieldSpec
|
|
923 |
#'name:' 'changeInput'
|
|
924 |
#'layout:' #(#LayoutFrame 0 0 119 0 163 0 142 0)
|
|
925 |
#model: #changeChannel
|
|
926 |
#acceptOnLostFocus: true
|
|
927 |
#tabable: true
|
|
928 |
)
|
|
929 |
)
|
|
930 |
)
|
|
931 |
#'horizontalLayout:' #fit
|
|
932 |
#'verticalLayout:' #spreadSpace
|
|
933 |
)
|
|
934 |
#(#ActionButtonSpec
|
|
935 |
#'name:' 'button'
|
|
936 |
#'layout:' #(#LayoutFrame 102 0 246 0 153 0 272 0)
|
|
937 |
#'label:' 'apply'
|
|
938 |
#'model:' #setModelAspects
|
|
939 |
)
|
|
940 |
)
|
|
941 |
)
|
|
942 |
#'labelPosition:' #topLeft
|
|
943 |
#'showFrame:' false
|
|
944 |
)
|
|
945 |
)
|
|
946 |
)
|
|
947 |
#'window:'
|
|
948 |
#(#WindowSpec
|
|
949 |
#'label:' 'unnamed'
|
|
950 |
#'bounds:' #(#Rectangle 0 0 255 292)
|
|
951 |
)
|
|
952 |
)
|
50
|
953 |
!
|
|
954 |
|
|
955 |
nameAndSelectorSpec
|
|
956 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
957 |
|
|
958 |
"do not manually edit this - the painter/builder may not be able to
|
|
959 |
handle the specification if its corrupted."
|
|
960 |
|
58
|
961 |
"UIPainter new openOnClass:self andSelector:#nameAndSelectorSpec"
|
50
|
962 |
|
|
963 |
<resource: #canvas>
|
|
964 |
|
|
965 |
^
|
|
966 |
|
|
967 |
#(#FullSpec
|
|
968 |
#'window:'
|
|
969 |
#(#WindowSpec
|
|
970 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
971 |
#'label:' 'unnamed'
|
|
972 |
#'bounds:' #(#Rectangle 0 0 300 300)
|
|
973 |
)
|
|
974 |
#'component:'
|
|
975 |
#(#SpecCollection
|
|
976 |
#'collection:'
|
|
977 |
#(
|
|
978 |
#(#LabelSpec
|
|
979 |
#'name:' 'label1'
|
|
980 |
#'layout:' #(#LayoutFrame 10 0 50 0 110 0 70 0)
|
|
981 |
#'label:' 'class:'
|
|
982 |
#'adjust:' #right
|
|
983 |
)
|
|
984 |
#(#LabelSpec
|
|
985 |
#'name:' 'label2'
|
|
986 |
#'layout:' #(#LayoutFrame 10 0 90 0 110 0 110 0)
|
|
987 |
#'label:' 'superclass:'
|
|
988 |
#'adjust:' #right
|
|
989 |
)
|
|
990 |
#(#LabelSpec
|
|
991 |
#'name:' 'label3'
|
|
992 |
#'layout:' #(#LayoutFrame 10 0 130 0 110 0 150 0)
|
|
993 |
#'label:' 'selector:'
|
|
994 |
#'adjust:' #right
|
|
995 |
)
|
|
996 |
#(#InputFieldSpec
|
|
997 |
#'name:' 'classNameField'
|
|
998 |
#'layout:' #(#LayoutFrame 120 0 50 0 289 0 69 0)
|
|
999 |
#'model:' #classNameChannel
|
|
1000 |
#'immediateAccept:' false
|
|
1001 |
#'acceptOnLeave:' true
|
|
1002 |
#'acceptOnReturn:' true
|
|
1003 |
#'acceptOnTab:' true
|
|
1004 |
)
|
|
1005 |
#(#InputFieldSpec
|
|
1006 |
#'name:' 'superclassNameField'
|
|
1007 |
#'layout:' #(#LayoutFrame 120 0 90 0 289 0 109 0)
|
|
1008 |
#'model:' #superclassNameChannel
|
|
1009 |
#'immediateAccept:' false
|
|
1010 |
#'acceptOnLeave:' true
|
|
1011 |
#'acceptOnReturn:' true
|
|
1012 |
#'acceptOnTab:' true
|
|
1013 |
)
|
|
1014 |
#(#InputFieldSpec
|
|
1015 |
#'name:' 'methodNameField'
|
|
1016 |
#'layout:' #(#LayoutFrame 120 0 130 0 289 0 149 0)
|
|
1017 |
#'model:' #methodNameChannel
|
|
1018 |
#'immediateAccept:' false
|
|
1019 |
#'acceptOnLeave:' true
|
|
1020 |
#'acceptOnReturn:' true
|
|
1021 |
#'acceptOnTab:' true
|
|
1022 |
)
|
|
1023 |
#(#ActionButtonSpec
|
|
1024 |
#'name:' 'button1'
|
|
1025 |
#'layout:' #(#LayoutFrame 30 0 250 0 129 0 279 0)
|
|
1026 |
#'label:' 'cancel'
|
55
|
1027 |
#'model:' #cancel
|
50
|
1028 |
)
|
|
1029 |
#(#ActionButtonSpec
|
|
1030 |
#'name:' 'button2'
|
|
1031 |
#'layout:' #(#LayoutFrame 160 0 250 0 259 0 279 0)
|
|
1032 |
#'label:' 'ok'
|
55
|
1033 |
#'model:' #accept
|
50
|
1034 |
)
|
|
1035 |
)
|
|
1036 |
)
|
|
1037 |
)
|
|
1038 |
|
|
1039 |
|
|
1040 |
|
54
|
1041 |
!
|
|
1042 |
|
|
1043 |
propertyFrameSpec
|
|
1044 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
1045 |
|
|
1046 |
"do not manually edit this - the painter/builder may not be able to
|
|
1047 |
handle the specification if its corrupted."
|
|
1048 |
|
|
1049 |
"UIPainter new openOnClass:UIPainter andSelector:#propertyFrameSpec"
|
|
1050 |
"UIPainter new openInterface:#propertyFrameSpec"
|
|
1051 |
|
|
1052 |
<resource: #canvas>
|
|
1053 |
|
|
1054 |
^
|
|
1055 |
|
|
1056 |
#(#FullSpec
|
|
1057 |
#'window:'
|
|
1058 |
#(#WindowSpec
|
|
1059 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
1060 |
#'label:' 'unnamed'
|
|
1061 |
#'bounds:' #(#Rectangle 0 0 309 326)
|
|
1062 |
)
|
|
1063 |
#'component:'
|
|
1064 |
#(#SpecCollection
|
|
1065 |
#'collection:'
|
|
1066 |
#(
|
|
1067 |
#(#ArbitraryComponentSpec
|
|
1068 |
#'name:' 'view1'
|
|
1069 |
#'layout:' #(#LayoutFrame 0 0 0 0 0 1.0 -40 1.0)
|
|
1070 |
)
|
|
1071 |
#(#ActionButtonSpec
|
|
1072 |
#'name:' 'button1'
|
|
1073 |
#'layout:' #(#LayoutFrame 108 0 291 0 200 0 323 0)
|
|
1074 |
#'label:' 'apply'
|
|
1075 |
)
|
|
1076 |
)
|
|
1077 |
)
|
|
1078 |
)
|
42
|
1079 |
! !
|
|
1080 |
|
|
1081 |
!UIPainter methodsFor:'BuilderView interface'!
|
|
1082 |
|
54
|
1083 |
update:something
|
42
|
1084 |
|singleSelection|
|
|
1085 |
|
|
1086 |
elementMenu deselect.
|
|
1087 |
|
|
1088 |
singleSelection := workView singleSelection.
|
|
1089 |
|
58
|
1090 |
something == #selection ifTrue:[
|
|
1091 |
claus setupView:singleSelection.
|
|
1092 |
].
|
|
1093 |
|
42
|
1094 |
(something == #layout or:[something == #any]) ifTrue:[
|
|
1095 |
singleSelection notNil ifTrue:[
|
|
1096 |
self fetchLayoutFrom:singleSelection
|
|
1097 |
].
|
|
1098 |
^ self
|
|
1099 |
].
|
|
1100 |
|
|
1101 |
(something == #aspects or:[something == #any]) ifTrue:[
|
|
1102 |
singleSelection notNil ifTrue:[
|
|
1103 |
self fetchModelAspectsFrom:singleSelection
|
|
1104 |
].
|
|
1105 |
^ self
|
|
1106 |
].
|
|
1107 |
|
|
1108 |
(something == #selection or:[something == #any]) ifTrue:[
|
|
1109 |
self showPropertyView.
|
|
1110 |
self showOutletsFor:(workView selection).
|
|
1111 |
|
|
1112 |
singleSelection isNil ifFalse:[
|
|
1113 |
nameChannel isNil ifTrue:[self nameChannel].
|
|
1114 |
nameChannel value:singleSelection name.
|
|
1115 |
|
|
1116 |
self fetchLayoutFrom:singleSelection.
|
55
|
1117 |
self fetchColorsFrom:singleSelection.
|
42
|
1118 |
self fetchModelAspectsFrom:singleSelection.
|
|
1119 |
].
|
|
1120 |
^ self
|
|
1121 |
].
|
|
1122 |
! !
|
|
1123 |
|
|
1124 |
!UIPainter methodsFor:'aspects'!
|
|
1125 |
|
50
|
1126 |
aspectFor:aKey
|
58
|
1127 |
^ specSpecificAspectHolders at:aKey ifAbsent:[
|
|
1128 |
aspectHolders at:aKey ifAbsent:[
|
|
1129 |
super aspectFor:aKey
|
|
1130 |
]
|
|
1131 |
]
|
42
|
1132 |
|
|
1133 |
!
|
|
1134 |
|
|
1135 |
nameChannel
|
|
1136 |
nameChannel isNil ifTrue:[
|
|
1137 |
nameChannel := '' asValue.
|
|
1138 |
].
|
|
1139 |
^ nameChannel
|
|
1140 |
|
|
1141 |
"Modified: 6.9.1995 / 00:38:00 / claus"
|
|
1142 |
! !
|
|
1143 |
|
|
1144 |
!UIPainter methodsFor:'filein & fileout'!
|
|
1145 |
|
|
1146 |
openFile:aFileName
|
|
1147 |
|aStream |
|
|
1148 |
|
|
1149 |
aStream := FileStream readonlyFileNamed:aFileName.
|
|
1150 |
aStream notNil ifTrue:[
|
|
1151 |
workView fileInContentsFrom:aStream.
|
|
1152 |
aStream close.
|
|
1153 |
currentFileName := aFileName
|
|
1154 |
]
|
|
1155 |
|
|
1156 |
!
|
|
1157 |
|
|
1158 |
saveAs:aFileName
|
|
1159 |
|aStream|
|
|
1160 |
|
|
1161 |
aStream := FileStream newFileNamed:aFileName.
|
|
1162 |
aStream notNil ifTrue:[
|
|
1163 |
workView storeContentsOn:aStream.
|
|
1164 |
aStream close
|
|
1165 |
].
|
|
1166 |
currentFileName := aFileName
|
|
1167 |
|
|
1168 |
! !
|
|
1169 |
|
|
1170 |
!UIPainter methodsFor:'help'!
|
|
1171 |
|
|
1172 |
helpTextFor:aComponent
|
|
1173 |
|sel|
|
|
1174 |
|
|
1175 |
(aComponent isKindOf:Button) ifTrue:[
|
|
1176 |
(sel := aComponent changeMessage) notNil ifTrue:[
|
|
1177 |
"/ take the buttons change symbol as resource-key
|
|
1178 |
^ resources string:(sel asString)
|
|
1179 |
]
|
|
1180 |
].
|
|
1181 |
^ nil
|
|
1182 |
|
|
1183 |
"Modified: 31.8.1995 / 20:49:58 / claus"
|
|
1184 |
! !
|
|
1185 |
|
|
1186 |
!UIPainter methodsFor:'initialization'!
|
|
1187 |
|
|
1188 |
createCanvas
|
|
1189 |
|topView|
|
|
1190 |
|
|
1191 |
super initialize.
|
|
1192 |
|
|
1193 |
topView := StandardSystemView new.
|
|
1194 |
topView label:'unnamed'.
|
|
1195 |
topView extent:300@300.
|
55
|
1196 |
topView application:self.
|
42
|
1197 |
|
|
1198 |
workView := UIPainterView in:topView.
|
|
1199 |
workView layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
|
|
1200 |
|
|
1201 |
^ workView.
|
|
1202 |
|
|
1203 |
"Builder new createCanvas open"
|
|
1204 |
!
|
|
1205 |
|
|
1206 |
createPaletteIn:aViewOrNil
|
|
1207 |
|topView v|
|
|
1208 |
|
|
1209 |
aViewOrNil isNil ifTrue:[
|
|
1210 |
topView := StandardSystemView new.
|
|
1211 |
topView label:'element palette'.
|
|
1212 |
topView extent:200@400.
|
|
1213 |
] ifFalse:[
|
|
1214 |
topView := aViewOrNil
|
|
1215 |
].
|
|
1216 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:topView.
|
|
1217 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
|
|
1218 |
elementMenu := v scrolledView.
|
|
1219 |
|
|
1220 |
^ elementMenu.
|
|
1221 |
|
|
1222 |
"(Builder new createPaletteIn:nil) topView open"
|
|
1223 |
|
|
1224 |
"Modified: 5.9.1995 / 23:52:57 / claus"
|
|
1225 |
!
|
|
1226 |
|
|
1227 |
initChannels
|
58
|
1228 |
|cls|
|
|
1229 |
|
|
1230 |
specSpecificAspectHolders := IdentityDictionary new.
|
50
|
1231 |
aspectHolders := IdentityDictionary new.
|
|
1232 |
|
58
|
1233 |
aspectHolders at:#classNameChannel put:(
|
|
1234 |
(specClass notNil ifTrue:[specClass]
|
|
1235 |
ifFalse:['NewApplication']) asValue
|
|
1236 |
).
|
|
1237 |
specSuperclass isNil ifTrue:[
|
|
1238 |
specClass notNil ifTrue:[
|
|
1239 |
(cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[
|
|
1240 |
specSuperclass := cls superclass name.
|
|
1241 |
]
|
|
1242 |
]
|
|
1243 |
].
|
|
1244 |
aspectHolders at:#superclassNameChannel put:(
|
|
1245 |
(specSuperclass notNil ifTrue:[specSuperclass]
|
|
1246 |
ifFalse:['ApplicationModel']) asValue
|
|
1247 |
).
|
|
1248 |
aspectHolders at:#methodNameChannel put:(
|
|
1249 |
(specSelector notNil ifTrue:[specSelector]
|
|
1250 |
ifFalse:[#windowSpec]) asValue
|
|
1251 |
).
|
50
|
1252 |
|
|
1253 |
aspectHolders at:#aspectChannel put:(ValueHolder new).
|
|
1254 |
aspectHolders at:#changeChannel put:(ValueHolder new).
|
|
1255 |
|
58
|
1256 |
aspectHolders at:#foregroundColor put:(ValueHolder new).
|
|
1257 |
aspectHolders at:#backgroundColor put:(ValueHolder new).
|
|
1258 |
|
|
1259 |
#( bottomFraction leftFraction topFraction rightFraction leftAlignmentFraction
|
|
1260 |
bottomOffset leftOffset topOffset rightOffset topAlignmentFraction
|
|
1261 |
)
|
|
1262 |
do:[:aChannel| aspectHolders at:aChannel put:(ValueHolder new) ].
|
42
|
1263 |
!
|
|
1264 |
|
|
1265 |
initPullDownMenu
|
|
1266 |
menu labels:(resources array:#(
|
|
1267 |
'file'
|
|
1268 |
'font'
|
|
1269 |
'type'
|
|
1270 |
'align'
|
|
1271 |
'dimension'
|
|
1272 |
'special'
|
|
1273 |
'code'
|
|
1274 |
'test'
|
|
1275 |
)).
|
|
1276 |
|
|
1277 |
menu selectors:#(#file
|
|
1278 |
#font
|
|
1279 |
#type
|
|
1280 |
#align
|
|
1281 |
#dimension
|
|
1282 |
#special
|
|
1283 |
#code
|
|
1284 |
#test
|
|
1285 |
).
|
|
1286 |
|
|
1287 |
menu at:#file
|
|
1288 |
putLabels:(resources array:
|
|
1289 |
#('new'
|
55
|
1290 |
'from class ...'
|
42
|
1291 |
'pick a view '
|
|
1292 |
'-'
|
|
1293 |
'save'
|
|
1294 |
'save as ...'
|
|
1295 |
'-'
|
55
|
1296 |
'install'
|
42
|
1297 |
'-'
|
55
|
1298 |
"/ 'source'
|
42
|
1299 |
'windowSpec'
|
|
1300 |
'inspect me'
|
|
1301 |
'-'
|
|
1302 |
'print'
|
|
1303 |
'-'
|
|
1304 |
'quit'
|
|
1305 |
))
|
|
1306 |
selectors:#(doNew
|
|
1307 |
doFromClass
|
|
1308 |
doPickAView
|
|
1309 |
nil
|
|
1310 |
doSave
|
|
1311 |
doSaveAs
|
|
1312 |
nil
|
55
|
1313 |
doInstall
|
42
|
1314 |
nil
|
55
|
1315 |
"/ doSource
|
42
|
1316 |
doWindowSpec
|
|
1317 |
inspect
|
|
1318 |
nil
|
|
1319 |
doPrint
|
|
1320 |
nil
|
|
1321 |
doFinish
|
|
1322 |
)
|
|
1323 |
receiver:self.
|
|
1324 |
|
58
|
1325 |
menu at:#font putMenu:(workView subMenuFont menuView).
|
42
|
1326 |
|
|
1327 |
menu at:#type
|
|
1328 |
putLabels:(resources array:#(
|
|
1329 |
'basic widgets'
|
|
1330 |
'layout'
|
|
1331 |
'text'
|
|
1332 |
'interactors'
|
|
1333 |
'modal'
|
|
1334 |
'other'
|
|
1335 |
'-'
|
|
1336 |
'all'
|
|
1337 |
) )
|
|
1338 |
selectors:#(showBasicWidgets
|
|
1339 |
showLayoutWidgets
|
|
1340 |
showTextWidgets
|
|
1341 |
showInteractorWidgets
|
|
1342 |
showModalWidgets
|
|
1343 |
showOtherWidgets
|
|
1344 |
nil
|
|
1345 |
showAllWidgets
|
|
1346 |
)
|
|
1347 |
receiver:self.
|
|
1348 |
|
54
|
1349 |
menu at:#align putMenu:(workView subMenuAlign menuView).
|
|
1350 |
menu at:#dimension putMenu:(workView subMenuDimension menuView).
|
42
|
1351 |
|
|
1352 |
menu at:#special
|
|
1353 |
putLabels:(resources array:#(
|
|
1354 |
'group radioButtons'
|
58
|
1355 |
'group enterFields'
|
|
1356 |
'-'
|
|
1357 |
'delete undo history'
|
42
|
1358 |
) )
|
|
1359 |
selectors:#(
|
|
1360 |
groupRadioButtons
|
|
1361 |
groupEnterFields
|
58
|
1362 |
nil
|
|
1363 |
undoDeleteAll
|
42
|
1364 |
)
|
|
1365 |
receiver:workView.
|
|
1366 |
|
|
1367 |
menu at:#code
|
|
1368 |
putLabels:(resources array:#(
|
50
|
1369 |
'class & method'
|
42
|
1370 |
) )
|
|
1371 |
selectors:#(
|
50
|
1372 |
defineClassAndSelector
|
42
|
1373 |
)
|
|
1374 |
receiver:self.
|
|
1375 |
|
|
1376 |
menu at:#test
|
|
1377 |
putLabels:(resources array:#(
|
|
1378 |
'test on'
|
|
1379 |
) )
|
|
1380 |
selectors:#(toggleTest
|
|
1381 |
)
|
|
1382 |
receiver:self.
|
|
1383 |
!
|
|
1384 |
|
|
1385 |
openInterface
|
58
|
1386 |
|list v topInset menuInset leftPanel middlePanel rightPanel buttonPanel propSelector|
|
42
|
1387 |
|
|
1388 |
super initialize.
|
|
1389 |
|
|
1390 |
self initChannels.
|
|
1391 |
|
|
1392 |
whichProperty := SelectionInList new.
|
58
|
1393 |
"/ whichProperty list:#('dimension' 'colors' 'model' 'misc' 'attribute list').
|
|
1394 |
whichProperty list:(UISpecification slices collect:[:slice | slice first asString]).
|
|
1395 |
whichProperty onChangeSend:#showPropertyView to:self.
|
42
|
1396 |
|
|
1397 |
workView :=self createCanvas.
|
|
1398 |
|
|
1399 |
topView := StandardSystemView new.
|
|
1400 |
topView label:'Interface Builder'.
|
|
1401 |
topView icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100).
|
|
1402 |
topView extent:(600 @ 400).
|
|
1403 |
|
58
|
1404 |
menu := PullDownMenu in:topView.
|
|
1405 |
buttonPanel := ButtonPanel in:topView.
|
|
1406 |
|
|
1407 |
menuInset := menu preferredExtent y.
|
|
1408 |
topInset := menuInset + buttonPanel preferredExtent y.
|
|
1409 |
|
|
1410 |
buttonPanel origin:0.0@menuInset corner:1.0@topInset.
|
|
1411 |
buttonPanel receiver:workView.
|
|
1412 |
leftPanel := View origin:(0.0 @ 0.0) corner:0.3@1.0 in:topView.
|
|
1413 |
leftPanel topInset:topInset.
|
|
1414 |
middlePanel := View origin:(0.3 @ 0.0) corner:0.6@1.0 in:topView.
|
|
1415 |
middlePanel topInset:topInset.
|
|
1416 |
rightPanel := View origin:(0.6 @ 0.0) corner:1.0@1.0 in:topView.
|
|
1417 |
rightPanel topInset:topInset.
|
42
|
1418 |
|
46
|
1419 |
v := HVScrollableView for:UIPainterTreeView miniScrollerH:true in:middlePanel.
|
42
|
1420 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
|
|
1421 |
treeView := v scrolledView.
|
|
1422 |
|
|
1423 |
propSelector := PopUpList label:'properties' in:rightPanel.
|
|
1424 |
propSelector origin:(0.0 @ 0.0) corner:1.0@(propSelector preferredExtent y).
|
|
1425 |
propSelector horizontalInset:View viewSpacing.
|
|
1426 |
propSelector model:whichProperty.
|
|
1427 |
|
|
1428 |
propertyFrame := View in:rightPanel.
|
|
1429 |
propertyFrame origin:(0.0 @ 0.0) corner:1.0@1.0.
|
|
1430 |
propertyFrame topInset:propSelector height + View viewSpacing.
|
|
1431 |
|
58
|
1432 |
claus := View origin:(0.0 @ 0.0) corner:1.0@1.0 in:rightPanel.
|
|
1433 |
claus := UIPropertyView in:claus receiver:workView.
|
42
|
1434 |
|
|
1435 |
elementMenu := self createPaletteIn:leftPanel.
|
|
1436 |
|
|
1437 |
treeView builderView:workView. "link workview with treeview"
|
|
1438 |
|
|
1439 |
workView addDependent:treeView.
|
|
1440 |
workView addDependent:self.
|
|
1441 |
|
|
1442 |
self initPullDownMenu.
|
|
1443 |
|
|
1444 |
elementMenu action:[:selection |
|
|
1445 |
workView testMode ifTrue:[
|
|
1446 |
elementMenu deselect
|
|
1447 |
] ifFalse:[
|
|
1448 |
selection notNil ifTrue:[
|
|
1449 |
workView createWidgetWithClass:
|
|
1450 |
(Smalltalk at:(elementMenu selectionValue asSymbol))
|
|
1451 |
]
|
|
1452 |
]
|
|
1453 |
].
|
|
1454 |
topView application:self.
|
|
1455 |
builder window:topView.
|
|
1456 |
|
|
1457 |
topView beMaster.
|
|
1458 |
workView topView beSlave.
|
|
1459 |
|
|
1460 |
"/ can be created as embedded or side-menu
|
|
1461 |
elementMenu topView ~~ topView ifTrue:[
|
|
1462 |
elementMenu topView beSlave.
|
|
1463 |
].
|
|
1464 |
|
|
1465 |
topView open.
|
|
1466 |
workView topView openInGroup:(topView windowGroup).
|
|
1467 |
elementMenu topView ~~ topView ifTrue:[
|
|
1468 |
elementMenu topView openInGroup:(topView windowGroup).
|
|
1469 |
]
|
|
1470 |
|
|
1471 |
"
|
|
1472 |
Builder open
|
|
1473 |
"
|
|
1474 |
|
|
1475 |
"Modified: 6.9.1995 / 00:26:59 / claus"
|
|
1476 |
!
|
|
1477 |
|
|
1478 |
openNewWindowCanvas
|
|
1479 |
self open.
|
|
1480 |
|
|
1481 |
|
|
1482 |
!
|
|
1483 |
|
|
1484 |
openOnClass:aClass andSelector:aSelector
|
|
1485 |
"open up an interface builder, fetching a spec from someClass
|
|
1486 |
via some selector"
|
|
1487 |
|
|
1488 |
|specArray|
|
|
1489 |
|
58
|
1490 |
specClass := aClass name.
|
|
1491 |
specSuperclass := aClass superclass name.
|
42
|
1492 |
specSelector := aSelector.
|
50
|
1493 |
|
42
|
1494 |
self openInterface.
|
|
1495 |
workView className:aClass name.
|
|
1496 |
workView methodName:aSelector.
|
|
1497 |
workView setupFromSpec:(aClass perform:aSelector).
|
|
1498 |
!
|
|
1499 |
|
|
1500 |
openOnSpec:aSpecOrSpecArray
|
|
1501 |
"open up an interface builder, given some specArray"
|
|
1502 |
|
|
1503 |
|newBuilder|
|
|
1504 |
|
|
1505 |
newBuilder := self new.
|
58
|
1506 |
! !
|
|
1507 |
|
|
1508 |
!UIPainter methodsFor:'make layout'!
|
|
1509 |
|
|
1510 |
makeLayout:what xOrY:xOrY offset:aBool
|
|
1511 |
|view layout extent fraction offset fractSymb offsetSymb|
|
|
1512 |
|
|
1513 |
view := workView singleSelection.
|
|
1514 |
|
|
1515 |
view isNil ifTrue:[
|
|
1516 |
^ self
|
|
1517 |
].
|
|
1518 |
layout := view geometryLayout.
|
|
1519 |
|
|
1520 |
layout isLayout ifFalse:[
|
|
1521 |
^ self
|
|
1522 |
].
|
|
1523 |
fractSymb := (what, 'Fraction') asSymbol.
|
|
1524 |
offsetSymb := (what, 'Offset') asSymbol.
|
|
1525 |
|
|
1526 |
( (layout respondsTo:fractSymb)
|
|
1527 |
and:[layout respondsTo:offsetSymb]
|
|
1528 |
) ifTrue:[
|
|
1529 |
|
|
1530 |
fraction := layout perform:fractSymb.
|
|
1531 |
offset := layout perform:offsetSymb.
|
|
1532 |
extent := (view superView computeExtent) perform:xOrY.
|
|
1533 |
|
|
1534 |
aBool ifTrue:[
|
|
1535 |
offset := offset + ((fraction * extent) asInteger).
|
|
1536 |
(aspectHolders at:offsetSymb) value:offset.
|
|
1537 |
(aspectHolders at:fractSymb) value:0.
|
|
1538 |
] ifFalse:[
|
|
1539 |
fraction := (fraction + (offset / extent)) asFloat.
|
|
1540 |
|
|
1541 |
(fraction > 1.0) ifTrue:[ fraction := 1.0 ].
|
|
1542 |
(fraction < 0.0) ifTrue:[ fraction := 0.0 ].
|
|
1543 |
|
|
1544 |
(aspectHolders at:offsetSymb) value:0.
|
|
1545 |
(aspectHolders at:fractSymb) value:fraction.
|
|
1546 |
]
|
|
1547 |
]
|
42
|
1548 |
!
|
|
1549 |
|
58
|
1550 |
makeOffsetAll
|
|
1551 |
self makeOffsetLeft.
|
|
1552 |
self makeOffsetTop.
|
|
1553 |
self makeOffsetRight.
|
|
1554 |
self makeOffsetBottom.
|
|
1555 |
|
|
1556 |
!
|
|
1557 |
|
|
1558 |
makeOffsetBottom
|
|
1559 |
self makeLayout:'bottom' xOrY:#y offset:true.
|
|
1560 |
|
|
1561 |
!
|
|
1562 |
|
|
1563 |
makeOffsetLeft
|
|
1564 |
self makeLayout:'left' xOrY:#x offset:true.
|
|
1565 |
|
|
1566 |
!
|
|
1567 |
|
|
1568 |
makeOffsetRight
|
|
1569 |
self makeLayout:'right' xOrY:#x offset:true.
|
|
1570 |
|
|
1571 |
!
|
|
1572 |
|
|
1573 |
makeOffsetTop
|
|
1574 |
self makeLayout:'top' xOrY:#y offset:true.
|
|
1575 |
|
|
1576 |
|
|
1577 |
!
|
|
1578 |
|
|
1579 |
makeRelativeAll
|
|
1580 |
self makeRelativeLeft.
|
|
1581 |
self makeRelativeTop.
|
|
1582 |
self makeRelativeRight.
|
|
1583 |
self makeRelativeBottom.
|
|
1584 |
|
|
1585 |
!
|
|
1586 |
|
|
1587 |
makeRelativeBottom
|
|
1588 |
self makeLayout:'bottom' xOrY:#y offset:false.
|
|
1589 |
|
|
1590 |
!
|
|
1591 |
|
|
1592 |
makeRelativeLeft
|
|
1593 |
self makeLayout:'left' xOrY:#x offset:false.
|
|
1594 |
|
|
1595 |
!
|
|
1596 |
|
|
1597 |
makeRelativeRight
|
|
1598 |
self makeLayout:'right' xOrY:#x offset:false.
|
|
1599 |
|
|
1600 |
!
|
|
1601 |
|
|
1602 |
makeRelativeTop
|
|
1603 |
self makeLayout:'top' xOrY:#y offset:false.
|
|
1604 |
|
42
|
1605 |
! !
|
|
1606 |
|
|
1607 |
!UIPainter methodsFor:'misc'!
|
|
1608 |
|
|
1609 |
listOfOutletsFor:aViewClass
|
|
1610 |
"return a list of outlets for a view-class"
|
|
1611 |
|
|
1612 |
|l1 l2 all rej|
|
|
1613 |
|
|
1614 |
(aViewClass == Object) ifTrue:[^ nil].
|
|
1615 |
|
|
1616 |
l1 := self listOfOutletsFor:(aViewClass superclass).
|
|
1617 |
l2 := self listOfOutletsForClass:aViewClass.
|
|
1618 |
|
|
1619 |
l2 isNil ifTrue:[
|
|
1620 |
all := l1
|
|
1621 |
] ifFalse:[
|
|
1622 |
l1 isNil ifTrue:[
|
|
1623 |
all := l2
|
|
1624 |
] ifFalse:[
|
|
1625 |
all := l1 , l2
|
|
1626 |
]
|
|
1627 |
].
|
|
1628 |
rej := self rejectOutletsForClass:aViewClass.
|
|
1629 |
rej notNil ifTrue:[
|
|
1630 |
rej do:[:x |
|
|
1631 |
all := all copyWithout:x
|
|
1632 |
]
|
|
1633 |
].
|
|
1634 |
^ all
|
|
1635 |
!
|
|
1636 |
|
|
1637 |
listOfOutletsForClass:aViewClass
|
|
1638 |
"return a list of outlets for a view-class"
|
|
1639 |
|
|
1640 |
"could this be done automatically ?"
|
|
1641 |
|
|
1642 |
(aViewClass == Label) ifTrue:[
|
|
1643 |
^ #('label'
|
|
1644 |
'iconic-label'
|
|
1645 |
'label layout'
|
|
1646 |
'fixed size'
|
|
1647 |
'foreground-color'
|
|
1648 |
'background-color'
|
|
1649 |
)
|
|
1650 |
].
|
|
1651 |
(aViewClass == Button) ifTrue:[
|
|
1652 |
^ #(
|
|
1653 |
'active foreground-color'
|
|
1654 |
'active background-color'
|
|
1655 |
'active level'
|
|
1656 |
'passive level'
|
|
1657 |
'press action'
|
|
1658 |
)
|
|
1659 |
].
|
|
1660 |
(aViewClass == Toggle) ifTrue:[
|
|
1661 |
^ #(
|
|
1662 |
'release action'
|
|
1663 |
)
|
|
1664 |
].
|
|
1665 |
(aViewClass == CheckBox) ifTrue:[
|
|
1666 |
^ #(
|
|
1667 |
'label'
|
|
1668 |
)
|
|
1669 |
].
|
|
1670 |
(aViewClass == FramedBox) ifTrue:[
|
|
1671 |
^ #(
|
|
1672 |
'label'
|
|
1673 |
'label position'
|
|
1674 |
'frame shown'
|
|
1675 |
)
|
|
1676 |
].
|
|
1677 |
(aViewClass == VerticalPanelView) ifTrue:[
|
|
1678 |
^ #(
|
|
1679 |
'horizontal layout'
|
|
1680 |
'vertical layout'
|
|
1681 |
)
|
|
1682 |
].
|
|
1683 |
(aViewClass == HorizontalPanelView) ifTrue:[
|
|
1684 |
^ #(
|
|
1685 |
'horizontal layout'
|
|
1686 |
'vertical layout'
|
|
1687 |
)
|
|
1688 |
].
|
|
1689 |
(aViewClass == VariableVerticalPanel) ifTrue:[
|
|
1690 |
^ #(
|
|
1691 |
'handle position'
|
|
1692 |
'style'
|
|
1693 |
)
|
|
1694 |
].
|
|
1695 |
(aViewClass == ListView) ifTrue:[
|
|
1696 |
^ #(
|
|
1697 |
'contents'
|
|
1698 |
)
|
|
1699 |
].
|
|
1700 |
(aViewClass == SelectionInListView) ifTrue:[
|
|
1701 |
^ #(
|
|
1702 |
'press action'
|
|
1703 |
)
|
|
1704 |
].
|
|
1705 |
(aViewClass == EditField) ifTrue:[
|
|
1706 |
^#(
|
|
1707 |
'initialText'
|
|
1708 |
'field type'
|
|
1709 |
'field length'
|
|
1710 |
)
|
|
1711 |
].
|
|
1712 |
(aViewClass == View) ifTrue:[
|
|
1713 |
^ #(
|
|
1714 |
'level'
|
|
1715 |
'view background-color'
|
|
1716 |
)
|
|
1717 |
].
|
|
1718 |
(aViewClass == Scroller) ifTrue:[
|
|
1719 |
^ #(
|
|
1720 |
'scroll action'
|
|
1721 |
'asynchronous'
|
|
1722 |
'synchronous'
|
|
1723 |
)
|
|
1724 |
].
|
|
1725 |
(aViewClass == ScrollBar) ifTrue:[
|
|
1726 |
^ #(
|
|
1727 |
'scroll action'
|
|
1728 |
'scrollDown action'
|
|
1729 |
'scrollUp action'
|
|
1730 |
'asynchronous'
|
|
1731 |
'synchronous'
|
|
1732 |
)
|
|
1733 |
].
|
|
1734 |
(aViewClass == HorizontalScrollBar) ifTrue:[
|
|
1735 |
^ #(
|
|
1736 |
'scrollLeft action'
|
|
1737 |
'scrollRight action'
|
|
1738 |
)
|
|
1739 |
].
|
|
1740 |
(aViewClass == PullDownMenu) ifTrue:[
|
|
1741 |
^ #(
|
|
1742 |
'labels'
|
|
1743 |
'actions'
|
|
1744 |
)
|
|
1745 |
].
|
|
1746 |
(aViewClass == Separator) ifTrue:[
|
|
1747 |
^ #(
|
|
1748 |
'orientation'
|
|
1749 |
)
|
|
1750 |
].
|
|
1751 |
^ nil
|
|
1752 |
|
|
1753 |
"Modified: 6.9.1995 / 13:42:09 / claus"
|
|
1754 |
!
|
|
1755 |
|
|
1756 |
rejectOutletsForClass:aViewClass
|
|
1757 |
"return a list of suppressed outlets for a view-class"
|
|
1758 |
|
|
1759 |
"could this be done automatically ?"
|
|
1760 |
|
|
1761 |
(aViewClass == CheckToggle) ifTrue:[
|
|
1762 |
^ #(
|
|
1763 |
'iconic-label'
|
|
1764 |
)
|
|
1765 |
].
|
|
1766 |
(aViewClass == CheckBox) ifTrue:[
|
|
1767 |
^ #(
|
|
1768 |
'horizontal layout'
|
|
1769 |
'vertical layout'
|
|
1770 |
)
|
|
1771 |
].
|
|
1772 |
(aViewClass == HorizontalScrollBar) ifTrue:[
|
|
1773 |
^ #(
|
|
1774 |
'scrollUp action'
|
|
1775 |
'scrollDown action'
|
|
1776 |
)
|
|
1777 |
].
|
|
1778 |
^ nil
|
|
1779 |
|
|
1780 |
"Modified: 4.9.1995 / 18:55:03 / claus"
|
|
1781 |
!
|
|
1782 |
|
|
1783 |
setupPropertyFromSpec:aSpec
|
58
|
1784 |
"apply is pressed in the geometry-sub view, with a alignmentOrigin selected
|
|
1785 |
"
|
|
1786 |
|aViewsSpec|
|
|
1787 |
|
|
1788 |
workView singleSelectionDo:[:selectedView |
|
|
1789 |
aViewsSpec := workView generateSpecFor:selectedView.
|
|
1790 |
aViewsSpec := aViewsSpec first.
|
|
1791 |
].
|
|
1792 |
|
|
1793 |
self setupPropertyFromSpec:aSpec for:aViewsSpec
|
|
1794 |
|
|
1795 |
!
|
|
1796 |
|
|
1797 |
setupPropertyFromSpec:aSpec for:aViewsSpec
|
42
|
1798 |
"setup menu from spec
|
|
1799 |
"
|
58
|
1800 |
|specBindings|
|
|
1801 |
|
42
|
1802 |
outletView := nil.
|
|
1803 |
|
|
1804 |
specShown ~= aSpec ifTrue:[
|
|
1805 |
propertyFrame destroySubViews.
|
58
|
1806 |
|
|
1807 |
"/ get aspects from specClass
|
|
1808 |
specSpecificAspectHolders := IdentityDictionary new.
|
|
1809 |
aViewsSpec class addBindingsTo:specSpecificAspectHolders for:aViewsSpec channel:nil.
|
|
1810 |
|
42
|
1811 |
builder buildFromSpec:aSpec in:propertyFrame.
|
|
1812 |
propertyFrame realizeAllSubViews.
|
|
1813 |
].
|
|
1814 |
specShown := aSpec
|
|
1815 |
!
|
|
1816 |
|
|
1817 |
showOutletsFor:aView
|
|
1818 |
|c outlets|
|
|
1819 |
|
|
1820 |
outletView isNil ifTrue:[^ self].
|
|
1821 |
|
|
1822 |
(aView isKindOf:SimpleView) ifFalse:[
|
|
1823 |
outletView list:nil.
|
|
1824 |
^ self
|
|
1825 |
].
|
|
1826 |
c := aView class.
|
|
1827 |
|
|
1828 |
outlets := self listOfOutletsFor:c.
|
|
1829 |
outletView list:outlets
|
|
1830 |
|
|
1831 |
"Modified: 5.9.1995 / 21:51:57 / claus"
|
|
1832 |
! !
|
|
1833 |
|
|
1834 |
!UIPainter methodsFor:'private - fetch'!
|
|
1835 |
|
55
|
1836 |
fetchColorsFrom:aView
|
|
1837 |
|holder|
|
|
1838 |
|
58
|
1839 |
holder := self aspectFor:#foregroundColor.
|
55
|
1840 |
(aView respondsTo:#foregroundColor) ifTrue:[
|
|
1841 |
holder value:(aView foregroundColor storeString).
|
|
1842 |
] ifFalse:[
|
|
1843 |
holder value:nil
|
|
1844 |
].
|
58
|
1845 |
holder := self aspectFor:#backgroundColor.
|
55
|
1846 |
(aView respondsTo:#backgroundColor) ifTrue:[
|
|
1847 |
holder value:(aView backgroundColor storeString).
|
|
1848 |
] ifFalse:[
|
|
1849 |
holder value:nil
|
|
1850 |
].
|
|
1851 |
|
|
1852 |
!
|
|
1853 |
|
42
|
1854 |
fetchLayoutFrom:aView
|
|
1855 |
|layout extent|
|
|
1856 |
|
|
1857 |
layout := aView geometryLayout.
|
|
1858 |
layout isNil ifTrue:[^ self].
|
|
1859 |
|
|
1860 |
layout isLayout ifFalse:[
|
|
1861 |
layout isRectangle ifTrue:[
|
58
|
1862 |
(aspectHolders at:#leftOffset) value:(layout left).
|
|
1863 |
(aspectHolders at:#rightOffset) value:(layout right).
|
|
1864 |
(aspectHolders at:#topOffset) value:(layout top).
|
|
1865 |
(aspectHolders at:#bottomOffset) value:(layout bottom).
|
|
1866 |
^ self
|
42
|
1867 |
].
|
|
1868 |
layout isPoint ifTrue:[
|
58
|
1869 |
(aspectHolders at:#leftOffset) value:(layout left).
|
|
1870 |
(aspectHolders at:#rightOffset) value:(layout right).
|
|
1871 |
^ self
|
42
|
1872 |
].
|
|
1873 |
].
|
|
1874 |
|
58
|
1875 |
(aspectHolders at:#leftOffset) value:(layout leftOffset).
|
|
1876 |
(aspectHolders at:#leftFraction) value:(layout leftFraction).
|
|
1877 |
(aspectHolders at:#topOffset) value:(layout topOffset).
|
|
1878 |
(aspectHolders at:#topFraction) value:(layout topFraction).
|
42
|
1879 |
|
|
1880 |
layout isLayoutFrame ifTrue:[
|
58
|
1881 |
(aspectHolders at:#rightOffset) value:(layout rightOffset).
|
|
1882 |
(aspectHolders at:#bottomOffset) value:(layout bottomOffset).
|
|
1883 |
|
|
1884 |
(aspectHolders at:#rightFraction) value:(layout rightFraction).
|
|
1885 |
(aspectHolders at:#bottomFraction) value:(layout bottomFraction).
|
|
1886 |
|
|
1887 |
(aspectHolders at:#leftAlignmentFraction) value:0.
|
|
1888 |
(aspectHolders at:#topAlignmentFraction) value:0.
|
42
|
1889 |
] ifFalse:[
|
|
1890 |
extent := aView extent.
|
|
1891 |
|
58
|
1892 |
(aspectHolders at:#rightOffset) value:(layout leftOffset + extent x).
|
|
1893 |
(aspectHolders at:#bottomOffset) value:(layout topOffset + extent y).
|
|
1894 |
|
|
1895 |
(aspectHolders at:#rightFraction) value:0.
|
|
1896 |
(aspectHolders at:#bottomFraction) value:0.
|
42
|
1897 |
|
|
1898 |
layout isAlignmentOrigin ifTrue:[
|
58
|
1899 |
(aspectHolders at:#leftAlignmentFraction) value:(layout leftAlignmentFraction).
|
|
1900 |
(aspectHolders at:#topAlignmentFraction) value:(layout topAlignmentFraction).
|
42
|
1901 |
] ifFalse:[
|
58
|
1902 |
(aspectHolders at:#leftAlignmentFraction) value:0.
|
|
1903 |
(aspectHolders at:#topAlignmentFraction) value:0.
|
42
|
1904 |
]
|
|
1905 |
].
|
|
1906 |
|
|
1907 |
|
|
1908 |
!
|
|
1909 |
|
|
1910 |
fetchModelAspectsFrom:aView
|
50
|
1911 |
(self aspectFor:#aspectChannel) value:(workView aspectSelectorForView:aView).
|
|
1912 |
(self aspectFor:#changeChannel) value:(workView changeSelectorForView:aView).
|
42
|
1913 |
|
|
1914 |
! !
|
|
1915 |
|
|
1916 |
!UIPainter methodsFor:'setup choices'!
|
|
1917 |
|
|
1918 |
showAllWidgets
|
|
1919 |
"create list of basic widgets"
|
|
1920 |
|
|
1921 |
self showWidgetsWhere:[:class | true]
|
|
1922 |
!
|
|
1923 |
|
|
1924 |
showBasicWidgets
|
|
1925 |
"create list of basic widgets"
|
|
1926 |
|
|
1927 |
self showWidgetsInCategory:'Views-Basic'
|
|
1928 |
butNot:[:class | class isKindOf:ModalBox class]
|
|
1929 |
!
|
|
1930 |
|
|
1931 |
showInteractorWidgets
|
|
1932 |
"create list of interactor widgets"
|
|
1933 |
|
|
1934 |
self showWidgetsInCategory:'Views-Interactors'
|
|
1935 |
butNot:[:class | class isKindOf:ModalBox class]
|
|
1936 |
!
|
|
1937 |
|
|
1938 |
showLayoutWidgets
|
|
1939 |
"create list of basic widgets"
|
|
1940 |
|
|
1941 |
self showWidgetsInCategory:'Views-Layout'
|
|
1942 |
butNot:[:class | class isKindOf:ModalBox class]
|
|
1943 |
!
|
|
1944 |
|
|
1945 |
showModalWidgets
|
|
1946 |
"create list of modal widgets"
|
|
1947 |
|
|
1948 |
self showWidgetsWhere:[:class | class isKindOf:ModalBox class]
|
|
1949 |
!
|
|
1950 |
|
|
1951 |
showOtherWidgets
|
|
1952 |
"create list of other widgets"
|
|
1953 |
|
|
1954 |
|check cat|
|
|
1955 |
|
|
1956 |
check := [:class |
|
|
1957 |
(#('Views-Basic'
|
|
1958 |
'Views-Interactors'
|
|
1959 |
'Views-Layout'
|
|
1960 |
'Views-Text') includes:class category) not].
|
|
1961 |
self showWidgetsWhere:check
|
|
1962 |
butNot:[:class | class isKindOf:ModalBox class]
|
|
1963 |
!
|
|
1964 |
|
|
1965 |
showTextWidgets
|
|
1966 |
"create list of basic widgets"
|
|
1967 |
|
|
1968 |
self showWidgetsInCategory:'Views-Text'
|
|
1969 |
butNot:[:class | class isKindOf:ModalBox class]
|
|
1970 |
!
|
|
1971 |
|
|
1972 |
showWidgetsInCategory:aCategory
|
|
1973 |
"create list of basic widgets"
|
|
1974 |
|
|
1975 |
self showWidgetsWhere:[:class | class category = aCategory]
|
|
1976 |
!
|
|
1977 |
|
|
1978 |
showWidgetsInCategory:aCategory butNot:excludeBlock
|
|
1979 |
"create list of basic widgets"
|
|
1980 |
|
|
1981 |
self showWidgetsWhere:[:class | class category = aCategory]
|
|
1982 |
butNot:excludeBlock
|
|
1983 |
!
|
|
1984 |
|
|
1985 |
showWidgetsWhere:aBlock
|
|
1986 |
"create list of widgets where aBlock avaluates to true"
|
|
1987 |
|
|
1988 |
self showWidgetsWhere:aBlock butNot:[:class | false]
|
|
1989 |
!
|
|
1990 |
|
|
1991 |
showWidgetsWhere:aBlock butNot:excludeBlock
|
|
1992 |
"create list of widgets where aBlock evaluates to true and excludeBlock
|
|
1993 |
evaluates to false"
|
|
1994 |
|
|
1995 |
|list|
|
|
1996 |
|
|
1997 |
list := OrderedCollection new:0.
|
|
1998 |
SimpleView allSubclassesDo:[:aSubclass |
|
|
1999 |
(aBlock value:aSubclass) ifTrue:[
|
|
2000 |
(excludeBlock value:aSubclass) ifFalse:[
|
|
2001 |
list add:(aSubclass name)
|
|
2002 |
]
|
|
2003 |
]
|
|
2004 |
].
|
|
2005 |
(aBlock value:View) ifTrue:[
|
|
2006 |
(excludeBlock value:View) ifFalse:[
|
|
2007 |
list add:'View'
|
|
2008 |
]
|
|
2009 |
].
|
|
2010 |
(list size == 0) ifFalse:[
|
|
2011 |
list sort
|
|
2012 |
].
|
|
2013 |
elementMenu list:list
|
|
2014 |
! !
|
|
2015 |
|
|
2016 |
!UIPainter methodsFor:'user actions - dimension'!
|
|
2017 |
|
|
2018 |
setAlignmentOrigin
|
|
2019 |
"apply is pressed in the geometry-sub view, with a alignmentOrigin selected
|
|
2020 |
"
|
|
2021 |
self setupPropertyFromSpec:(self class geometrySpecForAlignmentOrigin)
|
|
2022 |
!
|
|
2023 |
|
|
2024 |
setDimensionForAlignmentOrigin
|
|
2025 |
|view layout|
|
|
2026 |
|
|
2027 |
view := workView singleSelection.
|
|
2028 |
|
|
2029 |
view notNil ifTrue:[
|
|
2030 |
layout := AlignmentOrigin new.
|
|
2031 |
|
58
|
2032 |
layout leftOffset:((aspectHolders at:#leftOffset) value) ? 0.
|
|
2033 |
layout topOffset:((aspectHolders at:#topOffset) value) ? 0.
|
|
2034 |
layout leftFraction:((aspectHolders at:#leftFraction) value) ? 0.
|
|
2035 |
layout topFraction:((aspectHolders at:#topFraction) value) ? 0.
|
|
2036 |
|
|
2037 |
layout leftAlignmentFraction:((aspectHolders at:#leftAlignmentFraction) value) ? 0.
|
|
2038 |
layout topAlignmentFraction:((aspectHolders at:#topAlignmentFraction) value) ? 0.
|
42
|
2039 |
|
|
2040 |
workView setDimension:layout.
|
|
2041 |
]
|
|
2042 |
!
|
|
2043 |
|
|
2044 |
setDimensionForLayoutFrame
|
|
2045 |
|view layout|
|
|
2046 |
|
|
2047 |
view := workView singleSelection.
|
|
2048 |
|
|
2049 |
view notNil ifTrue:[
|
|
2050 |
layout := LayoutFrame new.
|
|
2051 |
|
58
|
2052 |
layout leftOffset:((aspectHolders at:#leftOffset) value) ? 0.
|
|
2053 |
layout rightOffset:((aspectHolders at:#rightOffset) value) ? 0.
|
|
2054 |
layout topOffset:((aspectHolders at:#topOffset) value) ? 0.
|
|
2055 |
layout bottomOffset:((aspectHolders at:#bottomOffset) value) ? 0.
|
|
2056 |
layout leftFraction:((aspectHolders at:#leftFraction) value) ? 0.
|
|
2057 |
layout rightFraction:((aspectHolders at:#rightFraction) value) ? 0.
|
|
2058 |
layout topFraction:((aspectHolders at:#topFraction) value) ? 0.
|
|
2059 |
layout bottomFraction:((aspectHolders at:#bottomFraction) value) ? 0.
|
42
|
2060 |
|
|
2061 |
workView setDimension:layout.
|
|
2062 |
]
|
|
2063 |
!
|
|
2064 |
|
|
2065 |
setDimensionForLayoutOrigin
|
|
2066 |
|view layout|
|
|
2067 |
|
|
2068 |
view := workView singleSelection.
|
|
2069 |
|
|
2070 |
view notNil ifTrue:[
|
|
2071 |
layout := LayoutOrigin new.
|
|
2072 |
|
58
|
2073 |
layout leftOffset:((aspectHolders at:#leftOffset) value) ? 0.
|
|
2074 |
layout topOffset:((aspectHolders at:#topOffset) value) ? 0.
|
|
2075 |
|
|
2076 |
layout leftFraction:((aspectHolders at:#leftFraction) value) ? 0.
|
|
2077 |
layout topFraction:((aspectHolders at:#topFraction) value) ? 0.
|
42
|
2078 |
|
|
2079 |
workView setDimension:layout.
|
|
2080 |
]
|
|
2081 |
!
|
|
2082 |
|
|
2083 |
setLayoutFrame
|
|
2084 |
"apply is pressed in the geometry-sub view, with a layoutFrame selected
|
|
2085 |
"
|
|
2086 |
self setupPropertyFromSpec:(self class geometrySpecForLayoutFrame)
|
|
2087 |
!
|
|
2088 |
|
|
2089 |
setLayoutOrigin
|
|
2090 |
"apply is pressed in the geometry-sub view, with a layoutOrigin selected
|
|
2091 |
"
|
|
2092 |
self setupPropertyFromSpec:(self class geometrySpecForLayoutOrigin)
|
|
2093 |
! !
|
|
2094 |
|
|
2095 |
!UIPainter methodsFor:'user interaction'!
|
|
2096 |
|
|
2097 |
closeRequest
|
50
|
2098 |
workView notNil ifTrue:[workView release. workView := nil].
|
42
|
2099 |
super closeRequest
|
|
2100 |
!
|
|
2101 |
|
55
|
2102 |
closeRequestFor:aTopView
|
|
2103 |
aTopView ~~ topView ifTrue:[
|
|
2104 |
topView device beep.
|
|
2105 |
^ self
|
42
|
2106 |
].
|
55
|
2107 |
super closeRequestFor:aTopView
|
42
|
2108 |
!
|
|
2109 |
|
|
2110 |
selectOutlet:nr
|
|
2111 |
|outlet type sel text box action initialText initialList
|
|
2112 |
view prop t val|
|
|
2113 |
|
|
2114 |
outlet := outletView selectionValue.
|
|
2115 |
outletView deselect.
|
|
2116 |
view := workView selection.
|
|
2117 |
view isNil ifTrue:[
|
|
2118 |
self notify:'select something first'.
|
|
2119 |
^ self
|
|
2120 |
].
|
|
2121 |
action := [:s | self setOutlet:sel type:type to:s in:view].
|
|
2122 |
(outlet = 'label') ifTrue:[
|
|
2123 |
type := #string.
|
|
2124 |
sel := #label:.
|
|
2125 |
text := 'label-text:'.
|
|
2126 |
initialText := view label
|
|
2127 |
].
|
|
2128 |
(outlet = 'fixed size') ifTrue:[
|
|
2129 |
type := #boolean.
|
|
2130 |
sel := #sizeFixed:.
|
|
2131 |
text := 'size is fix:'.
|
|
2132 |
].
|
|
2133 |
(outlet = 'frame shown') ifTrue:[
|
|
2134 |
type := #boolean.
|
|
2135 |
sel := #showFrame:.
|
|
2136 |
text := 'frame is to be drawn:'.
|
|
2137 |
].
|
|
2138 |
(outlet = 'labels') ifTrue:[
|
|
2139 |
type := #strings.
|
|
2140 |
sel := #labels:.
|
|
2141 |
initialText := view labels
|
|
2142 |
].
|
|
2143 |
(outlet = 'contents') ifTrue:[
|
|
2144 |
type := #text.
|
|
2145 |
sel := #contents:.
|
|
2146 |
initialText := view contents
|
|
2147 |
].
|
|
2148 |
(outlet = 'initialText') ifTrue:[
|
|
2149 |
type := #string.
|
|
2150 |
sel := #initialText:.
|
|
2151 |
initialText := view contents
|
|
2152 |
].
|
|
2153 |
(outlet = 'field type') ifTrue:[
|
|
2154 |
type := #fieldTypeSymbol.
|
|
2155 |
sel := #type:.
|
|
2156 |
initialList := #(number
|
|
2157 |
string
|
|
2158 |
password
|
|
2159 |
).
|
|
2160 |
initialText := view converter isNil ifTrue:[#string] ifFalse:[view converter type].
|
|
2161 |
].
|
|
2162 |
(outlet = 'field length') ifTrue:[
|
|
2163 |
type := #numberOrNil.
|
|
2164 |
sel := #maxChars:.
|
|
2165 |
text := 'field length (empty -> unlimited)'.
|
|
2166 |
initialText := view maxChars isNil ifTrue:[''] ifFalse:[view maxChars printString].
|
|
2167 |
].
|
|
2168 |
(outlet = 'level') ifTrue:[
|
|
2169 |
type := #number.
|
|
2170 |
sel := #level:.
|
|
2171 |
initialText := view level printString
|
|
2172 |
].
|
|
2173 |
(outlet = 'active level') ifTrue:[
|
|
2174 |
type := #number.
|
|
2175 |
sel := #onLevel:.
|
|
2176 |
initialText := view onLevel printString
|
|
2177 |
].
|
|
2178 |
(outlet = 'passive level') ifTrue:[
|
|
2179 |
type := #number.
|
|
2180 |
sel := #offLevel:.
|
|
2181 |
initialText := view offLevel printString
|
|
2182 |
].
|
|
2183 |
(outlet = 'iconic-label') ifTrue:[
|
|
2184 |
type := #form.
|
|
2185 |
sel := #label:.
|
|
2186 |
text := 'label-icon:'
|
|
2187 |
].
|
|
2188 |
(outlet = 'view background-color') ifTrue:[
|
|
2189 |
type := #color.
|
|
2190 |
sel := #viewBackground:.
|
|
2191 |
text := 'view background color'.
|
|
2192 |
initialText := 'Black'
|
|
2193 |
].
|
|
2194 |
(outlet = 'foreground-color') ifTrue:[
|
|
2195 |
type := #color.
|
|
2196 |
sel := #foregroundColor:.
|
|
2197 |
text := 'foreground color'.
|
|
2198 |
initialText := 'Black'
|
|
2199 |
].
|
|
2200 |
(outlet = 'background-color') ifTrue:[
|
|
2201 |
type := #color.
|
|
2202 |
sel := #backgroundColor:.
|
|
2203 |
text := 'background color'.
|
|
2204 |
initialText := 'Grey'
|
|
2205 |
].
|
|
2206 |
(outlet = 'active foreground-color') ifTrue:[
|
|
2207 |
type := #color.
|
|
2208 |
sel := #activeForegroundColor:.
|
|
2209 |
text := 'active foreground color'.
|
|
2210 |
initialText := 'Yellow'
|
|
2211 |
].
|
|
2212 |
(outlet = 'active background-color') ifTrue:[
|
|
2213 |
type := #color.
|
|
2214 |
sel := #activeBackgroundColor:.
|
|
2215 |
text := 'active background color'.
|
|
2216 |
initialText := 'Grey'
|
|
2217 |
].
|
|
2218 |
(outlet = 'scroll action') ifTrue:[
|
|
2219 |
type := #block.
|
|
2220 |
sel := #scrollAction:.
|
|
2221 |
text := 'action block when scrolled'
|
|
2222 |
].
|
|
2223 |
(outlet = 'scrollUp action') ifTrue:[
|
|
2224 |
type := #block.
|
|
2225 |
sel := #scrollUpAction:.
|
|
2226 |
text := 'action block when scrolled up'
|
|
2227 |
].
|
|
2228 |
(outlet = 'scrollDown action') ifTrue:[
|
|
2229 |
type := #block.
|
|
2230 |
sel := #scrollDownAction:.
|
|
2231 |
text := 'action block when scrolled down'
|
|
2232 |
].
|
|
2233 |
(outlet = 'scrollLeft action') ifTrue:[
|
|
2234 |
type := #block.
|
|
2235 |
sel := #scrollLeftAction:.
|
|
2236 |
text := 'action block when scrolled left'
|
|
2237 |
].
|
|
2238 |
(outlet = 'scrollRight action') ifTrue:[
|
|
2239 |
type := #block.
|
|
2240 |
sel := #scrollRightAction:.
|
|
2241 |
text := 'action block when scrolled right'
|
|
2242 |
].
|
|
2243 |
(outlet = 'press action') ifTrue:[
|
|
2244 |
type := #block.
|
|
2245 |
sel := #pressAction:.
|
|
2246 |
text := 'action block when pressed'
|
|
2247 |
].
|
|
2248 |
(outlet = 'release action') ifTrue:[
|
|
2249 |
type := #block.
|
|
2250 |
sel := #releaseAction:.
|
|
2251 |
text := 'action block when released'
|
|
2252 |
].
|
|
2253 |
(outlet = 'style') ifTrue:[
|
|
2254 |
type := #symbol.
|
|
2255 |
sel := #style:.
|
|
2256 |
initialList := #(motif next)
|
|
2257 |
].
|
|
2258 |
(outlet = 'handle position') ifTrue:[
|
|
2259 |
type := #symbol.
|
|
2260 |
sel := #handlePosition:.
|
|
2261 |
initialList := #(left center right)
|
|
2262 |
].
|
|
2263 |
(outlet = 'horizontal layout') ifTrue:[
|
|
2264 |
type := #symbol.
|
|
2265 |
sel := #horizontalLayout:.
|
|
2266 |
text := 'horizontal components layout'.
|
|
2267 |
initialList := #(left
|
|
2268 |
leftSpace
|
|
2269 |
leftMax
|
|
2270 |
leftSpaceMax
|
|
2271 |
center
|
|
2272 |
centerMax
|
|
2273 |
right
|
|
2274 |
rightSpace
|
|
2275 |
rightMax
|
|
2276 |
rightSpaceMax
|
|
2277 |
spread
|
|
2278 |
spreadSpace
|
|
2279 |
spreadMax
|
|
2280 |
spreadSpaceMax
|
|
2281 |
fit
|
|
2282 |
fitSpace).
|
|
2283 |
initialText := view horizontalLayout printString
|
|
2284 |
].
|
|
2285 |
(outlet = 'vertical layout') ifTrue:[
|
|
2286 |
type := #symbol.
|
|
2287 |
sel := #verticalLayout:.
|
|
2288 |
text := 'vertical components layout'.
|
|
2289 |
initialList := #(top
|
|
2290 |
topSpace
|
|
2291 |
center
|
|
2292 |
bottom
|
|
2293 |
bottomSpace
|
|
2294 |
spread
|
|
2295 |
spreadSpace
|
|
2296 |
fit
|
|
2297 |
fitSpace).
|
|
2298 |
initialText := view verticalLayout printString
|
|
2299 |
].
|
|
2300 |
(outlet = 'label position') ifTrue:[
|
|
2301 |
type := #symbol.
|
|
2302 |
sel := #labelPosition:.
|
|
2303 |
initialList := #(topLeft topCenter topRight bottomLeft bottomCenter bottomRight).
|
|
2304 |
initialText := view labelPosition printString
|
|
2305 |
].
|
|
2306 |
(outlet = 'label layout') ifTrue:[
|
|
2307 |
type := #symbol.
|
|
2308 |
sel := #adjust:.
|
|
2309 |
initialList := #( left right center centerLeft centerRight fit ).
|
|
2310 |
initialText := view adjust printString
|
|
2311 |
].
|
|
2312 |
(outlet = 'orientation') ifTrue:[
|
|
2313 |
type := #symbol.
|
|
2314 |
sel := #orientation:.
|
|
2315 |
initialList := #( horizontal vertical ).
|
|
2316 |
initialText := view orientation printString
|
|
2317 |
].
|
|
2318 |
|
|
2319 |
(type == #color) ifTrue:[
|
|
2320 |
initialList := #('Black'
|
|
2321 |
'White'
|
|
2322 |
'LightGrey'
|
|
2323 |
'Grey'
|
|
2324 |
'DarkGrey'
|
|
2325 |
'Yellow'
|
|
2326 |
'Red'
|
|
2327 |
'Green'
|
|
2328 |
'Blue'
|
|
2329 |
)
|
|
2330 |
].
|
|
2331 |
|
|
2332 |
text isNil ifTrue:[
|
|
2333 |
text := outlet
|
|
2334 |
].
|
|
2335 |
|
|
2336 |
"what type of box do we need"
|
|
2337 |
|
|
2338 |
t := type.
|
|
2339 |
((type == #color) or:[type == #symbol or:[type == #fieldTypeSymbol]]) ifTrue:[
|
|
2340 |
t := #list
|
|
2341 |
].
|
|
2342 |
((type == #number) or:[type == #numberOrNil]) ifTrue:[
|
|
2343 |
t := #string
|
|
2344 |
].
|
|
2345 |
(type == #strings) ifTrue:[
|
|
2346 |
t := #text
|
|
2347 |
].
|
|
2348 |
(type == #block) ifTrue:[
|
|
2349 |
t := #text.
|
|
2350 |
initialText := workView outletValueOf:sel for:view.
|
|
2351 |
initialText isNil ifTrue:[initialText := '[statements]']
|
|
2352 |
].
|
|
2353 |
(type == #block1) ifTrue:[
|
|
2354 |
t := #text.
|
|
2355 |
type := #block.
|
|
2356 |
initialText := workView outletValueOf:sel for:view.
|
|
2357 |
initialText isNil ifTrue:[initialText := '[:argument | statements ]']
|
|
2358 |
].
|
|
2359 |
(type == #block2) ifTrue:[
|
|
2360 |
t := #text.
|
|
2361 |
type := #block.
|
|
2362 |
initialText := workView outletValueOf:sel for:view.
|
|
2363 |
initialText isNil ifTrue:[initialText := '[:arg1 :arg2 | statements ]']
|
|
2364 |
].
|
|
2365 |
|
|
2366 |
"show a box to enter thing"
|
|
2367 |
|
|
2368 |
(t == #boolean) ifTrue:[
|
|
2369 |
val := Dialog confirmWithCancel:text.
|
|
2370 |
(val == true or:[val == false]) ifTrue:[
|
|
2371 |
action value:val
|
|
2372 |
].
|
|
2373 |
^ self
|
|
2374 |
].
|
|
2375 |
(t == #string) ifTrue:[
|
|
2376 |
"/ stringBox isNil ifTrue:[
|
|
2377 |
stringBox := EnterBox new.
|
|
2378 |
"/ ].
|
|
2379 |
box := stringBox
|
|
2380 |
].
|
|
2381 |
(t == #list) ifTrue:[
|
|
2382 |
"/ listBox isNil ifTrue:[
|
|
2383 |
listBox := ListSelectionBox new.
|
|
2384 |
"/ ].
|
|
2385 |
listBox list:initialList.
|
|
2386 |
box := listBox
|
|
2387 |
].
|
|
2388 |
(t == #text) ifTrue:[
|
|
2389 |
"/ actionBox isNil ifTrue:[
|
|
2390 |
actionBox := TextBox new.
|
|
2391 |
"/ ].
|
|
2392 |
actionBox initialText:initialText.
|
|
2393 |
box := actionBox
|
|
2394 |
].
|
|
2395 |
"
|
|
2396 |
Transcript show:'outlet: '. Transcript showCR:outlet.
|
|
2397 |
Transcript show:'type: '. Transcript showCR:type.
|
|
2398 |
Transcript show:'sel: '. Transcript showCR:sel.
|
|
2399 |
Transcript show:'text: '. Transcript showCR:text.
|
|
2400 |
"
|
|
2401 |
|
|
2402 |
box isNil ifTrue:[
|
|
2403 |
self notify:'not yet implemented'
|
|
2404 |
] ifFalse:[
|
|
2405 |
box initialText:initialText.
|
|
2406 |
box title:text.
|
|
2407 |
box action:action.
|
|
2408 |
box showAtPointer
|
|
2409 |
]
|
|
2410 |
|
|
2411 |
"Modified: 6.9.1995 / 13:46:29 / claus"
|
|
2412 |
!
|
|
2413 |
|
|
2414 |
setColors
|
|
2415 |
|fg bg|
|
|
2416 |
|
58
|
2417 |
fg := (self aspectFor:#foregroundColor) value.
|
|
2418 |
|
42
|
2419 |
(fg notNil and:[fg notEmpty]) ifTrue:[
|
|
2420 |
fg := Color readFrom:fg.
|
|
2421 |
workView singleSelectionDo:[:selectedView |
|
55
|
2422 |
selectedView foregroundColor:fg
|
42
|
2423 |
].
|
|
2424 |
].
|
58
|
2425 |
bg := (self aspectFor:#backgroundColor) value.
|
|
2426 |
|
42
|
2427 |
(bg notNil and:[bg notEmpty]) ifTrue:[
|
|
2428 |
bg := Color readFrom:bg.
|
|
2429 |
workView singleSelectionDo:[:selectedView |
|
55
|
2430 |
selectedView backgroundColor:bg
|
42
|
2431 |
].
|
|
2432 |
].
|
|
2433 |
!
|
|
2434 |
|
|
2435 |
setMiscAspects
|
|
2436 |
"sent when apply is pressen in the misc-sub view"
|
|
2437 |
|
|
2438 |
workView singleSelectionDo:[:selectedView |
|
|
2439 |
selectedView ~~ workView ifTrue:[
|
|
2440 |
workView changeVariableNameOf:selectedView to:nameChannel value
|
|
2441 |
]
|
|
2442 |
].
|
|
2443 |
!
|
|
2444 |
|
|
2445 |
setModelAspects
|
|
2446 |
"sent when apply is pressen in the model-sub view"
|
|
2447 |
|
|
2448 |
|aspectSymbol|
|
|
2449 |
|
50
|
2450 |
aspectSymbol := (self aspectFor:#aspectChannel) value.
|
42
|
2451 |
(aspectSymbol notNil and:[aspectSymbol notEmpty]) ifTrue:[
|
|
2452 |
aspectSymbol := aspectSymbol asSymbol.
|
|
2453 |
workView singleSelectionDo:[:selectedView |
|
|
2454 |
selectedView ~~ workView ifTrue:[
|
|
2455 |
workView setAspectSelector:aspectSymbol forView:selectedView
|
|
2456 |
].
|
|
2457 |
].
|
|
2458 |
].
|
|
2459 |
!
|
|
2460 |
|
|
2461 |
setOutlet:outletSymbol type:type to:outletValue in:aView
|
|
2462 |
|block val messageSymbol|
|
|
2463 |
|
|
2464 |
messageSymbol := outletSymbol.
|
|
2465 |
val := outletValue.
|
|
2466 |
(type == #block) ifTrue:[
|
|
2467 |
block := Compiler evaluate:val.
|
|
2468 |
(block == #Error) ifTrue:[
|
|
2469 |
self warn:'action will not work in test-mode'.
|
|
2470 |
workView addOutletDefinitionFor:outletSymbol
|
|
2471 |
type:type
|
|
2472 |
value:outletValue
|
|
2473 |
for:aView.
|
|
2474 |
^ self
|
|
2475 |
].
|
|
2476 |
val := block
|
|
2477 |
].
|
|
2478 |
(type == #number) ifTrue:[
|
|
2479 |
val := Number readFromString:outletValue onError:0
|
|
2480 |
].
|
|
2481 |
(type == #numberOrNil) ifTrue:[
|
|
2482 |
val := Number readFromString:outletValue onError:nil
|
|
2483 |
].
|
|
2484 |
(type == #text) ifTrue:[
|
|
2485 |
val := outletValue asString
|
|
2486 |
].
|
|
2487 |
(type == #strings) ifTrue:[
|
|
2488 |
val := outletValue asText
|
|
2489 |
].
|
|
2490 |
(type == #symbol) ifTrue:[
|
|
2491 |
val := outletValue asSymbol.
|
|
2492 |
].
|
|
2493 |
(type == #fieldTypeSymbol) ifTrue:[
|
|
2494 |
val := outletValue asSymbol.
|
|
2495 |
val == #password ifTrue:[
|
|
2496 |
aView passwordCharacter:$*
|
|
2497 |
] ifFalse:[
|
|
2498 |
aView passwordCharacter:nil
|
|
2499 |
].
|
|
2500 |
val := (PrintConverter new initFor:val).
|
|
2501 |
messageSymbol := #converter:
|
|
2502 |
].
|
|
2503 |
(type == #color) ifTrue:[
|
|
2504 |
val := Color name:outletValue.
|
|
2505 |
val isNil ifTrue:[
|
|
2506 |
self warn:('no such color:' , outletValue).
|
|
2507 |
^ self
|
|
2508 |
]
|
|
2509 |
].
|
|
2510 |
Transcript show:(val printString).
|
|
2511 |
Transcript showCR:('(' , val class printString , ')').
|
|
2512 |
|
|
2513 |
workView selectionHiddenDo:[
|
|
2514 |
aView perform:messageSymbol with:val.
|
|
2515 |
workView elementChanged:aView.
|
|
2516 |
aView redraw.
|
|
2517 |
].
|
|
2518 |
workView addOutletDefinitionFor:outletSymbol
|
|
2519 |
type:type
|
|
2520 |
value:outletValue
|
|
2521 |
for:aView
|
|
2522 |
|
|
2523 |
"Modified: 6.9.1995 / 13:44:46 / claus"
|
|
2524 |
!
|
|
2525 |
|
|
2526 |
showPropertyView
|
58
|
2527 |
|v l spec shown possibleProperties slices specIndex slice specSymbol|
|
|
2528 |
|
|
2529 |
shown := whichProperty selection.
|
42
|
2530 |
|
|
2531 |
workView singleSelectionDo:[:selectedView |
|
58
|
2532 |
|aViewsSpec|
|
|
2533 |
|
|
2534 |
aViewsSpec := workView generateSpecFor:selectedView.
|
|
2535 |
aViewsSpec := aViewsSpec first.
|
|
2536 |
|
|
2537 |
slices := selectedView specClass slices.
|
|
2538 |
possibleProperties := slices collect:[:slice | slice first asString].
|
|
2539 |
possibleProperties := possibleProperties, #('dimension' 'colors' 'model' 'misc' 'attribute list').
|
|
2540 |
possibleProperties ~= whichProperty list ifTrue:[
|
|
2541 |
whichProperty list:possibleProperties.
|
|
2542 |
|
|
2543 |
(possibleProperties includes:shown) ifFalse:[
|
|
2544 |
shown := nil.
|
|
2545 |
].
|
|
2546 |
].
|
|
2547 |
|
|
2548 |
specIndex := slices findFirst:[:slice | slice first = shown].
|
|
2549 |
specIndex ~~ 0 ifTrue:[
|
|
2550 |
slice := slices at:specIndex.
|
|
2551 |
specSymbol := slice at:2.
|
|
2552 |
(selectedView specClass respondsTo:specSymbol) ifTrue:[
|
|
2553 |
spec := selectedView specClass perform:specSymbol.
|
|
2554 |
^ self setupPropertyFromSpec:spec for:aViewsSpec
|
|
2555 |
]
|
|
2556 |
].
|
|
2557 |
|
|
2558 |
(shown = 'dimension' or:[shown = 'Position']) ifTrue:[
|
42
|
2559 |
(l := selectedView geometryLayout) notNil ifTrue:[
|
|
2560 |
l isLayout ifTrue:[
|
|
2561 |
l isAlignmentOrigin ifTrue:[
|
|
2562 |
spec := self class geometrySpecForAlignmentOrigin
|
|
2563 |
] ifFalse:[
|
|
2564 |
l isLayoutFrame ifFalse:[
|
|
2565 |
spec := self class geometrySpecForLayoutOrigin
|
|
2566 |
]
|
|
2567 |
]
|
|
2568 |
]
|
|
2569 |
].
|
|
2570 |
spec isNil ifTrue:[
|
|
2571 |
spec := self class geometrySpecForLayoutFrame
|
|
2572 |
].
|
58
|
2573 |
^ self setupPropertyFromSpec:spec for:aViewsSpec
|
42
|
2574 |
].
|
|
2575 |
|
58
|
2576 |
shown = 'colors' ifTrue:[
|
|
2577 |
^ self setupPropertyFromSpec:(self class colorSpec) for:aViewsSpec
|
42
|
2578 |
].
|
|
2579 |
|
58
|
2580 |
shown = 'model' ifTrue:[
|
|
2581 |
^ self setupPropertyFromSpec:(self class modelSpec) for:aViewsSpec
|
42
|
2582 |
].
|
|
2583 |
|
58
|
2584 |
shown = 'misc' ifTrue:[
|
|
2585 |
^ self setupPropertyFromSpec:(self class miscSpec) for:aViewsSpec
|
42
|
2586 |
].
|
|
2587 |
|
58
|
2588 |
shown = 'attribute list' ifTrue:[
|
42
|
2589 |
specShown ~~ #attributeList ifTrue:[
|
|
2590 |
propertyFrame destroySubViews.
|
58
|
2591 |
specSpecificAspectHolders := IdentityDictionary new.
|
|
2592 |
|
42
|
2593 |
v := ScrollableView for:SelectionInListView in:propertyFrame.
|
|
2594 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
|
|
2595 |
outletView := v scrolledView.
|
|
2596 |
outletView action:[:lineNr | lineNr notNil ifTrue:[self selectOutlet:lineNr]].
|
|
2597 |
propertyFrame realizeAllSubViews.
|
|
2598 |
specShown := #attributeList.
|
|
2599 |
].
|
|
2600 |
self showOutletsFor:(workView selection).
|
|
2601 |
^ self
|
|
2602 |
].
|
|
2603 |
].
|
|
2604 |
|
|
2605 |
propertyFrame destroySubViews.
|
|
2606 |
outletView := nil.
|
|
2607 |
specShown := nil.
|
58
|
2608 |
specSpecificAspectHolders := IdentityDictionary new.
|
42
|
2609 |
|
55
|
2610 |
! !
|
|
2611 |
|
|
2612 |
!UIPainter methodsFor:'user interaction - dialogs'!
|
|
2613 |
|
|
2614 |
checkClassAndSelector
|
|
2615 |
"check for class & superclass"
|
|
2616 |
|
|
2617 |
|superclass cls|
|
|
2618 |
|
58
|
2619 |
specClass isNil ifTrue:[^ false].
|
|
2620 |
|
|
2621 |
specClass isBehavior ifFalse:[
|
|
2622 |
cls := Smalltalk at:specClass asSymbol
|
|
2623 |
] ifTrue:[
|
|
2624 |
cls := specClass
|
|
2625 |
].
|
|
2626 |
cls isNil ifTrue:[
|
55
|
2627 |
(superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[
|
|
2628 |
self warn:'no class named ' , specSuperclass , ' exists.'.
|
|
2629 |
^ false.
|
|
2630 |
].
|
|
2631 |
(self confirm:'create ' , specClass , ' ?') ifTrue:[
|
|
2632 |
superclass subclass:(specClass asSymbol)
|
|
2633 |
instanceVariableNames:''
|
|
2634 |
classVariableNames:''
|
|
2635 |
poolDictionaries:''
|
|
2636 |
category:'New-Applications'.
|
|
2637 |
^ true.
|
|
2638 |
].
|
|
2639 |
^ false.
|
|
2640 |
].
|
|
2641 |
cls isBehavior ifFalse:[
|
|
2642 |
self warn:'a global named ' , specClass , ' exists, but is no class.'.
|
|
2643 |
^ false.
|
|
2644 |
].
|
|
2645 |
|
58
|
2646 |
specSuperclass isBehavior ifFalse:[
|
|
2647 |
superclass := Smalltalk at:specSuperclass asSymbol
|
|
2648 |
] ifTrue:[
|
|
2649 |
superclass := specSuperclass
|
|
2650 |
].
|
55
|
2651 |
specSuperclass notNil ifTrue:[
|
58
|
2652 |
superclass isNil ifTrue:[
|
55
|
2653 |
self warn:'no class named ' , specSuperclass , ' exists.'.
|
|
2654 |
^ false.
|
|
2655 |
].
|
|
2656 |
|
|
2657 |
(cls isSubclassOf:superclass) ifFalse:[
|
|
2658 |
self warn:'a global named ' , specClass , ' exists, but is not a subclass of ' , superclass name , '.'.
|
|
2659 |
^ false.
|
|
2660 |
]
|
|
2661 |
].
|
|
2662 |
^ true
|
|
2663 |
!
|
|
2664 |
|
|
2665 |
defineClassAndSelector
|
|
2666 |
"launch a dialog to define class, superclass and method"
|
|
2667 |
|
|
2668 |
|again|
|
|
2669 |
|
|
2670 |
[
|
|
2671 |
again := false.
|
|
2672 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[
|
|
2673 |
|
|
2674 |
specClass := (self aspectFor:#classNameChannel) value.
|
|
2675 |
specSelector := (self aspectFor:#methodNameChannel) value.
|
|
2676 |
specSuperclass := (self aspectFor:#superclassNameChannel) value.
|
|
2677 |
|
|
2678 |
again := self checkClassAndSelector not.
|
|
2679 |
again ifFalse:[
|
|
2680 |
workView className:specClass superclassName:specSuperclass selector:specSelector.
|
|
2681 |
].
|
|
2682 |
]
|
|
2683 |
] doWhile:[again]
|
|
2684 |
|
|
2685 |
! !
|
|
2686 |
|
|
2687 |
!UIPainter methodsFor:'user interaction - menu'!
|
|
2688 |
|
|
2689 |
doFinish
|
|
2690 |
self closeRequest
|
|
2691 |
!
|
|
2692 |
|
|
2693 |
doFromClass
|
|
2694 |
|className methodName cls sel accepted failed spec s|
|
|
2695 |
|
|
2696 |
className := '' asValue.
|
|
2697 |
methodName := '' asValue.
|
|
2698 |
(s := workView className) notNil ifTrue:[
|
|
2699 |
className value:s
|
|
2700 |
].
|
|
2701 |
(s := workView methodName) notNil ifTrue:[
|
|
2702 |
methodName value:s
|
|
2703 |
].
|
|
2704 |
|
|
2705 |
failed := false.
|
|
2706 |
[
|
|
2707 |
accepted :=
|
|
2708 |
(DialogBox new
|
|
2709 |
addTextLabel:'Classes name:';
|
|
2710 |
addInputFieldOn:className;
|
|
2711 |
addVerticalSpace;
|
|
2712 |
addTextLabel:'methods name:';
|
|
2713 |
addInputFieldOn:methodName;
|
|
2714 |
addAbortButton;
|
|
2715 |
addOkButton;
|
|
2716 |
open
|
|
2717 |
) accepted.
|
|
2718 |
|
|
2719 |
accepted ifTrue:[
|
|
2720 |
cls := Smalltalk classNamed:className value.
|
|
2721 |
cls isNil ifTrue:[
|
|
2722 |
failed := true.
|
|
2723 |
self warn:'no such class'.
|
|
2724 |
] ifFalse:[
|
|
2725 |
sel := methodName value asSymbol.
|
|
2726 |
(cls respondsTo:sel ) ifFalse:[
|
|
2727 |
failed := true.
|
|
2728 |
self warn:'no such method'
|
|
2729 |
] ifTrue:[
|
|
2730 |
spec := cls perform:sel.
|
|
2731 |
spec isArray ifFalse:[
|
|
2732 |
failed := true.
|
|
2733 |
self warn:'not a windowSpec method'
|
|
2734 |
].
|
|
2735 |
"/ ok, got it
|
|
2736 |
workView className:className value.
|
|
2737 |
workView methodName:methodName value.
|
|
2738 |
workView setupFromSpec:spec.
|
|
2739 |
^ self
|
|
2740 |
]
|
|
2741 |
]
|
|
2742 |
]
|
|
2743 |
] doWhile:[accepted and:[failed]].
|
|
2744 |
|
|
2745 |
"Modified: 5.9.1995 / 18:47:57 / claus"
|
|
2746 |
!
|
|
2747 |
|
|
2748 |
doInstall
|
|
2749 |
|code|
|
|
2750 |
|
|
2751 |
(specClass isNil or:[specSelector isNil]) ifTrue:[
|
|
2752 |
self defineClassAndSelector
|
|
2753 |
].
|
|
2754 |
|
|
2755 |
self checkClassAndSelector ifFalse:[
|
|
2756 |
^ self
|
|
2757 |
].
|
|
2758 |
|
|
2759 |
workView className:specClass superclassName:specSuperclass selector:specSelector.
|
|
2760 |
|
|
2761 |
code := workView generateCode.
|
|
2762 |
(ReadStream on:code) fileIn.
|
|
2763 |
|
|
2764 |
"Modified: 4.9.1995 / 17:06:10 / claus"
|
|
2765 |
!
|
|
2766 |
|
|
2767 |
doNew
|
|
2768 |
workView removeAll.
|
|
2769 |
^ self
|
|
2770 |
|
|
2771 |
"Modified: 5.9.1995 / 20:52:21 / claus"
|
|
2772 |
!
|
|
2773 |
|
|
2774 |
doOpen
|
|
2775 |
fileBox isNil ifTrue:[
|
|
2776 |
fileBox := FileSelectionBox
|
|
2777 |
title:''
|
|
2778 |
"pattern:'*.sib'"
|
|
2779 |
okText:''
|
|
2780 |
abortText:(Resource name:'BUILDER_ABORT_LABEL'
|
|
2781 |
fromFile:'Builder.rs')
|
|
2782 |
action:[nil]
|
|
2783 |
].
|
|
2784 |
fileBox title:(Resource name:'BUILDER_OPEN_TITLE' fromFile:'Builder.rs').
|
|
2785 |
fileBox action:[:fileName | self openFile:fileName].
|
|
2786 |
fileBox okText:(Resource name:'BUILDER_OPEN_OK_LABEL' fromFile:'Builder.rs').
|
|
2787 |
fileBox showAtPointer
|
|
2788 |
!
|
|
2789 |
|
|
2790 |
doPickAView
|
|
2791 |
|view className methodName cls sel accepted spec s|
|
|
2792 |
|
|
2793 |
view := Display viewFromUser.
|
|
2794 |
view isNil ifTrue:[^ self].
|
|
2795 |
|
|
2796 |
spec := UISpecification fromView:view topView.
|
58
|
2797 |
self halt.
|
55
|
2798 |
|
|
2799 |
"/ ok, got it
|
|
2800 |
workView setupFromSpec:spec.
|
|
2801 |
workView className:view class name.
|
|
2802 |
workView methodName:#newSpec.
|
|
2803 |
^ self
|
|
2804 |
|
|
2805 |
"Modified: 5.9.1995 / 23:25:53 / claus"
|
|
2806 |
!
|
|
2807 |
|
|
2808 |
doPrint
|
|
2809 |
^ self
|
|
2810 |
!
|
|
2811 |
|
|
2812 |
doSave
|
|
2813 |
currentFileName notNil ifTrue:[
|
|
2814 |
self saveAs:currentFileName
|
|
2815 |
] ifFalse:[
|
|
2816 |
self doSaveAs
|
|
2817 |
]
|
|
2818 |
!
|
|
2819 |
|
|
2820 |
doSaveAs
|
|
2821 |
fileBox isNil ifTrue:[
|
|
2822 |
fileBox := FileSelectionBox
|
|
2823 |
title:''
|
|
2824 |
"pattern:'*.draw'"
|
|
2825 |
okText:''
|
|
2826 |
abortText:(Resource name:'BUILDER_ABORT_LABEL'
|
|
2827 |
fromFile:'Builder.rs')
|
|
2828 |
action:[nil]
|
|
2829 |
].
|
|
2830 |
fileBox title:(Resource name:'BUILDER_SAVE_TITLE' fromFile:'Builder.rs').
|
|
2831 |
fileBox action:[:fileName | self saveAs:fileName].
|
|
2832 |
fileBox okText:(Resource name:'BUILDER_SAVE_OK_LABEL' fromFile:'Builder.rs').
|
|
2833 |
fileBox showAtPointer
|
|
2834 |
! !
|
|
2835 |
|
|
2836 |
!UIPainter ignoredMethodsFor:'user interaction - menu'!
|
|
2837 |
|
|
2838 |
doSource
|
|
2839 |
|code v|
|
|
2840 |
|
|
2841 |
code := workView generateCode.
|
|
2842 |
v := CodeView open.
|
|
2843 |
v contents:code.
|
|
2844 |
v label:(workView applicationName).
|
|
2845 |
^ self
|
|
2846 |
|
|
2847 |
"Modified: 5.9.1995 / 21:02:05 / claus"
|
|
2848 |
! !
|
|
2849 |
|
|
2850 |
!UIPainter methodsFor:'user interaction - menu'!
|
|
2851 |
|
|
2852 |
doWindowSpec
|
|
2853 |
|code v|
|
|
2854 |
|
|
2855 |
code := workView generateWindowSpecMethodSource.
|
|
2856 |
v := CodeView open.
|
|
2857 |
v contents:code.
|
|
2858 |
v label:'windowSpec'.
|
|
2859 |
^ self
|
|
2860 |
|
|
2861 |
"Modified: 5.9.1995 / 21:04:14 / claus"
|
42
|
2862 |
!
|
|
2863 |
|
|
2864 |
toggleTest
|
|
2865 |
|m t|
|
|
2866 |
|
|
2867 |
m := menu menuAt:#test.
|
|
2868 |
t := workView testMode not.
|
|
2869 |
|
|
2870 |
t ifTrue:[
|
|
2871 |
m labelAt:#toggleTest put:(resources string:'test off')
|
|
2872 |
] ifFalse:[
|
|
2873 |
m labelAt:#toggleTest put:(resources string:'test on')
|
|
2874 |
].
|
|
2875 |
workView testMode:t
|
|
2876 |
! !
|
|
2877 |
|
58
|
2878 |
!UIPainter::ButtonPanel methodsFor:'accessing'!
|
|
2879 |
|
|
2880 |
receiver
|
|
2881 |
^ receiver
|
|
2882 |
!
|
|
2883 |
|
|
2884 |
receiver:aReceiver
|
|
2885 |
receiver := aReceiver
|
|
2886 |
! !
|
|
2887 |
|
|
2888 |
!UIPainter::ButtonPanel methodsFor:'initialization'!
|
|
2889 |
|
|
2890 |
initialize
|
|
2891 |
"initialize and setup buttons
|
|
2892 |
"
|
|
2893 |
super initialize.
|
|
2894 |
|
|
2895 |
self level:-1.
|
|
2896 |
self borderWidth:0.
|
|
2897 |
self horizontalLayout:#leftSpace.
|
|
2898 |
argumentToSelector := 1.
|
|
2899 |
|
|
2900 |
self specification do:[:anArray|
|
|
2901 |
|selector image button seperator|
|
|
2902 |
|
|
2903 |
selector := anArray at:1.
|
|
2904 |
|
|
2905 |
selector notNil ifTrue:[
|
|
2906 |
image := Image fromFile:( anArray at:2 ).
|
|
2907 |
button := Button label:image in:self.
|
|
2908 |
|
|
2909 |
selector last == $: ifFalse:[
|
|
2910 |
button action:[
|
|
2911 |
receiver notNil ifTrue:[
|
|
2912 |
receiver perform:selector
|
|
2913 |
]
|
|
2914 |
]
|
|
2915 |
] ifTrue:[
|
|
2916 |
button pressAction:[
|
|
2917 |
receiver notNil ifTrue:[
|
|
2918 |
receiver perform:selector with:argumentToSelector
|
|
2919 |
]
|
|
2920 |
].
|
|
2921 |
button autoRepeat:true.
|
|
2922 |
button menuHolder:self; menuMessage:#editMenu; menuPerformer:self.
|
|
2923 |
]
|
|
2924 |
] ifFalse:[
|
|
2925 |
seperator := View in:self.
|
|
2926 |
seperator extent:20@1.
|
|
2927 |
seperator borderWidth:0.
|
|
2928 |
]
|
|
2929 |
].
|
|
2930 |
|
|
2931 |
!
|
|
2932 |
|
|
2933 |
specification
|
|
2934 |
"return a spec for the buttons in the panel;
|
|
2935 |
entries consists of selector and bitmap-filename.
|
|
2936 |
nil selectors are taken as separators (see setupButtonPanel)"
|
|
2937 |
|
|
2938 |
^ #(
|
|
2939 |
#( alignSelectionLeft 'b_alignL.xbm' )
|
|
2940 |
#( alignSelectionRight 'b_alignR.xbm' )
|
|
2941 |
#( alignSelectionLeftAndRight 'b_alignLR.xbm' )
|
|
2942 |
#( nil )
|
|
2943 |
#( alignSelectionTop 'b_alignT.xbm' )
|
|
2944 |
#( alignSelectionBottom 'b_alignB.xbm' )
|
|
2945 |
#( alignSelectionTopAndBottom 'b_alignTB.xbm' )
|
|
2946 |
#( nil )
|
|
2947 |
#( alignSelectionCenterHor 'b_alignCH.xbm' )
|
|
2948 |
#( alignSelectionCenterVer 'b_alignCV.xbm' )
|
|
2949 |
#( nil )
|
|
2950 |
#( moveSelectionLeft: 'b_moveLeft.xbm' )
|
|
2951 |
#( moveSelectionRight: 'b_moveRight.xbm' )
|
|
2952 |
#( moveSelectionUp: 'b_moveUp.xbm' )
|
|
2953 |
#( moveSelectionDown: 'b_moveDown.xbm' )
|
|
2954 |
)
|
|
2955 |
|
|
2956 |
|
|
2957 |
! !
|
|
2958 |
|
|
2959 |
!UIPainter::ButtonPanel methodsFor:'menu'!
|
|
2960 |
|
|
2961 |
editMenu
|
|
2962 |
"edit menu used by buttons using an argument for the receiver; the argumentToSelector
|
|
2963 |
"
|
|
2964 |
|menu|
|
|
2965 |
|
|
2966 |
menu := PopUpMenu labels:#( '1' '2' '4' '10' '20' '..' )
|
|
2967 |
args:#( 1 2 4 10 20 nil ).
|
|
2968 |
|
|
2969 |
menu action:[:anArg||no|
|
|
2970 |
(no := anArg) isNil ifTrue:[
|
|
2971 |
no := EnterBox request:'number'.
|
|
2972 |
no := SmallInteger readFrom:no onError:0.
|
|
2973 |
].
|
|
2974 |
no ~~ 0 ifTrue:[
|
|
2975 |
|index view|
|
|
2976 |
|
|
2977 |
view := (WindowGroup lastEventQuerySignal raise) view.
|
|
2978 |
view := view menuPerformer.
|
|
2979 |
argumentToSelector := no.
|
|
2980 |
view pressAction value.
|
|
2981 |
argumentToSelector := 1.
|
|
2982 |
]
|
|
2983 |
].
|
|
2984 |
^ menu
|
|
2985 |
! !
|
|
2986 |
|
42
|
2987 |
!UIPainter class methodsFor:'documentation'!
|
|
2988 |
|
|
2989 |
version
|
|
2990 |
^ '$Header$'
|
|
2991 |
! !
|