# HG changeset patch # User ca # Date 1232541424 -3600 # Node ID 7892f26996b723145df178ccc7ba39ddfa80a168 # Parent cbda60900ced6239c13a26898be41da3e1c9254d *** empty log message *** diff -r cbda60900ced -r 7892f26996b7 Tools__ViewTreeItem.st --- a/Tools__ViewTreeItem.st Wed Jan 21 13:36:56 2009 +0100 +++ b/Tools__ViewTreeItem.st Wed Jan 21 13:37:04 2009 +0100 @@ -3,7 +3,7 @@ "{ NameSpace: Tools }" HierarchicalItem subclass:#ViewTreeItem - instanceVariableNames:'widget isDrawnShown exists xOffsetApplClass' + instanceVariableNames:'widget isDrawnShown exists xOffsetAdditionalName' classVariableNames:'HandleExtent' poolDictionaries:'' category:'A-Views-Support' @@ -230,8 +230,17 @@ !ViewTreeItem methodsFor:'displaying'! +additionalLabelForItem:anItem + "answer an additional item for an Item or nil" + + parent notNil ifTrue:[ + ^ parent additionalLabelForItem:anItem + ]. + ^ nil +! + displayOn:aGC x:x y:y h:h - |labelHeight paint applName| + |labelHeight paint additionalName| widget id isNil ifTrue:[ isDrawnShown := false. @@ -246,48 +255,46 @@ labelHeight := self heightOn:aGC. self displayLabel:(self label) h:labelHeight on:aGC x:x y:y h:h. - xOffsetApplClass notNil ifTrue:[ - applName := self labelOfApplicationClass. - applName notNil ifTrue:[ - self displayLabel:applName + xOffsetAdditionalName notNil ifTrue:[ + additionalName := self additionalLabelForItem:self. + + additionalName notNil ifTrue:[ + self displayLabel:additionalName h:labelHeight on:aGC - x:(x + xOffsetApplClass) + x:(x + xOffsetAdditionalName) y:y h:h. + ] ifFalse:[ + xOffsetAdditionalName := nil. ]. ]. ! -labelOfApplicationClass - "answer the name of the underlaying application or nil" - |applClass| - - self isApplicationClass ifTrue:[ - applClass := self applicationClass. +recursiveAdditionalNameBehaviourChanged + width := xOffsetAdditionalName := nil. - applClass notNil ifTrue:[ - ^ ('[ ', applClass name, ' ]') - ]. + children notNil ifTrue:[ + children do:[:each| each recursiveAdditionalNameBehaviourChanged ] ]. - xOffsetApplClass := nil. - ^ nil ! widthOn:aGC "return the width of the receiver, if it is to be displayed on aGC " - |applName| + |additionalName| width isNil ifTrue:[ width := self widthOf:(self label) on:aGC. width := width + 2. - applName := self labelOfApplicationClass. + additionalName := self additionalLabelForItem:self. - applName notNil ifTrue:[ - xOffsetApplClass := width + 10. - width := xOffsetApplClass + (self widthOf:applName on:aGC). + additionalName notNil ifTrue:[ + xOffsetAdditionalName := width + 10. + width := xOffsetAdditionalName + (self widthOf:additionalName on:aGC). width := width + 2. + ] ifFalse:[ + xOffsetAdditionalName := nil. ]. ]. ^ width