HierarchicalListView.st
branchjv
changeset 6253 733a1d1bc8fc
parent 5389 d704f9a06ca8
--- a/HierarchicalListView.st	Tue May 18 12:48:47 2021 +0100
+++ b/HierarchicalListView.st	Tue Jun 01 10:49:16 2021 +0100
@@ -1,5 +1,6 @@
 "
  COPYRIGHT (c) 1999 by eXept Software AG
+ COPYRIGHT (c) 2021 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -30,6 +31,7 @@
 copyright
 "
  COPYRIGHT (c) 1999 by eXept Software AG
+ COPYRIGHT (c) 2021 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -853,77 +855,79 @@
     xR := xL + w.
 
     showIndicators ifTrue:[
-	offIndcY := indicatorWidth // 2.
+        offIndcY := indicatorWidth // 2.
     ].
 
     showLines ifTrue:[
-	self drawLinesFrom:start to:stop x:xL y:yT toX:xR
+        self drawLinesFrom:start to:stop x:xL y:yT toX:xR
     ].
     prevParent := #NIL.         "/ to force a recompute
     yBot       := yT.
     showIndc   := false.
 
     start to:stop do:[:anIndex|
-	(item := self at:anIndex ifAbsent:nil) isNil ifTrue:[
-	    ^ self      "/ list changed
-	].
-	yTop   := yBot.
-	yBot   := self yVisibleOfLine:(anIndex + 1).
-	height := yBot - yTop.
-	yCtr   := yTop + (height // 2).
+        (item := self at:anIndex ifAbsent:nil) isNil ifTrue:[
+            ^ self      "/ list changed
+        ].
+        yTop   := yBot.
+        yBot   := self yVisibleOfLine:(anIndex + 1).
+        height := yBot - yTop.
+        yCtr   := yTop + (height // 2).
 
-	item parent ~~ prevParent ifTrue:[
-	    prevParent  := item parent.
-	    level       := item level.
-	    xIcon       := self xVisibleOfIconAtLevel:level.
-	    xText       := self xVisibleOfTextAtLevel:level.
-	    showText    := (xText < xR).
-	    showIcon    := (xIcon < xR and:[xText > xL]).
+        item parent ~~ prevParent ifTrue:[
+            prevParent  := item parent.
+            level       := item level.
+            xIcon       := self xVisibleOfIconAtLevel:level.
+            xText       := self xVisibleOfTextAtLevel:level.
+            showText    := (xText < xR).
+            showIcon    := (xIcon < xR and:[xText > xL]).
 
-	    showIndicators ifTrue:[
-		xIndc  := self xVisibleOfIndicatorAtLevel:level.
-		showIndc := (xIcon > xL and:[xIndc < xR]).
+            showIndicators ifTrue:[
+                xIndc  := self xVisibleOfIndicatorAtLevel:level.
+                showIndc := (xIcon > xL and:[xIndc < xR]).
 
-		showIndc ifTrue:[
-		    showIndc := prevParent notNil or:[showLeftIndicators]
-		]
-	    ]
-	].
-
-	(showIcon and:[(icon := self validateDrawableIconFor:item) notNil]) ifTrue:[
-	    icnWdt := icon width.
+                showIndc ifTrue:[
+                    showIndc := prevParent notNil or:[showLeftIndicators]
+                ]
+            ]
+        ].
 
-	    (xIcon + icnWdt) > xL ifTrue:[
-		iconAlignment == #left ifTrue:[
-		    x := xIcon.
-		] ifFalse:[
-		    x := xText - textStartLeft.
+        showText ifTrue:[
+            self drawLabelAt:anIndex x:xText y:yTop h:height
+        ].
+
+        (showIcon and:[(icon := self validateDrawableIconFor:item) notNil]) ifTrue:[
+            icnWdt := icon width.
+
+            (xIcon + icnWdt) > xL ifTrue:[
+                iconAlignment == #left ifTrue:[
+                    x := xIcon.
+                ] ifFalse:[
+                    x := xText - textStartLeft.
 
-		    iconAlignment == #center ifTrue:[
-			x := (x + xIcon - icnWdt) // 2.
-		    ] ifFalse:[
-			x := x - icnWdt.
-		    ].
-		].
-		yIcon := yCtr - (icon height // 2).
-		item displayIcon:icon atX:x y:yIcon on:self.
-	    ]
-	].
+                    iconAlignment == #center ifTrue:[
+                        x := (x + xIcon - icnWdt) // 2.
+                    ] ifFalse:[
+                        x := x - icnWdt.
+                    ].
+                ].
+                yIcon := yCtr - (icon height // 2).
+                item displayIcon:icon atX:x y:yIcon on:self.
+            ]
+        ].
 
-	showText ifTrue:[
-	    self drawLabelAt:anIndex x:xText y:yTop h:height
-	].
-	(showIndc and:[item hasIndicator]) ifTrue:[
-	    item isExpanded ifTrue:[icon := openIndicator ]
-			   ifFalse:[icon := closeIndicator].
+        (showIndc and:[item hasIndicator]) ifTrue:[
+            item isExpanded ifTrue:[icon := openIndicator ]
+                           ifFalse:[icon := closeIndicator].
 
-	    icon notNil ifTrue:[
-		icon displayOn:self x:xIndc y:(yCtr - offIndcY).
-	    ].
-	].
+            icon notNil ifTrue:[
+                icon displayOn:self x:xIndc y:(yCtr - offIndcY).
+            ].
+        ].
     ].
 
     "Modified: / 23-06-2006 / 12:49:26 / fm"
+    "Modified: / 01-06-2021 / 10:36:18 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 drawLinesFrom:start to:stop x:xL y:yT toX:xR
@@ -1672,5 +1676,10 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !