diff -r 96d6feeeb049 -r c6f7d7881634 UIPropertyView.st --- a/UIPropertyView.st Sat May 24 05:07:29 1997 +0200 +++ b/UIPropertyView.st Sat May 24 05:08:17 1997 +0200 @@ -5,15 +5,15 @@ category:'Interface-UIPainter' ! -UIPropertyView subclass:#Dimension - instanceVariableNames:'noteBook forView selection layoutTypes' +UIPropertyView subclass:#Specification + instanceVariableNames:'specEdited specChannel' classVariableNames:'' poolDictionaries:'' privateIn:UIPropertyView ! -UIPropertyView subclass:#Specification - instanceVariableNames:'specEdited specChannel' +UIPropertyView subclass:#Dimension + instanceVariableNames:'noteBook forView selection layoutTypes' classVariableNames:'' poolDictionaries:'' privateIn:UIPropertyView @@ -194,6 +194,56 @@ ! ! +!UIPropertyView::Specification methodsFor:'accessing'! + +specEdited + "gets current edit specification + " + ^ specEdited + + +! + +specEdited:aSpec + "sets current edit specification + " + |aspects| + + self modified:false. + + aSpec isNil ifTrue:[ + specChannel := nil. + specEdited := nil. + ] ifFalse:[ + specEdited class == aSpec class ifTrue:[ + specEdited := aSpec. + specChannel value:specEdited. + ^ self modified:false. + ]. + specEdited := aSpec. + aspects := IdentityDictionary new. + specChannel := specEdited asValue. + specEdited class addBindingsTo:aspects for:specEdited channel:specChannel + ]. + self aspects:aspects. + self buildFromSpec:nil. + + +! ! + +!UIPropertyView::Specification methodsFor:'action'! + +reload + "reload specification + " + specChannel notNil ifTrue:[ + specChannel value:specEdited. + self modified:false. + ] + + +! ! + !UIPropertyView::Dimension class methodsFor:'interface specs'! specificationAlignmentOrigin @@ -1258,11 +1308,8 @@ forView:aView "set the view the layout derives from " - forView := aView. - selection := nil. - self selection:(UIPainterView layoutType:forView) - - + forView := aView. + self selection:(UIPainterView layoutType:forView). ! layout @@ -1701,55 +1748,18 @@ ]. idx := layoutTypes findFirst:[:type| type == aLayoutType ]. noteBook setSelection:idx. -! ! -!UIPropertyView::Specification methodsFor:'accessing'! - -specEdited - "gets current edit specification - " - ^ specEdited - - -! - -specEdited:aSpec - "sets current edit specification - " - |aspects| - - self modified:false. - - aSpec isNil ifTrue:[ - specChannel := nil. - specEdited := nil. - ] ifFalse:[ - specEdited class == aSpec class ifTrue:[ - specEdited := aSpec. - specChannel value:specEdited. - ^ self modified:false. + selection == aLayoutType ifFalse:[ + (selection := aLayoutType) notNil ifTrue:[ + self perform:(('fetch', selection asString) asSymbol). + spec := ('specification', selection asString) asSymbol. + spec := self class perform:spec. ]. - specEdited := aSpec. - aspects := IdentityDictionary new. - specChannel := specEdited asValue. - specEdited class addBindingsTo:aspects for:specEdited channel:specChannel + self buildFromSpec:spec. ]. - self aspects:aspects. - self buildFromSpec:nil. - - -! ! - -!UIPropertyView::Specification methodsFor:'action'! - -reload - "reload specification - " - specChannel notNil ifTrue:[ - specChannel value:specEdited. - self modified:false. - ] - + idx := layoutTypes findFirst:[:type| type == aLayoutType ]. + noteBook setSelection:idx. + noteBook enabled:(forView notNil). ! !