HierarchicalListView.st
changeset 2049 ad5f350ae2c2
parent 1976 1788b0045176
child 2069 7891c7d3af69
--- a/HierarchicalListView.st	Tue Nov 13 20:30:37 2001 +0100
+++ b/HierarchicalListView.st	Thu Nov 15 09:35:23 2001 +0100
@@ -530,7 +530,7 @@
     "draw the items between start to stop without clearing the background
     "
     |item prevItem parent icon showIndc showIcon showText nxtPrnt
-
+     iconExtent
      yTop      "{ Class:SmallInteger }"
      yCtr      "{ Class:SmallInteger }"
      yBot      "{ Class:SmallInteger }"
@@ -566,10 +566,13 @@
     showIndc := false.
 
     indicatorAction notNil ifTrue:[
-        icon     := openIndicator extent // 2.
-        offIndcX := imageWidth // 2 - widthLvl.
-        offIndcX := offIndcX - icon x.
-        offIndcY := icon y.
+        offIndcX := offIndcY := 0.
+        openIndicator notNil ifTrue:[
+            iconExtent     := openIndicator extent // 2.
+            offIndcX := imageWidth // 2 - widthLvl.
+            offIndcX := offIndcX - iconExtent x.
+            offIndcY := iconExtent y.
+        ]
     ].
 
     showLines ifTrue:[
@@ -641,12 +644,12 @@
         ].
         (showIndc and:[item hasChildren]) ifTrue:[
             icon := item isExpanded ifTrue:[openIndicator] ifFalse:[closeIndicator].
-            self displayForm:icon x:xIndc y:(yCtr - offIndcY)
+            icon notNil ifTrue:[
+                self displayForm:icon x:xIndc y:(yCtr - offIndcY)
+            ]
         ].
         prevItem := item.
     ]
-
-
 !
 
 drawLinesFrom:start to:stop x:xL y:yT toX:xR
@@ -1175,5 +1178,5 @@
 !HierarchicalListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.37 2001-07-04 08:35:29 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.38 2001-11-15 08:35:23 ca Exp $'
 ! !