MenuEditor.st
changeset 853 4c906c364da2
parent 849 0001a9185d99
child 854 2d96630daf4a
--- a/MenuEditor.st	Thu May 28 12:59:57 1998 +0200
+++ b/MenuEditor.st	Thu May 28 13:16:05 1998 +0200
@@ -2537,28 +2537,48 @@
 
 !MenuEditor::TreeView methodsFor:'drawing basics'!
 
-drawLabelIndex:anIndex atX:x y:yCenter
+redrawLabelAt:x y:yTop index:anIndex
     "draw text label assigned to a node at x y( center)"
 
-    |y x2 type item|
+    |isSelected y0 x0 x1 maxX w label type item|
 
     item := (listOfNodes at:anIndex) contents.
     type := item separatorType.
 
     type isNil ifTrue:[
-        super drawLabelIndex:anIndex atX:x y:yCenter
+        ^ super redrawLabelAt:x y:yTop index:anIndex
+    ].
+    isSelected := self isInSelection:anIndex.
+
+    highlightMode == #label ifTrue:[
+        x0 := x + 4.
+
+        isSelected ifTrue:[
+            w  := 80 + 8.
+            self paint:hilightBgColor.
+            self fillRectangleX:x y:yTop width:w height:fontHeight.
+        ]
     ] ifFalse:[
-        type == #blank ifFalse:[
-            x2 := x + 80.
-
-            self displayLineFromX:x y:yCenter toX:x2 y:yCenter.
-
-            type == #double ifTrue:[
-                y := yCenter + 2.
-                self displayLineFromX:x y:y toX:x2 y:y.
-            ]    
-        ]
-    ]
+        w := 0.
+    ].
+    type == #blank ifFalse:[
+        isSelected ifTrue:[self paint:hilightFgColor]
+                  ifFalse:[self paint:fgColor].
+
+        x1 := x0 + 80.
+        y0 := yTop - 1 + (fontHeight // 2).
+        self displayLineFromX:x0 y:y0 toX:x1 y:y0.
+
+        type == #double ifTrue:[
+            y0 := y0 + 2.
+            self displayLineFromX:x0 y:y0 toX:x1 y:y0.
+        ]    
+    ].
+
+    (isSelected and:[highlightMode == #label]) ifTrue:[
+        self redrawSelFrameAtX:x y:yTop toX:(x + w)
+    ].
+
 ! !
 
 !MenuEditor::TreeView methodsFor:'event handling'!