fix drawing horizontal lines for the root element(s)
authorClaus Gittinger <cg@exept.de>
Thu, 01 Apr 1999 09:08:19 +0200
changeset 1305 c8f2fe1fac85
parent 1304 e6693ac51d54
child 1306 56e90a9e5da1
fix drawing horizontal lines for the root element(s)
SelTreeV.st
SelectionInTreeView.st
--- a/SelTreeV.st	Wed Mar 31 19:09:45 1999 +0200
+++ b/SelTreeV.st	Thu Apr 01 09:08:19 1999 +0200
@@ -821,6 +821,7 @@
     "redraw from line to line without clearing the background
     "
     |node prevNode parent p1 p2 showVLines showHLine lv nxtPrnt
+     showRootNot isFirst
 
      x        "{ Class:SmallInteger }"
      y        "{ Class:SmallInteger }"
@@ -842,6 +843,7 @@
      limitLvI "{ Class:SmallInteger }"
      limitLvX "{ Class:SmallInteger }"
     |
+
     yBot     := y0.
     yCtr     := yBot - (fontHeight // 2).
     widthLvl := imageInset + imageWidth.
@@ -864,6 +866,7 @@
     start == 1 ifTrue:[
         begHLnY := yCtr + fontHeight.
     ].
+    showRootNot := showRoot not.
 
     start to:stop do:[:anIndex|
         node := listOfNodes at:anIndex.
@@ -882,16 +885,14 @@
                 begHLnX := node level * widthLvl + offsHLnX.
             ].
 
-            endHLnX := begHLnX + widthLvl.
+            isFirst    := parent isNil or:[(showRootNot and:[level == 2])].
+            endHLnX    := begHLnX + widthLvl.
             showVLines := begHLnX >= x0 and:[level > drawVLinesFromLevel].
-            showHLine  := (      x0 < endHLnX
-                            and:[x1 > begHLnX
-                            and:[(     parent notNil
-                                   or:[showDirectoryIndicatorForRoot
-                                  and:[showDirectoryIndicator]]
-                                 )
-                                ]]
-                          ).
+            showHLine  := x0 < endHLnX and:[x1 > begHLnX].
+
+            (showHLine and:[isFirst]) ifTrue:[
+                showHLine := showDirectoryIndicatorForRoot and:[showDirectoryIndicator]
+            ]
         ].
 
         showHLine ifTrue:[
@@ -2360,5 +2361,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.79 1999-03-23 09:54:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.80 1999-04-01 07:08:19 cg Exp $'
 ! !
--- a/SelectionInTreeView.st	Wed Mar 31 19:09:45 1999 +0200
+++ b/SelectionInTreeView.st	Thu Apr 01 09:08:19 1999 +0200
@@ -821,6 +821,7 @@
     "redraw from line to line without clearing the background
     "
     |node prevNode parent p1 p2 showVLines showHLine lv nxtPrnt
+     showRootNot isFirst
 
      x        "{ Class:SmallInteger }"
      y        "{ Class:SmallInteger }"
@@ -842,6 +843,7 @@
      limitLvI "{ Class:SmallInteger }"
      limitLvX "{ Class:SmallInteger }"
     |
+
     yBot     := y0.
     yCtr     := yBot - (fontHeight // 2).
     widthLvl := imageInset + imageWidth.
@@ -864,6 +866,7 @@
     start == 1 ifTrue:[
         begHLnY := yCtr + fontHeight.
     ].
+    showRootNot := showRoot not.
 
     start to:stop do:[:anIndex|
         node := listOfNodes at:anIndex.
@@ -882,16 +885,14 @@
                 begHLnX := node level * widthLvl + offsHLnX.
             ].
 
-            endHLnX := begHLnX + widthLvl.
+            isFirst    := parent isNil or:[(showRootNot and:[level == 2])].
+            endHLnX    := begHLnX + widthLvl.
             showVLines := begHLnX >= x0 and:[level > drawVLinesFromLevel].
-            showHLine  := (      x0 < endHLnX
-                            and:[x1 > begHLnX
-                            and:[(     parent notNil
-                                   or:[showDirectoryIndicatorForRoot
-                                  and:[showDirectoryIndicator]]
-                                 )
-                                ]]
-                          ).
+            showHLine  := x0 < endHLnX and:[x1 > begHLnX].
+
+            (showHLine and:[isFirst]) ifTrue:[
+                showHLine := showDirectoryIndicatorForRoot and:[showDirectoryIndicator]
+            ]
         ].
 
         showHLine ifTrue:[
@@ -2360,5 +2361,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.79 1999-03-23 09:54:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.80 1999-04-01 07:08:19 cg Exp $'
 ! !