UIPainter.st
changeset 1466 6fecdd5341dc
parent 1461 b061747908b5
child 1487 846527ddac8b
equal deleted inserted replaced
1465:4ff489c07764 1466:6fecdd5341dc
    20 	poolDictionaries:''
    20 	poolDictionaries:''
    21 	category:'Interface-UIPainter'
    21 	category:'Interface-UIPainter'
    22 !
    22 !
    23 
    23 
    24 SelectionInTreeView subclass:#TreeView
    24 SelectionInTreeView subclass:#TreeView
    25 	instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec'
    25 	instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec windowSpecClass'
    26 	classVariableNames:''
    26 	classVariableNames:''
    27 	poolDictionaries:''
    27 	poolDictionaries:''
    28 	privateIn:UIPainter
    28 	privateIn:UIPainter
    29 !
    29 !
    30 
    30 
  2315      If nil is returned, thhe ST/X default image is used."
  2315      If nil is returned, thhe ST/X default image is used."
  2316 
  2316 
  2317     ^ Image fromFile:'bitmaps/xpmBitmaps/misc_tools/setup_windows.xpm'
  2317     ^ Image fromFile:'bitmaps/xpmBitmaps/misc_tools/setup_windows.xpm'
  2318 
  2318 
  2319     "Created: / 13.8.1998 / 20:33:05 / cg"
  2319     "Created: / 13.8.1998 / 20:33:05 / cg"
       
  2320 !
       
  2321 
       
  2322 defaultWindowSpecClass
       
  2323     ^ WindowSpec
  2320 ! !
  2324 ! !
  2321 
  2325 
  2322 !UIPainter methodsFor:'event handling'!
  2326 !UIPainter methodsFor:'event handling'!
  2323 
  2327 
  2324 doesNotUnderstand:aMessage
  2328 doesNotUnderstand:aMessage
  2901     ).
  2905     ).
  2902 
  2906 
  2903     "/ the canvas ...
  2907     "/ the canvas ...
  2904 
  2908 
  2905     treeView    := TreeView new.
  2909     treeView    := TreeView new.
       
  2910     treeView windowSpecClass:(self defaultWindowSpecClass).
  2906     painterView := StandardSystemView new.
  2911     painterView := StandardSystemView new.
  2907 
  2912 
  2908     name := name ? UIPainter defaultNameOfCanvas.
  2913     name := name ? UIPainter defaultNameOfCanvas.
  2909 
  2914 
  2910     painterView name: name.
  2915     painterView name: name.
  2911     painterView label: name.
  2916     painterView label: name.
  2912     painterView extent:300@300.
  2917     painterView extent:(treeView windowSpecClass defaultExtentInUIPainter). "/ 300@300.
  2913 
  2918 
  2914     painter := UIPainterView in:painterView.
  2919     painter := UIPainterView in:painterView.
  2915     painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
  2920     painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout.
  2916 
  2921 
  2917     treeView := treeView canvas:painter specName:name.
  2922     treeView := treeView canvas:painter specName:name.
  3684 canvasSpec
  3689 canvasSpec
  3685     "returns spec assigned to canvas"
  3690     "returns spec assigned to canvas"
  3686 
  3691 
  3687     |spec list key block cls canvas modelBlock|
  3692     |spec list key block cls canvas modelBlock|
  3688 
  3693 
  3689     spec := WindowSpec new.
  3694     spec := self windowSpecClass new.
  3690     canvas := self canvas.
  3695     canvas := self canvas.
  3691 
  3696 
  3692     spec fromView:(canvas topView) callBack:nil.
  3697     spec fromView:(canvas topView) callBack:nil.
  3693 
  3698 
  3694     windowSpec notNil ifTrue:[
  3699     windowSpec notNil ifTrue:[
  3705         windowSpec notNil ifTrue:[
  3710         windowSpec notNil ifTrue:[
  3706             windowSpec exportedAspects:(spec exportedAspects).
  3711             windowSpec exportedAspects:(spec exportedAspects).
  3707         ]
  3712         ]
  3708     ].
  3713     ].
  3709 
  3714 
  3710     self propertiesDo:[:aProp| |aspect entry|
  3715     self propertiesDo:[:aProp| 
       
  3716         |propsSpec|
       
  3717 
  3711         spec exportedAspectsAddKey:(aProp model) type:nil.
  3718         spec exportedAspectsAddKey:(aProp model) type:nil.
  3712         aProp spec aspectSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:nil].
  3719         propsSpec := aProp spec.
  3713         aProp spec actionSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:#action].
  3720         propsSpec aspectSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:nil].
       
  3721         propsSpec actionSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:#action].
  3714     ].
  3722     ].
  3715   ^ spec
  3723   ^ spec
  3716 !
  3724 !
  3717 
  3725 
  3718 canvasSpec:aSpec
  3726 canvasSpec:aSpec
  3753     "returns the lastDrawnMaster"
  3761     "returns the lastDrawnMaster"
  3754 
  3762 
  3755     ^ lastDrawnMaster
  3763     ^ lastDrawnMaster
  3756 
  3764 
  3757 
  3765 
       
  3766 !
       
  3767 
       
  3768 windowSpecClass
       
  3769     "returns the default  windowSpecClass (WindowSpec)"
       
  3770 
       
  3771     ^ windowSpecClass ? WindowSpec
       
  3772 !
       
  3773 
       
  3774 windowSpecClass:aClass
       
  3775     "set the default windowSpecClass"
       
  3776 
       
  3777     ^ windowSpecClass := aClass
  3758 ! !
  3778 ! !
  3759 
  3779 
  3760 !UIPainter::TreeView methodsFor:'accessing property'!
  3780 !UIPainter::TreeView methodsFor:'accessing property'!
  3761 
  3781 
  3762 propertiesDo:aOneArgBlock
  3782 propertiesDo:aOneArgBlock
  3862     "sets a window spec from aWindowSpec and applies some attributes
  3882     "sets a window spec from aWindowSpec and applies some attributes
  3863      to the canvas."
  3883      to the canvas."
  3864 
  3884 
  3865     |name canvasView builder|
  3885     |name canvasView builder|
  3866 
  3886 
  3867     windowSpec := WindowSpec new copyValuesFromSpec:aWindowSpec.
  3887     windowSpec := (self windowSpecClass) new copyValuesFromSpec:aWindowSpec.
  3868     canvasView := self canvas.
  3888     canvasView := self canvas.
  3869 
  3889 
  3870     builder := UIBuilder new isEditing:true.
  3890     builder := UIBuilder new isEditing:true.
  3871     aWindowSpec setAttributesIn:canvasView with:builder.
  3891     aWindowSpec setAttributesIn:canvasView with:builder.
  3872 
  3892