diff -r c24c7584abe4 -r 4c906c364da2 MenuEditor.st --- 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'!