author | ca |
Fri, 18 Jul 1997 07:24:05 +0200 | |
changeset 221 | 319a24a1df06 |
parent 217 | 354ba46948b4 |
child 222 | dd2688307d90 |
permissions | -rw-r--r-- |
156 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
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 |
||
60 | 14 |
ApplicationModel subclass:#UIPainter |
166 | 15 |
instanceVariableNames:'activeHelpTool layoutTool specTool objectList selectionPanel |
16 |
tabSelection specClass specSelector specSuperclass aspects' |
|
60 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-UIPainter' |
|
20 |
! |
|
21 |
||
22 |
!UIPainter class methodsFor:'documentation'! |
|
23 |
||
156 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
||
37 |
! |
|
38 |
||
60 | 39 |
documentation |
40 |
" |
|
127 | 41 |
GUI-Builder: |
42 |
this class allows the user to build its own applications providing a graphical |
|
43 |
user interface to buildin components and to define the behavior of the components |
|
44 |
during runtime. The resulting specifications can be installed as methods on |
|
45 |
classes, typically subclasses of an ApplicationModel. These specifications |
|
46 |
are used by the UIBuilder to generate the application window and its component |
|
47 |
structues when open the application. |
|
60 | 48 |
|
49 |
[start with:] |
|
50 |
UIPainter open |
|
127 | 51 |
|
156 | 52 |
[author:] |
183 | 53 |
Claus Gittinger |
156 | 54 |
Claus Atzkern |
55 |
||
127 | 56 |
[see also:] |
57 |
UIBuilder |
|
58 |
ApplicationModel |
|
59 |
UISpecification |
|
60 | 60 |
" |
109 | 61 |
|
62 |
! ! |
|
63 |
||
64 |
!UIPainter class methodsFor:'instance creation'! |
|
65 |
||
66 |
listHolder:aListHolder |
|
67 |
|application| |
|
68 |
||
69 |
application := self new. |
|
70 |
application objectList:aListHolder. |
|
71 |
^ application open |
|
72 |
! |
|
73 |
||
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
74 |
openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
75 |
^ self new openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
76 |
|
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
77 |
"Created: 1.7.1997 / 19:16:59 / cg" |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
78 |
! |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
79 |
|
109 | 80 |
painter:aBuilderView |
81 |
|application| |
|
82 |
||
83 |
application := self new. |
|
84 |
application painter:aBuilderView. |
|
85 |
^ application open |
|
60 | 86 |
! ! |
87 |
||
87 | 88 |
!UIPainter class methodsFor:'ST-80 queries'! |
89 |
||
90 |
preferenceFor:aSymbol |
|
91 |
^ false |
|
109 | 92 |
|
93 |
||
94 |
! ! |
|
95 |
||
193 | 96 |
!UIPainter class methodsFor:'help specs'! |
97 |
||
98 |
helpSpec |
|
99 |
"return a dictionary filled with helpKey -> helptext associations. |
|
100 |
These are used by the activeHelp tool. |
|
101 |
" |
|
102 |
^ super helpSpec addPairsFrom:#( |
|
103 |
||
104 |
#alignSelectionCenterVer |
|
105 |
'align selection vertical' |
|
106 |
||
107 |
#alignSelectionLeft |
|
108 |
'align selected components to the left edge of the |
|
109 |
dominant component ( underlined )' |
|
110 |
||
111 |
#alignSelectionRight |
|
112 |
'align selected components to the right edge of the |
|
113 |
dominant component ( underlined )' |
|
114 |
||
115 |
#alignSelectionLeftAndRight |
|
116 |
'align selected components to the right and left edge |
|
117 |
of the dominant component ( underlined )' |
|
118 |
||
119 |
#alignSelectionTop |
|
120 |
'align selected components to the top edge of the |
|
121 |
dominant component ( underlined )' |
|
122 |
||
123 |
#alignSelectionBottom |
|
124 |
'align selected components to the bottom edge of the |
|
125 |
dominant component ( underlined )' |
|
126 |
||
127 |
#alignSelectionTopAndBottom |
|
128 |
'align selected components to the top and bottom edge |
|
129 |
of the dominant component ( underlined )' |
|
130 |
||
131 |
#alignSelectionCenterVer |
|
132 |
'align selected components horizontal to the center of |
|
133 |
the dominant component ( underlined )' |
|
134 |
||
135 |
#alignSelectionCenterHor |
|
136 |
'align selected components vertical to the center of |
|
137 |
the dominant component ( underlined )' |
|
138 |
||
194 | 139 |
#spreadSelectionVer |
140 |
'vertical spacing between selected components is made the same' |
|
141 |
||
142 |
#spreadSelectionHor |
|
143 |
'horizontal spacing between selected components is made the same' |
|
144 |
||
145 |
#centerSelectionHor |
|
146 |
'center components horizontal in contained view' |
|
147 |
||
148 |
#centerSelectionVer |
|
149 |
'center vertical horizontal in contained view' |
|
150 |
||
151 |
#setToDefaultExtent |
|
152 |
'set selected components to their default extent' |
|
153 |
||
154 |
#setToDefaultWidth |
|
155 |
'set selected components to their default width' |
|
156 |
||
157 |
#setToDefaultHeight |
|
158 |
'set selected components to their default height' |
|
159 |
||
160 |
#copyExtent |
|
161 |
'copy extent of the selected component' |
|
162 |
||
163 |
#pasteExtent |
|
164 |
'change extent of all selected components to the |
|
165 |
last copied extent' |
|
166 |
||
167 |
#pasteWidth |
|
168 |
'change width of all selected components to the |
|
169 |
last copied extent width' |
|
170 |
||
171 |
#pasteHeight |
|
172 |
'change height of all selected components to the |
|
173 |
last copied extent height' |
|
174 |
||
175 |
#copyLayout |
|
176 |
'copy layout of the selected component' |
|
177 |
||
178 |
#pasteLayout |
|
179 |
'change layout of all selected components to the |
|
180 |
last copied layout' |
|
181 |
||
182 |
#pasteBuffer |
|
183 |
'paste components at current mouse position' |
|
184 |
||
185 |
#pasteWithLayout |
|
186 |
'paste components without changing their layouts' |
|
187 |
||
193 | 188 |
) |
189 |
||
190 |
||
191 |
||
192 |
||
193 |
! ! |
|
194 |
||
118 | 195 |
!UIPainter class methodsFor:'icons'! |
196 |
||
197 |
iconAlignB |
|
198 |
^ Image fromFile:'b_alignB.xbm' |
|
199 |
||
200 |
! |
|
201 |
||
202 |
iconAlignCenterH |
|
203 |
^ Image fromFile:'b_alignCH.xbm' |
|
204 |
||
205 |
! |
|
206 |
||
207 |
iconAlignCenterV |
|
208 |
^ Image fromFile:'b_alignCV.xbm' |
|
209 |
||
210 |
! |
|
211 |
||
212 |
iconAlignL |
|
213 |
^ Image fromFile:'b_alignL.xbm' |
|
214 |
! |
|
215 |
||
216 |
iconAlignLR |
|
217 |
^ Image fromFile:'b_alignLR.xbm' |
|
218 |
||
219 |
! |
|
220 |
||
221 |
iconAlignR |
|
222 |
^ Image fromFile:'b_alignR.xbm' |
|
223 |
||
224 |
! |
|
225 |
||
226 |
iconAlignT |
|
227 |
^ Image fromFile:'b_alignT.xbm' |
|
228 |
||
229 |
! |
|
230 |
||
231 |
iconAlignTB |
|
232 |
^ Image fromFile:'b_alignTB.xbm' |
|
233 |
||
234 |
! ! |
|
235 |
||
60 | 236 |
!UIPainter class methodsFor:'interface specs'! |
237 |
||
118 | 238 |
menuAlignment |
217 | 239 |
"this window spec was automatically generated by the ST/X MenuEditor" |
240 |
||
241 |
"do not manually edit this - the builder may not be able to |
|
242 |
handle the specification if its corrupted." |
|
243 |
||
244 |
" |
|
245 |
MenuEditor new openOnClass:UIPainter andSelector:#menuAlignment |
|
246 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuAlignment)) startUp |
|
247 |
" |
|
248 |
||
249 |
<resource: #menu> |
|
250 |
||
251 |
^ |
|
252 |
||
253 |
#(#Menu |
|
254 |
||
255 |
#( |
|
256 |
#(#MenuItem |
|
257 |
#'label:' 'align left' |
|
258 |
#'value:' #alignSelectionLeft |
|
259 |
#'enabled:' #enableChannel |
|
260 |
#'activeHelpKey:' #alignSelectionLeft |
|
261 |
#'labelImage:' |
|
262 |
#(#ResourceRetriever |
|
263 |
nil #iconAlignL |
|
264 |
) |
|
265 |
) |
|
266 |
#(#MenuItem |
|
267 |
#'label:' 'align right' |
|
268 |
#'value:' #alignSelectionRight |
|
269 |
#'enabled:' #enableChannel |
|
270 |
#'activeHelpKey:' #alignSelectionRight |
|
271 |
#'labelImage:' |
|
272 |
#(#ResourceRetriever |
|
273 |
nil #iconAlignR |
|
274 |
) |
|
275 |
) |
|
276 |
#(#MenuItem |
|
277 |
#'label:' 'align left & right' |
|
278 |
#'value:' #alignSelectionLeftAndRight |
|
279 |
#'enabled:' #enableChannel |
|
280 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
281 |
#'labelImage:' |
|
282 |
#(#ResourceRetriever |
|
283 |
nil #iconAlignLR |
|
118 | 284 |
) |
217 | 285 |
) |
286 |
#(#MenuItem |
|
287 |
#'label:' 'align top' |
|
288 |
#'value:' #alignSelectionTop |
|
289 |
#'enabled:' #enableChannel |
|
290 |
#'activeHelpKey:' #alignSelectionTop |
|
291 |
#'labelImage:' |
|
292 |
#(#ResourceRetriever |
|
293 |
nil #iconAlignT |
|
294 |
) |
|
295 |
) |
|
296 |
#(#MenuItem |
|
297 |
#'label:' 'align bottom' |
|
298 |
#'value:' #alignSelectionBottom |
|
299 |
#'enabled:' #enableChannel |
|
300 |
#'activeHelpKey:' #alignSelectionBottom |
|
301 |
#'labelImage:' |
|
302 |
#(#ResourceRetriever |
|
303 |
nil #iconAlignB |
|
304 |
) |
|
305 |
) |
|
306 |
#(#MenuItem |
|
307 |
#'label:' 'align top & bottom' |
|
308 |
#'value:' #alignSelectionTopAndBottom |
|
309 |
#'enabled:' #enableChannel |
|
310 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
311 |
#'labelImage:' |
|
312 |
#(#ResourceRetriever |
|
313 |
nil #iconAlignTB |
|
314 |
) |
|
315 |
) |
|
316 |
#(#MenuItem |
|
317 |
#'label:' 'align centered horizontal' |
|
318 |
#'value:' #alignSelectionCenterHor |
|
319 |
#'enabled:' #enableChannel |
|
320 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
321 |
#'labelImage:' |
|
322 |
#(#ResourceRetriever |
|
323 |
nil #iconAlignCenterH |
|
324 |
) |
|
325 |
) |
|
326 |
#(#MenuItem |
|
327 |
#'label:' 'align centered vertical' |
|
328 |
#'value:' #alignSelectionCenterVer |
|
329 |
#'enabled:' #enableChannel |
|
330 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
331 |
#'labelImage:' |
|
332 |
#(#ResourceRetriever |
|
333 |
nil #iconAlignCenterV |
|
334 |
) |
|
335 |
) |
|
336 |
) |
|
337 |
#( 3 3 ) |
|
338 |
nil |
|
339 |
) |
|
118 | 340 |
! |
341 |
||
342 |
menuPullDown |
|
217 | 343 |
"this window spec was automatically generated by the ST/X MenuEditor" |
344 |
||
345 |
"do not manually edit this - the builder may not be able to |
|
346 |
handle the specification if its corrupted." |
|
347 |
||
348 |
" |
|
349 |
MenuEditor new openOnClass:UIPainter andSelector:#menuPullDown |
|
350 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuPullDown)) startUp |
|
351 |
" |
|
352 |
||
353 |
<resource: #menu> |
|
354 |
||
355 |
^ |
|
356 |
||
357 |
#(#Menu |
|
358 |
||
359 |
#( |
|
360 |
#(#MenuItem |
|
109 | 361 |
#'label:' 'file' |
114 | 362 |
#'value:' #file |
217 | 363 |
#'enabled:' #enableChannel |
364 |
#'submenu:' |
|
365 |
#(#Menu |
|
366 |
||
367 |
#( |
|
368 |
#(#MenuItem |
|
369 |
#'label:' 'new' |
|
370 |
#'value:' #doNew |
|
371 |
) |
|
372 |
#(#MenuItem |
|
373 |
#'label:' 'from class ...' |
|
374 |
#'value:' #doFromClass |
|
375 |
) |
|
376 |
#(#MenuItem |
|
377 |
#'label:' 'pick a view ' |
|
378 |
#'value:' #doPickAView |
|
379 |
) |
|
380 |
#(#MenuItem |
|
381 |
#'label:' '-' |
|
382 |
) |
|
383 |
#(#MenuItem |
|
384 |
#'label:' 'raise' |
|
385 |
#'value:' #doRaise |
|
386 |
) |
|
387 |
#(#MenuItem |
|
388 |
#'label:' '=' |
|
389 |
) |
|
390 |
#(#MenuItem |
|
391 |
#'label:' 'quit' |
|
392 |
#'value:' #closeRequest |
|
393 |
) |
|
394 |
) nil |
|
395 |
nil |
|
396 |
) |
|
397 |
) |
|
398 |
#(#MenuItem |
|
109 | 399 |
#'label:' 'misc' |
114 | 400 |
#'value:' #misc |
217 | 401 |
#'enabled:' #enableChannel |
402 |
#'submenu:' |
|
403 |
#(#Menu |
|
404 |
||
405 |
#( |
|
406 |
#(#MenuItem |
|
407 |
#'label:' 'grid' |
|
408 |
#'value:' #grid |
|
409 |
#'submenu:' |
|
410 |
#(#Menu |
|
411 |
||
412 |
#( |
|
413 |
#(#MenuItem |
|
414 |
#'label:' 'show' |
|
415 |
#'indication:' #'gridShown:' |
|
416 |
) |
|
417 |
#(#MenuItem |
|
418 |
#'label:' 'align' |
|
419 |
#'indication:' #'gridAlign:' |
|
109 | 420 |
) |
217 | 421 |
) nil |
422 |
nil |
|
423 |
) |
|
424 |
) |
|
425 |
#(#MenuItem |
|
426 |
#'label:' 'undo' |
|
427 |
#'value:' #undo |
|
428 |
#'submenu:' |
|
429 |
#(#Menu |
|
430 |
||
431 |
#( |
|
432 |
#(#MenuItem |
|
433 |
#'label:' 'last' |
|
434 |
#'value:' #undoLast |
|
435 |
) |
|
436 |
#(#MenuItem |
|
437 |
#'label:' 'menu' |
|
438 |
#'value:' #openUndoMenu |
|
439 |
) |
|
440 |
#(#MenuItem |
|
441 |
#'label:' '-' |
|
442 |
) |
|
443 |
#(#MenuItem |
|
444 |
#'label:' 'delete' |
|
445 |
#'value:' #removeUndoHistory |
|
446 |
) |
|
447 |
) nil |
|
448 |
nil |
|
449 |
) |
|
450 |
) |
|
451 |
) nil |
|
452 |
nil |
|
453 |
) |
|
454 |
) |
|
455 |
#(#MenuItem |
|
109 | 456 |
#'label:' 'code' |
114 | 457 |
#'value:' #code |
217 | 458 |
#'enabled:' #enableChannel |
459 |
#'submenu:' |
|
460 |
#(#Menu |
|
461 |
||
462 |
#( |
|
463 |
#(#MenuItem |
|
464 |
#'label:' 'class && method ...' |
|
465 |
#'value:' #defineClassAndSelector |
|
466 |
) |
|
467 |
#(#MenuItem |
|
468 |
#'label:' '=' |
|
469 |
) |
|
470 |
#(#MenuItem |
|
471 |
#'label:' 'install window spec.' |
|
472 |
#'value:' #doInstallSpec |
|
473 |
#'enabled:' #hasSpecClassAndSelector |
|
474 |
) |
|
475 |
#(#MenuItem |
|
476 |
#'label:' 'install help spec.' |
|
477 |
#'value:' #doInstallHelp |
|
478 |
#'enabled:' #hasSpecClass |
|
479 |
) |
|
480 |
#(#MenuItem |
|
481 |
#'label:' '-' |
|
482 |
) |
|
483 |
#(#MenuItem |
|
484 |
#'label:' 'install aspects' |
|
485 |
#'value:' #doInstallAspects |
|
486 |
#'enabled:' #hasSpecClass |
|
487 |
) |
|
488 |
#(#MenuItem |
|
489 |
#'label:' '=' |
|
490 |
) |
|
491 |
#(#MenuItem |
|
492 |
#'label:' 'show window spec.' |
|
493 |
#'value:' #doWindowSpec |
|
494 |
) |
|
495 |
#(#MenuItem |
|
496 |
#'label:' '=' |
|
497 |
) |
|
498 |
#(#MenuItem |
|
499 |
#'label:' 'browse application' |
|
500 |
#'value:' #doBrowseAppClass |
|
501 |
#'enabled:' #hasSpecClass |
|
502 |
) |
|
503 |
#(#MenuItem |
|
504 |
#'label:' 'start application' |
|
505 |
#'value:' #doStartApplication |
|
506 |
#'enabled:' #hasSpecClass |
|
507 |
) |
|
508 |
) nil |
|
509 |
nil |
|
510 |
) |
|
511 |
) |
|
512 |
#(#MenuItem |
|
109 | 513 |
#'label:' 'test' |
118 | 514 |
#'nameKey:' #test |
114 | 515 |
#'value:' #test |
217 | 516 |
#'submenu:' |
517 |
#(#Menu |
|
518 |
||
519 |
#( |
|
520 |
#(#MenuItem |
|
521 |
#'label:' 'test mode' |
|
522 |
#'indication:' #'testMode:' |
|
523 |
) |
|
524 |
) nil |
|
525 |
nil |
|
526 |
) |
|
527 |
) |
|
528 |
) nil |
|
529 |
nil |
|
109 | 530 |
) |
531 |
! |
|
532 |
||
60 | 533 |
nameAndSelectorSpec |
534 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
535 |
||
536 |
"do not manually edit this - the painter/builder may not be able to |
|
537 |
handle the specification if its corrupted." |
|
538 |
||
539 |
" |
|
540 |
UIPainter new openOnClass:UIPainter andSelector:#nameAndSelectorSpec |
|
541 |
UIPainter new openInterface:#nameAndSelectorSpec |
|
542 |
" |
|
543 |
||
544 |
<resource: #canvas> |
|
545 |
||
546 |
^ |
|
142 | 547 |
|
60 | 548 |
#(#FullSpec |
549 |
#'window:' |
|
550 |
#(#WindowSpec |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
551 |
#'name:' 'uIPainterView' |
60 | 552 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
176 | 553 |
#'label:' 'Painter' |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
554 |
#'bounds:' #(#Rectangle 0 0 391 170) |
60 | 555 |
) |
556 |
#'component:' |
|
557 |
#(#SpecCollection |
|
558 |
#'collection:' |
|
559 |
#( |
|
560 |
#(#LabelSpec |
|
176 | 561 |
#'name:' 'classLabel' |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
562 |
#'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5) |
60 | 563 |
#'label:' 'class:' |
564 |
#'adjust:' #right |
|
176 | 565 |
#'resizeForLabel:' true |
60 | 566 |
) |
567 |
#(#LabelSpec |
|
176 | 568 |
#'name:' 'superClassLabel' |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
569 |
#'layout:' #(#AlignmentOrigin 45 0.11 77 0 1 0.5) |
60 | 570 |
#'label:' 'superclass:' |
571 |
#'adjust:' #right |
|
176 | 572 |
#'resizeForLabel:' true |
60 | 573 |
) |
574 |
#(#LabelSpec |
|
176 | 575 |
#'name:' 'selectorLabel' |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
576 |
#'layout:' #(#AlignmentOrigin 45 0.11 105 0 1 0.5) |
60 | 577 |
#'label:' 'selector:' |
578 |
#'adjust:' #right |
|
176 | 579 |
#'resizeForLabel:' true |
60 | 580 |
) |
581 |
#(#InputFieldSpec |
|
582 |
#'name:' 'methodNameField' |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
583 |
#'layout:' #(#LayoutFrame 47 0.11 95 0 -5 1.0 117 0) |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
584 |
#'tabable:' true |
60 | 585 |
#'model:' #methodNameChannel |
586 |
) |
|
587 |
#(#LabelSpec |
|
588 |
#'name:' 'boxLabel' |
|
176 | 589 |
#'layout:' #(#Point 5 10) |
92 | 590 |
#'label:' 'class & selector for code:' |
591 |
#'adjust:' #left |
|
176 | 592 |
#'resizeForLabel:' true |
593 |
) |
|
594 |
#(#InputFieldSpec |
|
595 |
#'name:' 'classNameField' |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
596 |
#'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0) |
176 | 597 |
#'tabable:' true |
598 |
#'model:' #classNameChannel |
|
60 | 599 |
) |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
600 |
#(#ComboBoxSpec |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
601 |
#'name:' 'comboBox1' |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
602 |
#'layout:' #(#LayoutFrame 47 0.11 67 0 -5 1.0 89 0) |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
603 |
#'tabable:' true |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
604 |
#'model:' #superclassNameChannel |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
605 |
#'comboList:' #superclassNameDefaults |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
606 |
) |
176 | 607 |
#(#HorizontalPanelViewSpec |
608 |
#'name:' 'commitPanel' |
|
609 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0) |
|
610 |
#'component:' |
|
611 |
#(#SpecCollection |
|
612 |
#'collection:' |
|
613 |
#( |
|
614 |
#(#ActionButtonSpec |
|
615 |
#'name:' 'button1' |
|
616 |
#'label:' 'cancel' |
|
617 |
#'tabable:' true |
|
618 |
#'model:' #cancel |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
619 |
#'extent:' #(#Point 191 24) |
176 | 620 |
) |
621 |
#(#ActionButtonSpec |
|
622 |
#'name:' 'button2' |
|
623 |
#'label:' 'ok' |
|
624 |
#'tabable:' true |
|
625 |
#'isDefault:' true |
|
626 |
#'model:' #accept |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
627 |
#'extent:' #(#Point 191 24) |
176 | 628 |
) |
629 |
) |
|
630 |
) |
|
631 |
#'horizontalLayout:' #fitSpace |
|
632 |
#'verticalLayout:' #fit |
|
633 |
#'horizontalSpace:' 3 |
|
634 |
#'verticalSpace:' 3 |
|
635 |
) |
|
60 | 636 |
) |
637 |
) |
|
638 |
) |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
639 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
640 |
"Modified: 24.6.1997 / 18:50:14 / cg" |
109 | 641 |
! |
642 |
||
643 |
windowSpec |
|
644 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
645 |
||
646 |
"do not manually edit this - the painter/builder may not be able to |
|
647 |
handle the specification if its corrupted." |
|
648 |
||
649 |
" |
|
650 |
UIPainter new openOnClass:UIPainter andSelector:#windowSpec |
|
651 |
UIPainter new openInterface:#windowSpec |
|
652 |
" |
|
653 |
"UIPainter open" |
|
654 |
||
655 |
<resource: #canvas> |
|
656 |
||
657 |
^ |
|
658 |
||
659 |
#(#FullSpec |
|
171 | 660 |
#'flags:' 0 |
109 | 661 |
#'window:' |
662 |
#(#WindowSpec |
|
663 |
#'name:' 'uIPainterView' |
|
664 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
171 | 665 |
#'flags:' 0 |
109 | 666 |
#'label:' 'Tree-View' |
171 | 667 |
#'bounds:' #(#Rectangle 0 0 524 456) |
109 | 668 |
) |
669 |
#'component:' |
|
670 |
#(#SpecCollection |
|
671 |
#'collection:' |
|
672 |
#( |
|
673 |
#(#MenuPanelSpec |
|
137 | 674 |
#'name:' 'menuPullDown' |
171 | 675 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0) |
676 |
#'flags:' 0 |
|
144 | 677 |
#'tabable:' true |
118 | 678 |
#'menu:' #menuPullDown |
109 | 679 |
) |
137 | 680 |
#(#MenuPanelSpec |
681 |
#'name:' 'menuAlignment' |
|
682 |
#'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0) |
|
171 | 683 |
#'flags:' 0 |
144 | 684 |
#'tabable:' true |
137 | 685 |
#'menu:' #menuAlignment |
686 |
#'showSeparatingLines:' true |
|
687 |
) |
|
688 |
#(#PanelViewSpec |
|
689 |
#'name:' 'panelViewButtons' |
|
149 | 690 |
#'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0) |
171 | 691 |
#'flags:' 0 |
137 | 692 |
#'component:' |
693 |
#(#SpecCollection |
|
694 |
#'collection:' |
|
695 |
#( |
|
696 |
#(#ActionButtonSpec |
|
697 |
#'name:' 'moveLeft' |
|
171 | 698 |
#'flags:' 0 |
137 | 699 |
#'label:' '' |
700 |
#'translateLabel:' true |
|
701 |
#'labelChannel:' #'LABELb_moveLeft.xbm' |
|
144 | 702 |
#'tabable:' true |
137 | 703 |
#'defaultable:' true |
704 |
#'model:' #moveSelectionLeft |
|
705 |
#'isTriggerOnDown:' true |
|
706 |
#'enableChannel:' #enableChannel |
|
707 |
#'extent:' #(#Point 26 24) |
|
708 |
) |
|
709 |
#(#ActionButtonSpec |
|
710 |
#'name:' 'moveRight' |
|
171 | 711 |
#'flags:' 0 |
137 | 712 |
#'label:' '' |
713 |
#'translateLabel:' true |
|
714 |
#'labelChannel:' #'LABELb_moveRight.xbm' |
|
144 | 715 |
#'tabable:' true |
137 | 716 |
#'defaultable:' true |
717 |
#'model:' #moveSelectionRight |
|
718 |
#'isTriggerOnDown:' true |
|
719 |
#'enableChannel:' #enableChannel |
|
720 |
#'extent:' #(#Point 26 24) |
|
721 |
) |
|
722 |
#(#ActionButtonSpec |
|
723 |
#'name:' 'moveUp' |
|
171 | 724 |
#'flags:' 0 |
137 | 725 |
#'label:' '' |
726 |
#'translateLabel:' true |
|
727 |
#'labelChannel:' #'LABELb_moveUp.xbm' |
|
144 | 728 |
#'tabable:' true |
137 | 729 |
#'defaultable:' true |
730 |
#'model:' #moveSelectionUp |
|
731 |
#'isTriggerOnDown:' true |
|
732 |
#'enableChannel:' #enableChannel |
|
733 |
#'extent:' #(#Point 26 24) |
|
734 |
) |
|
735 |
#(#ActionButtonSpec |
|
736 |
#'name:' 'moveDown' |
|
171 | 737 |
#'flags:' 0 |
137 | 738 |
#'label:' '' |
739 |
#'translateLabel:' true |
|
740 |
#'labelChannel:' #'LABELb_moveDown.xbm' |
|
144 | 741 |
#'tabable:' true |
137 | 742 |
#'defaultable:' true |
743 |
#'model:' #moveSelectionDown |
|
744 |
#'isTriggerOnDown:' true |
|
745 |
#'enableChannel:' #enableChannel |
|
746 |
#'extent:' #(#Point 26 24) |
|
747 |
) |
|
748 |
) |
|
749 |
) |
|
750 |
#'level:' 1 |
|
751 |
#'horizontalLayout:' #fitSpace |
|
752 |
#'verticalLayout:' #fitSpace |
|
753 |
#'horizontalSpace:' 4 |
|
754 |
#'verticalSpace:' 4 |
|
755 |
) |
|
756 |
#(#SequenceViewSpec |
|
757 |
#'name:' 'objectTree' |
|
149 | 758 |
#'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 -25 1.0) |
171 | 759 |
#'flags:' 0 |
137 | 760 |
#'enableChannel:' #enableChannel |
144 | 761 |
#'tabable:' true |
137 | 762 |
#'menu:' #objectListMenu |
763 |
#'model:' #objectList |
|
764 |
#'hasHorizontalScrollBar:' true |
|
765 |
#'hasVerticalScrollBar:' true |
|
766 |
#'miniScrollerHorizontal:' true |
|
767 |
#'isMultiSelect:' true |
|
768 |
#'doubleClickSelector:' #doubleClick |
|
769 |
#'useIndex:' true |
|
770 |
) |
|
771 |
#(#NoteBookViewSpec |
|
772 |
#'name:' 'noteBook' |
|
149 | 773 |
#'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -55 1.0) |
171 | 774 |
#'flags:' 0 |
137 | 775 |
#'enableChannel:' #enableChannel |
144 | 776 |
#'tabable:' true |
137 | 777 |
#'menu:' #tabList |
778 |
#'style:' |
|
779 |
#(#FontDescription |
|
144 | 780 |
#helvetica #medium |
137 | 781 |
#roman #'10' |
782 |
) |
|
783 |
#'model:' #tabModel |
|
784 |
#'tabWidget:' #Window |
|
785 |
#'canvas:' #noteBookView |
|
786 |
) |
|
787 |
#(#HorizontalPanelViewSpec |
|
788 |
#'name:' 'modifyPanel' |
|
149 | 789 |
#'layout:' #(#LayoutFrame 0 0.35 -55 1.0 0 1.0 -25 1.0) |
171 | 790 |
#'flags:' 0 |
137 | 791 |
#'component:' |
792 |
#(#SpecCollection |
|
793 |
#'collection:' |
|
794 |
#( |
|
795 |
#(#ActionButtonSpec |
|
796 |
#'name:' 'cancelButton' |
|
171 | 797 |
#'flags:' 0 |
137 | 798 |
#'label:' 'cancel' |
144 | 799 |
#'tabable:' true |
137 | 800 |
#'model:' #cancel |
801 |
#'enableChannel:' #modifiedChannel |
|
171 | 802 |
#'extent:' #(#Point 166 24) |
137 | 803 |
) |
804 |
#(#ActionButtonSpec |
|
805 |
#'name:' 'acceptButton' |
|
171 | 806 |
#'flags:' 0 |
137 | 807 |
#'label:' 'ok' |
144 | 808 |
#'tabable:' true |
137 | 809 |
#'model:' #accept |
810 |
#'enableChannel:' #modifiedChannel |
|
171 | 811 |
#'extent:' #(#Point 166 24) |
137 | 812 |
) |
813 |
) |
|
814 |
) |
|
815 |
#'level:' 0 |
|
816 |
#'horizontalLayout:' #fitSpace |
|
817 |
#'verticalLayout:' #fitSpace |
|
818 |
#'horizontalSpace:' 3 |
|
819 |
#'verticalSpace:' 3 |
|
820 |
) |
|
149 | 821 |
#(#LabelSpec |
822 |
#'name:' 'helpInfo' |
|
823 |
#'layout:' #(#LayoutFrame 2 0.0 -25 1.0 -2 1.0 -2 1.0) |
|
171 | 824 |
#'flags:' 0 |
149 | 825 |
#'label:' '' |
826 |
#'level:' -1 |
|
827 |
#'adjust:' #left |
|
828 |
) |
|
173 | 829 |
#(#ToggleSpec |
830 |
#'name:' 'galleryLabel' |
|
831 |
#'layout:' #(#LayoutFrame -162 1.0 1 0 -82 1.0 23 0) |
|
171 | 832 |
#'flags:' 0 |
833 |
#'label:' 'Gallery' |
|
173 | 834 |
#'model:' #galleryShown |
835 |
#'isTriggerOnDown:' true |
|
836 |
#'showLamp:' true |
|
837 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
171 | 838 |
) |
173 | 839 |
#(#ToggleSpec |
840 |
#'name:' 'painterLabel' |
|
841 |
#'layout:' #(#LayoutFrame -81 1.0 1 0 -1 1.0 23 0) |
|
171 | 842 |
#'flags:' 0 |
843 |
#'label:' 'Painter' |
|
173 | 844 |
#'model:' #painterShown |
845 |
#'isTriggerOnDown:' true |
|
846 |
#'showLamp:' true |
|
847 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
171 | 848 |
) |
109 | 849 |
) |
850 |
) |
|
851 |
) |
|
60 | 852 |
! ! |
853 |
||
109 | 854 |
!UIPainter methodsFor:'actions'! |
60 | 855 |
|
109 | 856 |
accept |
857 |
|layout| |
|
60 | 858 |
|
166 | 859 |
objectList removeDependent:self. |
860 |
||
861 |
self isLayoutToolSelected ifTrue:[ |
|
144 | 862 |
(layout := layoutTool layout) notNil ifTrue:[ |
863 |
layoutTool layoutType == #Extent ifTrue:[ |
|
864 |
self painter setExtent:layout |
|
865 |
] ifFalse:[ |
|
149 | 866 |
self painter setLayout:layout |
109 | 867 |
] |
144 | 868 |
] |
869 |
] ifFalse:[ |
|
166 | 870 |
self isHelpToolSelected ifTrue:[ |
149 | 871 |
activeHelpTool accept |
872 |
]. |
|
171 | 873 |
self painter updateFromSpec:(specTool specification). |
144 | 874 |
]. |
166 | 875 |
self modifiedChannel value:false. |
876 |
objectList addDependent:self. |
|
109 | 877 |
|
878 |
! |
|
879 |
||
880 |
cancel |
|
881 |
"cancel all changes and read back attributes from current view |
|
882 |
" |
|
166 | 883 |
self modifiedChannel value ifTrue:[ |
171 | 884 |
specTool specification:(self painter specForSelection). |
166 | 885 |
layoutTool layoutView:(layoutTool layoutView). |
886 |
self modifiedChannel value:false. |
|
887 |
] |
|
137 | 888 |
! |
889 |
||
890 |
doubleClick |
|
891 |
objectList selectGroup |
|
217 | 892 |
! |
893 |
||
894 |
openEditMenu |
|
895 |
|cls aspect editor| |
|
896 |
||
897 |
specClass isNil ifTrue:[ |
|
898 |
^ self information:'no class yet'. |
|
899 |
]. |
|
900 |
(cls := specClass) isBehavior ifFalse:[ |
|
901 |
cls := Smalltalk at:specClass asSymbol. |
|
902 |
cls isNil ifTrue:[ |
|
903 |
^ self information:'no class yet' |
|
904 |
] |
|
905 |
]. |
|
906 |
||
907 |
cls notNil ifTrue:[ |
|
908 |
(aspect := specTool specification menu) notNil ifTrue:[ |
|
909 |
aspect := aspect asSymbol |
|
910 |
]. |
|
911 |
editor := MenuEditor new. |
|
912 |
editor masterApplication:self. |
|
913 |
editor activeHelpTool:(self activeHelpTool). |
|
914 |
editor openModalOnClass:cls andSelector:aspect |
|
915 |
] |
|
916 |
||
917 |
||
60 | 918 |
! ! |
919 |
||
149 | 920 |
!UIPainter methodsFor:'active help'! |
921 |
||
197 | 922 |
activeHelpTool |
923 |
"setup help tool |
|
171 | 924 |
" |
149 | 925 |
activeHelpTool isNil ifTrue:[ |
152 | 926 |
activeHelpTool := UIHelpTool new. |
197 | 927 |
activeHelpTool helpSpecFrom:specClass. |
217 | 928 |
activeHelpTool masterApplication:self. |
149 | 929 |
]. |
930 |
^ activeHelpTool |
|
931 |
! |
|
932 |
||
933 |
showHelp:aHelpText for:view |
|
934 |
"hook to allow an application to display active help |
|
935 |
texts in its own info area. |
|
936 |
This method may be redefined in a concrete application. |
|
937 |
If it returns false, the ActiveHelp manager will popup a |
|
938 |
bubble with the help text." |
|
939 |
||
940 |
|l| |
|
941 |
||
942 |
(l := self builder componentAt:#helpInfo) notNil ifTrue:[ |
|
152 | 943 |
aHelpText replaceAll:(Character cr) by:(Character space). |
149 | 944 |
l label:aHelpText. |
152 | 945 |
^ true. |
149 | 946 |
]. |
947 |
^ false |
|
948 |
||
949 |
||
950 |
! ! |
|
951 |
||
60 | 952 |
!UIPainter methodsFor:'aspects'! |
953 |
||
118 | 954 |
enableChannel |
955 |
"true if modifications are allowed otherwise running test |
|
956 |
" |
|
957 |
^ self painter enableChannel |
|
109 | 958 |
! |
959 |
||
173 | 960 |
galleryShown |
961 |
|holder| |
|
962 |
||
963 |
(holder := builder bindingAt:#galleryShown) isNil ifTrue:[ |
|
964 |
builder aspectAt:#galleryShown put:(holder := true asValue). |
|
965 |
holder addDependent:self |
|
966 |
]. |
|
967 |
^ holder |
|
968 |
||
969 |
! |
|
970 |
||
109 | 971 |
modifiedChannel |
972 |
||
973 |
|holder| |
|
974 |
||
975 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
976 |
builder aspectAt:#modifiedChannel put:(holder := false asValue). |
|
977 |
]. |
|
978 |
^ holder |
|
979 |
! |
|
980 |
||
981 |
noteBookView |
|
982 |
"automatically generated by UIPainter ..." |
|
983 |
||
166 | 984 |
|noteBook channel n1 n2| |
109 | 985 |
|
986 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
166 | 987 |
noteBook := View new. |
988 |
layoutTool := UILayoutTool new. |
|
989 |
specTool := UISpecificationTool new. |
|
144 | 990 |
channel := self modifiedChannel. |
166 | 991 |
|
152 | 992 |
layoutTool masterApplication:self. |
166 | 993 |
specTool masterApplication:self. |
994 |
||
995 |
n1 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
996 |
n2 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
997 |
||
998 |
n1 client:layoutTool. |
|
999 |
specTool builder:(n2 client:specTool). |
|
1000 |
||
1001 |
layoutTool masterApplication:self. |
|
1002 |
specTool masterApplication:self. |
|
109 | 1003 |
layoutTool modifiedHolder:channel. |
166 | 1004 |
specTool modifiedHolder:channel. |
109 | 1005 |
builder aspectAt:#noteBookView put:noteBook. |
1006 |
]. |
|
1007 |
^ noteBook |
|
1008 |
! |
|
1009 |
||
1010 |
objectList |
|
1011 |
^ objectList |
|
1012 |
! |
|
1013 |
||
1014 |
objectListMenu |
|
1015 |
"returns a block which returns the menu |
|
114 | 1016 |
!!hack!! |
109 | 1017 |
" |
121 | 1018 |
^ [ self painter showMiddleButtonMenu ]. |
109 | 1019 |
|
1020 |
||
1021 |
||
1022 |
! |
|
1023 |
||
173 | 1024 |
painterShown |
1025 |
|holder| |
|
1026 |
||
1027 |
(holder := builder bindingAt:#painterShown) isNil ifTrue:[ |
|
1028 |
builder aspectAt:#painterShown put:(holder := true asValue). |
|
1029 |
holder addDependent:self |
|
1030 |
]. |
|
1031 |
^ holder |
|
1032 |
||
1033 |
! |
|
1034 |
||
109 | 1035 |
tabList |
1036 |
"automatically generated by UIPainter ..." |
|
1037 |
||
1038 |
|holder| |
|
1039 |
||
1040 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
1041 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 1042 |
holder value:#( 'Properties' ). |
109 | 1043 |
]. |
1044 |
^ holder |
|
1045 |
! |
|
1046 |
||
1047 |
tabModel |
|
1048 |
"automatically generated by UIPainter ..." |
|
1049 |
||
1050 |
|holder| |
|
1051 |
||
1052 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1053 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
1054 |
builder aspectAt:#tabModel put:holder. |
|
1055 |
]. |
|
1056 |
^ holder |
|
60 | 1057 |
! ! |
1058 |
||
109 | 1059 |
!UIPainter methodsFor:'binding access'! |
1060 |
||
1061 |
aspectFor:aKey |
|
1062 |
"check wether aspect is assigned to a label icon |
|
1063 |
" |
|
1064 |
(aKey startsWith:'LABEL') ifFalse:[ |
|
1065 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
|
1066 |
]. |
|
1067 |
^ Image fromFile:(aKey copyFrom:(('LABEL' size) + 1)) |
|
1068 |
! ! |
|
1069 |
||
1070 |
!UIPainter methodsFor:'change & update'! |
|
1071 |
||
1072 |
update:something with:aParameter from:someObject |
|
1073 |
||
1074 |
(someObject == objectList and:[something ~~ #list]) ifTrue:[ |
|
1075 |
something ~~ #layout ifTrue:[ |
|
1076 |
self objectListChanged |
|
1077 |
] ifFalse:[ |
|
166 | 1078 |
self modifiedChannel value ifTrue:[ |
1079 |
^ self |
|
1080 |
]. |
|
1081 |
layoutTool update |
|
1082 |
]. |
|
173 | 1083 |
^ self modifiedChannel value:false |
1084 |
]. |
|
1085 |
||
1086 |
self galleryShown == someObject ifTrue:[ |
|
1087 |
(self galleryShown value) ifTrue:[ |
|
1088 |
self raiseUIView:(selectionPanel window) |
|
1089 |
] ifFalse:[ |
|
1090 |
self hideUIView:(selectionPanel window) |
|
1091 |
]. |
|
1092 |
^ self |
|
1093 |
]. |
|
1094 |
||
1095 |
self painterShown == someObject ifTrue:[ |
|
1096 |
(self painterShown value) ifTrue:[ |
|
1097 |
self raiseUIView:(self painter topView) |
|
1098 |
] ifFalse:[ |
|
1099 |
self hideUIView:(self painter topView) |
|
1100 |
]. |
|
1101 |
^ self |
|
1102 |
]. |
|
1103 |
||
109 | 1104 |
! ! |
1105 |
||
1106 |
!UIPainter methodsFor:'event handling'! |
|
1107 |
||
1108 |
doesNotUnderstand:aMessage |
|
1109 |
|painter| |
|
1110 |
||
1111 |
painter := self painter. |
|
1112 |
||
1113 |
(painter respondsTo:(aMessage selector)) ifTrue:[ |
|
1114 |
^ aMessage sendTo:painter |
|
1115 |
]. |
|
149 | 1116 |
super doesNotUnderstand:aMessage |
109 | 1117 |
|
1118 |
! |
|
1119 |
||
1120 |
objectListChanged |
|
1121 |
"something changed in the painter view |
|
1122 |
" |
|
171 | 1123 |
|oldSelection view slices list spec props size nameOfSpec| |
109 | 1124 |
|
1125 |
props := objectList selectedProperty. |
|
166 | 1126 |
oldSelection := tabSelection. |
109 | 1127 |
tabSelection := nil. |
1128 |
||
1129 |
props isNil ifFalse:[ |
|
144 | 1130 |
view := props view. |
1131 |
spec := props spec copy. |
|
142 | 1132 |
|
166 | 1133 |
layoutTool layoutView == view ifFalse:[ |
144 | 1134 |
slices := spec class slices. |
1135 |
size := slices size + 1. |
|
1136 |
list := Array new:size. |
|
1137 |
slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)]. |
|
166 | 1138 |
list at:size put:(layoutTool class label). |
144 | 1139 |
(self tabList) value:list. |
1140 |
] ifTrue:[ |
|
1141 |
list := self tabList value |
|
142 | 1142 |
]. |
166 | 1143 |
(list findFirst:[:n| n = oldSelection ]) ~~ 0 ifTrue:[ |
1144 |
tabSelection := oldSelection |
|
1145 |
] ifFalse:[ |
|
1146 |
tabSelection := list first |
|
171 | 1147 |
]. |
1148 |
nameOfSpec := spec class name. |
|
1149 |
] ifTrue:[ |
|
1150 |
nameOfSpec := '' |
|
109 | 1151 |
]. |
171 | 1152 |
|
1153 |
self showHelp:nameOfSpec for:nil. |
|
1154 |
||
166 | 1155 |
layoutTool layoutView:view. |
171 | 1156 |
specTool specification:spec. |
60 | 1157 |
|
166 | 1158 |
tabSelection notNil ifTrue:[ |
1159 |
self isLayoutToolSelected ifTrue:[ |
|
1160 |
(self noteBookView subViews at:1) raise |
|
1161 |
] ifFalse:[ |
|
1162 |
specTool selection:tabSelection. |
|
1163 |
(self noteBookView subViews at:2) raise |
|
1164 |
] |
|
60 | 1165 |
]. |
1166 |
||
168 | 1167 |
(builder componentAt:#noteBook) setSelection:tabSelection. |
166 | 1168 |
self modifiedChannel value:false. |
60 | 1169 |
! ! |
1170 |
||
109 | 1171 |
!UIPainter methodsFor:'private'! |
1172 |
||
173 | 1173 |
hideUIView:aView |
1174 |
aView beIndependent. |
|
1175 |
aView unmap. |
|
1176 |
! |
|
1177 |
||
109 | 1178 |
painter |
1179 |
^ objectList painter |
|
173 | 1180 |
! |
1181 |
||
1182 |
raiseUIView:aView |
|
1183 |
aView map. |
|
1184 |
aView bePartner. |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1185 |
! |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1186 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1187 |
setClass:cls selector:selector |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1188 |
|clsName superClassName| |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1189 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1190 |
clsName := cls name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1191 |
superClassName := cls superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1192 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1193 |
(self aspectFor:#classNameChannel) value:clsName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1194 |
(self aspectFor:#methodNameChannel) value:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1195 |
(self aspectFor:#superclassNameChannel) value:superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1196 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1197 |
self painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1198 |
className:clsName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1199 |
superclassName:superClassName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1200 |
selector:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1201 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1202 |
specClass := clsName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1203 |
specSelector := (selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1204 |
specSuperclass := superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1205 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1206 |
"Modified: 24.6.1997 / 19:07:01 / cg" |
109 | 1207 |
! ! |
1208 |
||
166 | 1209 |
!UIPainter methodsFor:'queries'! |
1210 |
||
217 | 1211 |
hasSpecClass |
1212 |
||
1213 |
specClass notNil ifTrue:[ |
|
1214 |
^ (specClass isBehavior or:[(Smalltalk at:specClass asSymbol) notNil]) |
|
1215 |
]. |
|
1216 |
^ false |
|
1217 |
! |
|
1218 |
||
1219 |
hasSpecClassAndSelector |
|
1220 |
||
1221 |
specSelector size > 1 ifTrue:[ |
|
1222 |
^ self hasSpecClass |
|
1223 |
]. |
|
1224 |
^ false |
|
1225 |
! |
|
1226 |
||
166 | 1227 |
isHelpToolSelected |
1228 |
^ tabSelection = 'Help' |
|
1229 |
! |
|
1230 |
||
1231 |
isLayoutToolSelected |
|
1232 |
^ tabSelection = layoutTool class label |
|
217 | 1233 |
! |
1234 |
||
1235 |
isPainterEnabled |
|
1236 |
^ self painter enabled |
|
166 | 1237 |
! ! |
1238 |
||
109 | 1239 |
!UIPainter methodsFor:'selection'! |
1240 |
||
1241 |
tabSelection |
|
1242 |
^ tabSelection |
|
1243 |
! |
|
1244 |
||
1245 |
tabSelection:something |
|
166 | 1246 |
|raiseViewIdx| |
121 | 1247 |
|
166 | 1248 |
something notNil ifTrue:[ |
1249 |
raiseViewIdx := 1. |
|
1250 |
tabSelection := something. |
|
109 | 1251 |
|
166 | 1252 |
self isLayoutToolSelected ifFalse:[ |
1253 |
specTool selection:tabSelection. |
|
1254 |
raiseViewIdx := 2 |
|
121 | 1255 |
]. |
166 | 1256 |
(self noteBookView subViews at:raiseViewIdx) raise. |
1257 |
self cancel. |
|
109 | 1258 |
] |
60 | 1259 |
! ! |
1260 |
||
109 | 1261 |
!UIPainter methodsFor:'startup / release'! |
1262 |
||
1263 |
closeRequest |
|
1264 |
"close all windows open by builder |
|
1265 |
" |
|
133 | 1266 |
|anyUnsavedChanges| |
1267 |
||
1268 |
objectList painter isModified ifTrue:[ |
|
1269 |
(self confirm:'quit without saving ?') ifFalse:[ |
|
1270 |
^ self |
|
1271 |
] |
|
1272 |
]. |
|
1273 |
||
109 | 1274 |
objectList removeDependent:self. |
1275 |
objectList painter release. |
|
60 | 1276 |
|
109 | 1277 |
selectionPanel notNil ifTrue:[ |
183 | 1278 |
selectionPanel masterApplication:nil. |
109 | 1279 |
selectionPanel closeRequest |
1280 |
]. |
|
149 | 1281 |
selectionPanel := nil. |
1282 |
layoutTool := nil. |
|
1283 |
objectList := nil. |
|
1284 |
activeHelpTool := nil. |
|
1285 |
||
109 | 1286 |
super closeRequest. |
1287 |
||
1288 |
! |
|
1289 |
||
1290 |
closeRequestFor:aTopView |
|
1291 |
"handle a close request for a specific view |
|
1292 |
" |
|
173 | 1293 |
|topView| |
60 | 1294 |
|
109 | 1295 |
topView := self window. |
60 | 1296 |
|
109 | 1297 |
topView == aTopView ifTrue:[ |
1298 |
super closeRequestFor:aTopView |
|
1299 |
] ifFalse:[ |
|
173 | 1300 |
aTopView = selectionPanel window ifTrue:[ |
1301 |
self galleryShown value:false |
|
1302 |
] ifFalse:[ |
|
1303 |
self painterShown value:false |
|
1304 |
]. |
|
133 | 1305 |
topView raise. |
109 | 1306 |
]. |
60 | 1307 |
! |
1308 |
||
109 | 1309 |
openInterface |
1310 |
"open interfaces |
|
1311 |
" |
|
136 | 1312 |
|painterView painter cls topView| |
60 | 1313 |
|
1314 |
aspects := IdentityDictionary new. |
|
1315 |
||
1316 |
aspects at:#classNameChannel put:( |
|
1317 |
(specClass notNil ifTrue:[specClass] |
|
1318 |
ifFalse:['NewApplication']) asValue |
|
1319 |
). |
|
1320 |
specSuperclass isNil ifTrue:[ |
|
1321 |
specClass notNil ifTrue:[ |
|
1322 |
(cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[ |
|
1323 |
specSuperclass := cls superclass name. |
|
1324 |
] |
|
1325 |
] |
|
1326 |
]. |
|
1327 |
aspects at:#superclassNameChannel put:( |
|
1328 |
(specSuperclass notNil ifTrue:[specSuperclass] |
|
1329 |
ifFalse:['ApplicationModel']) asValue |
|
1330 |
). |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1331 |
aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue. |
60 | 1332 |
aspects at:#methodNameChannel put:( |
161 | 1333 |
(specSelector notNil ifTrue:[specSelector asValue] |
60 | 1334 |
ifFalse:[#windowSpec]) asValue |
1335 |
). |
|
136 | 1336 |
|
1337 |
painterView := StandardSystemView new. |
|
1338 |
painterView label:'unnamed canvas'. |
|
1339 |
painterView extent:300@300. |
|
1340 |
||
1341 |
painter := UIPainterView in:painterView. |
|
109 | 1342 |
painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
136 | 1343 |
|
109 | 1344 |
objectList := painter listHolder. |
1345 |
objectList addDependent:self. |
|
136 | 1346 |
|
109 | 1347 |
super openInterface. |
60 | 1348 |
|
136 | 1349 |
topView := self window. |
1350 |
topView bePartner. |
|
1351 |
topView label:'Interface Builder'. |
|
1352 |
topView icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100). |
|
1353 |
||
1354 |
painterView openInGroup:(topView windowGroup). |
|
1355 |
painterView bePartner. |
|
1356 |
painterView application:self. |
|
1357 |
painterView open. |
|
1358 |
||
1359 |
painterView application:self. |
|
183 | 1360 |
selectionPanel := UISelectionPanel new. |
136 | 1361 |
selectionPanel allButOpenInterface:#windowSpec. |
1362 |
selectionPanel window openInGroup:(topView windowGroup). |
|
1363 |
selectionPanel window bePartner. |
|
1364 |
selectionPanel openWindow. |
|
183 | 1365 |
selectionPanel masterApplication:self. |
60 | 1366 |
! |
1367 |
||
1368 |
openNewWindowCanvas |
|
109 | 1369 |
"open new |
1370 |
" |
|
60 | 1371 |
self open. |
1372 |
||
1373 |
||
1374 |
! |
|
1375 |
||
109 | 1376 |
openOnClass:aClass |
1377 |
"open up an interface builder |
|
1378 |
" |
|
1379 |
self openOnClass:aClass andSelector:#windowSpec |
|
1380 |
! |
|
1381 |
||
60 | 1382 |
openOnClass:aClass andSelector:aSelector |
1383 |
"open up an interface builder, fetching a spec from someClass |
|
109 | 1384 |
via some selector |
1385 |
" |
|
1386 |
|painter| |
|
60 | 1387 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1388 |
aClass isNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1389 |
self warn:'nil class given (class was probably renamed ?)'. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1390 |
]. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1391 |
|
109 | 1392 |
self openInterface. |
60 | 1393 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1394 |
aClass notNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1395 |
painter := self painter. |
60 | 1396 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1397 |
self setClass:aClass selector:aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1398 |
"/ specClass := aClass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1399 |
"/ specSuperclass := aClass superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1400 |
"/ specSelector := aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1401 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1402 |
"/ (aspects at:#classNameChannel) value:specClass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1403 |
"/ (aspects at:#superclassNameChannel) value:specSuperclass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1404 |
"/ (aspects at:#methodNameChannel) value:specSelector asSymbol. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1405 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1406 |
"/ painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1407 |
"/ className:aClass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1408 |
"/ superclassName:aClass superclass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1409 |
"/ selector:aSelector. |
60 | 1410 |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
1411 |
(aClass respondsTo:aSelector) ifTrue:[ |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
1412 |
painter setupFromSpec:(aClass perform:aSelector). |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
1413 |
] |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1414 |
] |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1415 |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
1416 |
"Modified: 1.7.1997 / 19:18:54 / cg" |
60 | 1417 |
! ! |
1418 |
||
109 | 1419 |
!UIPainter methodsFor:'user interaction - dialog'! |
60 | 1420 |
|
1421 |
checkClassAndSelector |
|
1422 |
"check for class & superclass" |
|
1423 |
||
1424 |
|superclass cls| |
|
1425 |
||
1426 |
specClass isNil ifTrue:[^ false]. |
|
1427 |
||
1428 |
specClass isBehavior ifFalse:[ |
|
1429 |
cls := Smalltalk at:specClass asSymbol |
|
1430 |
] ifTrue:[ |
|
1431 |
cls := specClass |
|
1432 |
]. |
|
1433 |
cls isNil ifTrue:[ |
|
1434 |
(superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[ |
|
1435 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1436 |
^ false. |
|
1437 |
]. |
|
1438 |
(self confirm:'create ' , specClass , ' ?') ifTrue:[ |
|
1439 |
superclass subclass:(specClass asSymbol) |
|
1440 |
instanceVariableNames:'' |
|
1441 |
classVariableNames:'' |
|
1442 |
poolDictionaries:'' |
|
1443 |
category:'New-Applications'. |
|
1444 |
^ true. |
|
1445 |
]. |
|
1446 |
^ false. |
|
1447 |
]. |
|
1448 |
cls isBehavior ifFalse:[ |
|
1449 |
self warn:'a global named ' , specClass , ' exists, but is no class.'. |
|
1450 |
^ false. |
|
1451 |
]. |
|
1452 |
||
1453 |
specSuperclass isBehavior ifFalse:[ |
|
179 | 1454 |
specSuperclass isEmpty ifFalse:[ |
1455 |
superclass := Smalltalk at:specSuperclass asSymbol |
|
1456 |
] ifTrue:[ |
|
1457 |
specSuperclass := nil. |
|
1458 |
] |
|
60 | 1459 |
] ifTrue:[ |
1460 |
superclass := specSuperclass |
|
1461 |
]. |
|
179 | 1462 |
|
60 | 1463 |
specSuperclass notNil ifTrue:[ |
1464 |
superclass isNil ifTrue:[ |
|
1465 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1466 |
^ false. |
|
1467 |
]. |
|
1468 |
||
1469 |
(cls isSubclassOf:superclass) ifFalse:[ |
|
206 | 1470 |
self information:('a global named ' , specClass , ' exists,\' , |
1471 |
'but is not a subclass of ' , superclass name , '.\\' , |
|
1472 |
'Check and try again if that is not what you want.') withCRs. |
|
60 | 1473 |
] |
1474 |
]. |
|
179 | 1475 |
|
1476 |
superclass isNil ifTrue:[ |
|
1477 |
cls notNil ifTrue:[ |
|
1478 |
specSuperclass := cls superclass name |
|
1479 |
] |
|
1480 |
]. |
|
1481 |
||
60 | 1482 |
^ true |
109 | 1483 |
|
179 | 1484 |
"Modified: 25.6.1997 / 13:37:11 / cg" |
60 | 1485 |
! |
1486 |
||
1487 |
defineClassAndSelector |
|
1488 |
"launch a dialog to define class, superclass and method" |
|
1489 |
||
176 | 1490 |
|again tmp| |
60 | 1491 |
|
1492 |
[ |
|
1493 |
again := false. |
|
160 | 1494 |
|
176 | 1495 |
(tmp := specClass) isNil ifTrue:[tmp := 'NewApplication']. |
1496 |
aspects at:#classNameChannel put:tmp asValue. |
|
1497 |
||
1498 |
(tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec']. |
|
1499 |
aspects at:#methodNameChannel put:tmp asValue. |
|
1500 |
||
1501 |
(tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel']. |
|
1502 |
aspects at:#superclassNameChannel put:tmp asValue. |
|
160 | 1503 |
|
60 | 1504 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[ |
1505 |
||
1506 |
specClass := (self aspectFor:#classNameChannel) value. |
|
1507 |
specSelector := (self aspectFor:#methodNameChannel) value. |
|
161 | 1508 |
specSelector notNil ifTrue:[specSelector := specSelector asSymbol]. |
60 | 1509 |
specSuperclass := (self aspectFor:#superclassNameChannel) value. |
1510 |
||
109 | 1511 |
(again := self checkClassAndSelector not) ifFalse:[ |
1512 |
self painter className:specClass |
|
1513 |
superclassName:specSuperclass |
|
1514 |
selector:specSelector. |
|
1515 |
] |
|
60 | 1516 |
] |
109 | 1517 |
|
60 | 1518 |
] doWhile:[again] |
1519 |
||
161 | 1520 |
"Modified: 17.6.1997 / 14:42:02 / cg" |
60 | 1521 |
! ! |
1522 |
||
109 | 1523 |
!UIPainter methodsFor:'user interaction - pullDown'! |
60 | 1524 |
|
149 | 1525 |
doBrowseAppClass |
1526 |
"open a browser on the class" |
|
1527 |
||
1528 |
|cls| |
|
1529 |
||
1530 |
specClass isNil ifTrue:[ |
|
1531 |
^ self information:'no class yet'. |
|
1532 |
]. |
|
1533 |
||
1534 |
specClass isBehavior ifFalse:[ |
|
1535 |
cls := Smalltalk at:specClass asSymbol |
|
1536 |
] ifTrue:[ |
|
1537 |
cls := specClass |
|
1538 |
]. |
|
1539 |
||
1540 |
cls isNil ifTrue:[ |
|
1541 |
^ self information:'no class yet'. |
|
1542 |
]. |
|
1543 |
||
1544 |
SystemBrowser openInClass:cls |
|
1545 |
||
1546 |
||
1547 |
! |
|
1548 |
||
60 | 1549 |
doFromClass |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1550 |
|className methodName cls sel accepted failed spec s painter| |
109 | 1551 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1552 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1553 |
(self confirm:'edit another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1554 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1555 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1556 |
]. |
60 | 1557 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1558 |
className := (specClass ? '') asValue. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1559 |
methodName := (specSelector ? '') asValue. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1560 |
painter := self painter. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1561 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1562 |
(s := painter className) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1563 |
className value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1564 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1565 |
(s := painter methodName) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1566 |
methodName value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1567 |
]. |
60 | 1568 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1569 |
failed := false. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1570 |
[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1571 |
accepted := |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1572 |
(DialogBox new |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1573 |
addTextLabel:'Classes name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1574 |
addInputFieldOn:className; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1575 |
addVerticalSpace; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1576 |
addTextLabel:'methods name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1577 |
addInputFieldOn:methodName; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1578 |
addAbortButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1579 |
addOkButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1580 |
open |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1581 |
) accepted. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1582 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1583 |
accepted ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1584 |
cls := Smalltalk classNamed:className value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1585 |
cls isNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1586 |
failed := true. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1587 |
self warn:'no such class'. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1588 |
] ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1589 |
sel := methodName value asSymbol. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1590 |
(cls respondsTo:sel ) ifFalse:[ |
60 | 1591 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1592 |
self warn:'no such method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1593 |
] ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1594 |
spec := cls perform:sel. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1595 |
spec isArray ifFalse:[ |
60 | 1596 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1597 |
self warn:'not a windowSpec method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1598 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1599 |
"/ ok, got it |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1600 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1601 |
self setClass:cls selector:sel. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1602 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1603 |
painter setupFromSpec:spec. |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1604 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1605 |
^ self |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1606 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1607 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1608 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1609 |
] doWhile:[accepted and:[failed]]. |
60 | 1610 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1611 |
"Modified: 24.6.1997 / 18:59:29 / cg" |
60 | 1612 |
! |
1613 |
||
1614 |
doInstallAspects |
|
1615 |
|code| |
|
1616 |
||
217 | 1617 |
self hasSpecClassAndSelector ifFalse:[ |
60 | 1618 |
self defineClassAndSelector |
1619 |
]. |
|
1620 |
||
1621 |
self checkClassAndSelector ifFalse:[ |
|
1622 |
^ self |
|
1623 |
]. |
|
1624 |
||
109 | 1625 |
self painter className:specClass |
1626 |
superclassName:specSuperclass |
|
1627 |
selector:specSelector. |
|
60 | 1628 |
|
109 | 1629 |
code := self painter generateAspectMethods. |
60 | 1630 |
(ReadStream on:code) fileIn. |
1631 |
||
1632 |
! |
|
1633 |
||
152 | 1634 |
doInstallHelp |
197 | 1635 |
"install help text |
171 | 1636 |
" |
197 | 1637 |
activeHelpTool notNil ifTrue:[ |
1638 |
activeHelpTool installHelpSpecInto:specClass |
|
1639 |
] ifFalse:[ |
|
1640 |
self information:'no help text defined' |
|
1641 |
] |
|
152 | 1642 |
! |
1643 |
||
60 | 1644 |
doInstallSpec |
176 | 1645 |
|code painter| |
60 | 1646 |
|
217 | 1647 |
self hasSpecClassAndSelector ifFalse:[ |
60 | 1648 |
self defineClassAndSelector |
1649 |
]. |
|
1650 |
||
1651 |
self checkClassAndSelector ifFalse:[ |
|
1652 |
^ self |
|
1653 |
]. |
|
176 | 1654 |
painter := self painter. |
60 | 1655 |
|
176 | 1656 |
painter className:specClass |
1657 |
superclassName:specSuperclass |
|
1658 |
selector:specSelector. |
|
60 | 1659 |
|
176 | 1660 |
code := painter generateWindowSpecMethodSource withCRs. |
1661 |
painter resetModification. |
|
60 | 1662 |
(ReadStream on:code) fileIn. |
1663 |
||
1664 |
! |
|
1665 |
||
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1666 |
doNew |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1667 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1668 |
(self confirm:'new interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1669 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1670 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1671 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1672 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1673 |
self removeAll |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1674 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1675 |
"Modified: 17.6.1997 / 12:33:31 / cg" |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1676 |
! |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1677 |
|
60 | 1678 |
doPickAView |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1679 |
|painter view cls spec| |
60 | 1680 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1681 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1682 |
(self confirm:'pick another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1683 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1684 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1685 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1686 |
|
171 | 1687 |
(view := Screen current viewFromUser) notNil ifTrue:[ |
174 | 1688 |
view == Screen current rootView ifFalse:[ |
1689 |
painter := self painter. |
|
1690 |
spec := UISpecification fromView:view topView. |
|
60 | 1691 |
|
174 | 1692 |
"/ ok, got it |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1693 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1694 |
view application notNil ifTrue:[ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1695 |
cls := view application class |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1696 |
] ifFalse:[ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1697 |
cls := view class |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1698 |
]. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1699 |
self setClass:cls selector:nil. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1700 |
|
174 | 1701 |
painter setupFromSpec:spec. |
1702 |
] |
|
109 | 1703 |
] |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1704 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1705 |
"Modified: 24.6.1997 / 19:02:57 / cg" |
60 | 1706 |
! |
1707 |
||
1708 |
doRaise |
|
171 | 1709 |
|top x| |
109 | 1710 |
|
171 | 1711 |
top := self painter topView. |
1712 |
top realized ifFalse:[ |
|
173 | 1713 |
self painterShown value:true |
171 | 1714 |
]. |
1715 |
top raise. |
|
109 | 1716 |
|
171 | 1717 |
top := selectionPanel window. |
1718 |
top realized ifFalse:[ |
|
173 | 1719 |
self galleryShown value:true |
171 | 1720 |
]. |
1721 |
top raise. |
|
60 | 1722 |
! |
1723 |
||
149 | 1724 |
doStartApplication |
1725 |
|cls| |
|
1726 |
||
217 | 1727 |
(specClass isNil or:[specSelector size < 2]) ifTrue:[ |
149 | 1728 |
^ self information:'no class or selector defined'. |
1729 |
]. |
|
1730 |
||
1731 |
specClass isBehavior ifFalse:[ |
|
1732 |
cls := Smalltalk at:specClass asSymbol |
|
1733 |
] ifTrue:[ |
|
1734 |
cls := specClass |
|
1735 |
]. |
|
1736 |
||
1737 |
cls isNil ifTrue:[ |
|
1738 |
^ self information:'class not existant'. |
|
1739 |
]. |
|
1740 |
||
1741 |
(cls respondsTo:specSelector) ifFalse:[ |
|
161 | 1742 |
self halt. |
1743 |
^ self information:('no method for: #' |
|
1744 |
, specSelector , ' in ' , cls name , |
|
1745 |
'\\(did you install the spec ?)') withCRs. |
|
149 | 1746 |
]. |
1747 |
cls new openInterface:specSelector |
|
161 | 1748 |
|
1749 |
"Modified: 17.6.1997 / 14:40:21 / cg" |
|
149 | 1750 |
! |
1751 |
||
60 | 1752 |
doWindowSpec |
68 | 1753 |
|code code2 v| |
60 | 1754 |
|
109 | 1755 |
code := self painter generateWindowSpecMethodSource. |
68 | 1756 |
|
60 | 1757 |
v := CodeView open. |
1758 |
v contents:code. |
|
1759 |
v label:'windowSpec'. |
|
1760 |
||
81 | 1761 |
! ! |
1762 |
||
60 | 1763 |
!UIPainter class methodsFor:'documentation'! |
1764 |
||
1765 |
version |
|
1766 |
^ '$Header$' |
|
1767 |
! ! |