*** empty log message ***
authorca
Mon, 06 Oct 2008 09:03:23 +0200
changeset 2405 ec54aeed9a42
parent 2404 06d51e254934
child 2406 ea8bc84411f3
*** empty log message ***
Tools__ViewTreeItem.st
--- a/Tools__ViewTreeItem.st	Mon Oct 06 08:31:58 2008 +0200
+++ b/Tools__ViewTreeItem.st	Mon Oct 06 09:03:23 2008 +0200
@@ -3,7 +3,7 @@
 "{ NameSpace: Tools }"
 
 HierarchicalItem subclass:#ViewTreeItem
-	instanceVariableNames:'widget isDrawnShown exists'
+	instanceVariableNames:'widget isDrawnShown exists xOffsetApplClass'
 	classVariableNames:'HandleExtent'
 	poolDictionaries:''
 	category:'A-Views-Support'
@@ -231,7 +231,7 @@
 !ViewTreeItem methodsFor:'displaying'!
 
 displayOn:aGC x:x y:y h:h
-    |labelHeight applClass paint|
+    |labelHeight paint applName|
 
     widget id isNil ifTrue:[
         isDrawnShown := false.
@@ -246,26 +246,49 @@
     labelHeight := self heightOn:aGC.
     self displayLabel:(self label) h:labelHeight on:aGC x:x y:y h:h.
 
-    self isApplicationClass ifTrue:[
-        aGC paint:(Color black).
-        applClass := self applicationClass.
-
-        applClass notNil ifTrue:[
-            self displayLabel:('[ ', applClass name, ' ]')
+    xOffsetApplClass notNil ifTrue:[
+        applName := self labelOfApplicationClass.
+        applName notNil ifTrue:[
+            self displayLabel:applName
                             h:labelHeight on:aGC
-                            x:(x + 10 + (self widthOn:aGC))
+                            x:(x + xOffsetApplClass)
                             y:y
                             h:h.
         ].
     ].
 !
 
+labelOfApplicationClass
+    "answer the name of the underlaying application or nil"
+    |applClass|
+
+    self isApplicationClass ifTrue:[
+        applClass := self applicationClass.
+
+        applClass notNil ifTrue:[
+            ^ ('[ ', applClass name, ' ]')
+        ].
+    ].
+    xOffsetApplClass := nil.
+    ^ nil
+!
+
 widthOn:aGC
     "return the width of the receiver, if it is to be displayed on aGC
     "
+    |applName|
+
     width isNil ifTrue:[
         width := self widthOf:(self label) on:aGC.
         width := width + 2.
+
+        applName := self labelOfApplicationClass.
+
+        applName notNil ifTrue:[
+            xOffsetApplClass := width + 10.
+            width := xOffsetApplClass + (self widthOf:applName on:aGC).
+            width := width + 2.
+        ].
     ].
     ^ width
 ! !