1 " |
1 " |
2 COPYRIGHT (c) 1995 by Claus Gittinger |
2 COPYRIGHT (c) 1995 by Claus Gittinger |
3 All Rights Reserved |
3 All Rights Reserved |
4 |
4 |
5 This software is furnished under a license and may be used |
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 |
6 only in accordance with the terms of that license and with the |
7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
12 |
13 UIObjectView subclass:#UIPainterView |
13 UIObjectView subclass:#UIPainterView |
14 instanceVariableNames:'fontPanel code viewProperties superclassName className methodName |
14 instanceVariableNames:'fontPanel code viewProperties superclassName className methodName |
15 categoryName' |
15 categoryName' |
16 classVariableNames:'HandCursor' |
16 classVariableNames:'HandCursor' |
17 poolDictionaries:'' |
17 poolDictionaries:'' |
18 category:'Interface-UIPainter' |
18 category:'Interface-UIPainter' |
19 ! |
19 ! |
20 |
20 |
21 Object subclass:#ViewProperty |
21 Object subclass:#ViewProperty |
22 instanceVariableNames:'aspectSelector changeSelector name nameIndex view elementClass |
22 instanceVariableNames:'aspectSelector changeSelector name nameIndex view elementClass |
23 labelSelector identifier' |
23 labelSelector identifier' |
24 classVariableNames:'Identifier' |
24 classVariableNames:'Identifier' |
25 poolDictionaries:'' |
25 poolDictionaries:'' |
26 privateIn:UIPainterView |
26 privateIn:UIPainterView |
27 ! |
27 ! |
28 |
28 |
29 UIPainterView::ViewProperty subclass:#GroupProperties |
29 UIPainterView::ViewProperty subclass:#GroupProperties |
30 instanceVariableNames:'controlledObjects group' |
30 instanceVariableNames:'controlledObjects group' |
31 classVariableNames:'' |
31 classVariableNames:'' |
32 poolDictionaries:'' |
32 poolDictionaries:'' |
33 privateIn:UIPainterView |
33 privateIn:UIPainterView |
34 ! |
34 ! |
35 |
35 |
36 !UIPainterView class methodsFor:'documentation'! |
36 !UIPainterView class methodsFor:'documentation'! |
37 |
37 |
38 copyright |
38 copyright |
39 " |
39 " |
40 COPYRIGHT (c) 1995 by Claus Gittinger |
40 COPYRIGHT (c) 1995 by Claus Gittinger |
41 All Rights Reserved |
41 All Rights Reserved |
42 |
42 |
43 This software is furnished under a license and may be used |
43 This software is furnished under a license and may be used |
44 only in accordance with the terms of that license and with the |
44 only in accordance with the terms of that license and with the |
45 inclusion of the above copyright notice. This software may not |
45 inclusion of the above copyright notice. This software may not |
46 be provided or otherwise made available to, or used by, any |
46 be provided or otherwise made available to, or used by, any |
386 " <name> := <ViewClass> in:<name-of-superview>" |
386 " <name> := <ViewClass> in:<name-of-superview>" |
387 |
387 |
388 p := self propertyOfView:aView. |
388 p := self propertyOfView:aView. |
389 name := p at:#variableName. |
389 name := p at:#variableName. |
390 c := ' ' , name , ' := ' , |
390 c := ' ' , name , ' := ' , |
391 (aView class name) , ' in:' , (self variableNameOf:(aView superView)) , '.\'. |
391 (aView class name) , ' in:' , (self variableNameOf:(aView superView)) , '.\'. |
392 |
392 |
393 " <name> origin:(...) extent:(...)" |
393 " <name> origin:(...) extent:(...)" |
394 |
394 |
395 c := c , ' ' , name , ' origin:(', aView origin printString , ')' |
395 c := c , ' ' , name , ' origin:(', aView origin printString , ')' |
396 , ' extent:(', aView extent printString , ').\'. |
396 , ' extent:(', aView extent printString , ').\'. |
397 |
397 |
398 moreCode := p at:#initCode ifAbsent:nil. |
398 moreCode := p at:#initCode ifAbsent:nil. |
399 moreCode notNil ifTrue:[ |
399 moreCode notNil ifTrue:[ |
400 c := c , moreCode , '\' withCRs |
400 c := c , moreCode , '\' withCRs |
401 ]. |
401 ]. |
402 |
402 |
403 code := code , c withCRs. |
403 code := code , c withCRs. |
404 |
404 |
405 " <name> <symbol>:<value>" |
405 " <name> <symbol>:<value>" |
406 |
406 |
407 outlets := p at:#outlets ifAbsent:[nil]. |
407 outlets := p at:#outlets ifAbsent:[nil]. |
408 outlets notNil ifTrue:[ |
408 outlets notNil ifTrue:[ |
409 outlets do:[:selectorOutlet | |
409 outlets do:[:selectorOutlet | |
410 sym := selectorOutlet at:#selector. |
410 sym := selectorOutlet at:#selector. |
411 typ := selectorOutlet at:#type. |
411 typ := selectorOutlet at:#type. |
412 val := selectorOutlet at:#value. |
412 val := selectorOutlet at:#value. |
413 c := ' ' , name , ' ' , sym. |
413 c := ' ' , name , ' ' , sym. |
414 (typ == #number) ifTrue:[ |
414 (typ == #number) ifTrue:[ |
415 c := c , val printString |
415 c := c , val printString |
416 ]. |
416 ]. |
417 (typ == #string) ifTrue:[ |
417 (typ == #string) ifTrue:[ |
418 c := c , '''' , val , '''' |
418 c := c , '''' , val , '''' |
419 ]. |
419 ]. |
420 (typ == #text) ifTrue:[ |
420 (typ == #text) ifTrue:[ |
421 c := c , '''' , val asString , '''' |
421 c := c , '''' , val asString , '''' |
422 ]. |
422 ]. |
423 (typ == #strings) ifTrue:[ |
423 (typ == #strings) ifTrue:[ |
424 c := c , '#( '. |
424 c := c , '#( '. |
425 val asText do:[:aString | |
425 val asText do:[:aString | |
426 c := c , '''' , aString , ''' ' |
426 c := c , '''' , aString , ''' ' |
427 ]. |
427 ]. |
428 c := c , ')' |
428 c := c , ')' |
429 ]. |
429 ]. |
430 (typ == #block) ifTrue:[ |
430 (typ == #block) ifTrue:[ |
431 c := c , val |
431 c := c , val |
432 ]. |
432 ]. |
433 (typ == #color) ifTrue:[ |
433 (typ == #color) ifTrue:[ |
434 c := c , '(Color name:''' , val , ''')' |
434 c := c , '(Color name:''' , val , ''')' |
435 ]. |
435 ]. |
436 c := c , '.' , Character cr asString. |
436 c := c , '.' , Character cr asString. |
437 code := code , c |
437 code := code , c |
438 ] |
438 ] |
439 ]. |
439 ]. |
440 |
440 |
441 self subviewsOf:aView do:[:v | |
441 self subviewsOf:aView do:[:v | |
442 self generateInitCodeForView:v |
442 self generateInitCodeForView:v |
443 ] |
443 ] |
444 |
444 |
445 "Modified: 5.9.1995 / 20:06:07 / claus" |
445 "Modified: 5.9.1995 / 20:06:07 / claus" |
446 ! |
446 ! |
447 |
447 |
448 generateInitMethod |
448 generateInitMethod |
449 |defCode| |
449 |defCode| |
450 |
450 |
451 defCode := Character excla asString , |
451 defCode := Character excla asString , |
452 className , ' methodsFor:''initialization''' , |
452 className , ' methodsFor:''initialization''' , |
453 Character excla asString , '\\'. |
453 Character excla asString , '\\'. |
454 |
454 |
455 defCode := defCode , 'initialize\'. |
455 defCode := defCode , 'initialize\'. |
456 defCode := defCode , ' super initialize.\'. |
456 defCode := defCode , ' super initialize.\'. |
457 defCode := defCode , ' self setupSubViews.\'. |
457 defCode := defCode , ' self setupSubViews.\'. |
458 defCode := defCode , ' self setupLocalStuff\'. |
458 defCode := defCode , ' self setupLocalStuff\'. |
460 |
460 |
461 defCode := defCode , 'setupSubViews\'. |
461 defCode := defCode , 'setupSubViews\'. |
462 code := code , defCode withCRs. |
462 code := code , defCode withCRs. |
463 |
463 |
464 self subviewsOf:self do:[:v | |
464 self subviewsOf:self do:[:v | |
465 self generateInitCodeForView:v |
465 self generateInitCodeForView:v |
466 ]. |
466 ]. |
467 |
467 |
468 self generateInitCodeForOtherStuff. |
468 self generateInitCodeForOtherStuff. |
469 |
469 |
470 code := code , ' ^ self\' withCRs. |
470 code := code , ' ^ self\' withCRs. |
471 |
471 |
472 defCode := Character excla asString , '\\'. |
472 defCode := Character excla asString , '\\'. |
473 defCode := defCode , 'setupLocalStuff\'. |
473 defCode := defCode , 'setupLocalStuff\'. |
474 defCode := defCode , ' ^ self\'. |
474 defCode := defCode , ' ^ self\'. |
475 defCode := defCode , Character excla asString , ' ' , |
475 defCode := defCode , Character excla asString , ' ' , |
476 Character excla asString , '\\'. |
476 Character excla asString , '\\'. |
477 |
477 |
478 code := code , defCode withCRs |
478 code := code , defCode withCRs |
479 |
479 |
480 |
480 |
481 |
481 |