Tools__ViewTreeItem.st
changeset 2456 3d8a5dd293ba
parent 2452 7892f26996b7
--- a/Tools__ViewTreeItem.st	Thu Jan 29 10:00:44 2009 +0100
+++ b/Tools__ViewTreeItem.st	Thu Jan 29 10:01:04 2009 +0100
@@ -239,21 +239,50 @@
     ^ nil
 !
 
+displayIcon:anIcon atX:x y:y on:aGC
+    |x0 y0 y1 w|
+
+    super displayIcon:anIcon atX:x y:y on:aGC.
+
+    self exists ifFalse:[
+        aGC paint:(Color red).
+
+        y0 := y + 1.
+        y1 := y + anIcon height - 2.
+
+        x0 := x - 1.
+        w  := anIcon width.
+
+        2 timesRepeat:[
+            aGC displayLineFromX:x0 y:y0 toX:(x0 + w) y:y1.
+            aGC displayLineFromX:x0 y:y1 toX:(x0 + w) y:y0.
+            x0 := x0 + 1.
+        ].
+    ].
+!
+
 displayOn:aGC x:x y:y h:h
-    |labelHeight paint additionalName|
+    |labelHeight additionalName label isValidAndShown|
+
+    label := self label.
+    label isEmptyOrNil ifTrue:[^ self].
 
     widget id isNil ifTrue:[
         isDrawnShown := false.
-        self exists ifFalse:[^ self].
-        paint := Color white.
+
+        self exists ifFalse:[
+            xOffsetAdditionalName := nil.
+        ].
+        isValidAndShown := false.
     ] ifFalse:[
-        isDrawnShown := widget shown.
-        paint := isDrawnShown ifTrue:[Color black] ifFalse:[Color darkGray].
+        isValidAndShown := widget shown.
     ].
-    aGC paint:paint.
+    isValidAndShown ifFalse:[
+        label := Text string:label emphasis:#italic
+    ].
 
     labelHeight := self heightOn:aGC.
-    self displayLabel:(self label) h:labelHeight on:aGC x:x y:y h:h.
+    self displayLabel:label h:labelHeight on:aGC x:x y:y h:h.
 
     xOffsetAdditionalName notNil ifTrue:[
         additionalName := self additionalLabelForItem:self.