ListView.st
changeset 1451 3598c65cd89d
parent 1450 4ae9757ed852
child 1452 d4c481299b88
--- a/ListView.st	Sat Feb 21 17:15:53 1998 +0100
+++ b/ListView.st	Tue Feb 24 16:34:14 1998 +0100
@@ -1828,26 +1828,29 @@
      Therefore, this method should be redefined in views which will be used
      with national characters (i.e. editTextViews)."
 
+    |hMax|
+
     font := font on:device.
+    hMax := font height.
+
     includesNonStrings == true ifTrue:[
-        |el|
-
-        "/ for now, we do not support variable height entries ...
-        el := list first.
-        el isNil ifTrue:[
-            list findFirst:[:e | e notNil 
-				    ifTrue:[el := e. true] 
-				    ifFalse:[false]].
-        ].
-        el isNil ifTrue:[
-            fontHeight := font height. "/ maxHeight.
-        ] ifFalse:[
-            fontHeight := el heightOn:self
-        ]
-    ] ifFalse:[
-        fontHeight := font height. "/ maxHeight.
+        "/
+        "/ find maximum height of lines
+        "/
+        hMax := list inject:hMax into:[:maxSoFar :thisLine | 
+                                        thisLine isNil ifTrue:[
+                                            maxSoFar
+                                        ] ifFalse:[
+                                            (thisLine isMemberOf:String) ifTrue:[
+                                                maxSoFar
+                                            ] ifFalse:[   
+                                                maxSoFar max:(thisLine heightOn:self)
+                                            ]
+                                        ]
+                              ].
+
     ].
-    fontHeight := fontHeight + lineSpacing.
+    fontHeight := hMax + lineSpacing.
     fontAscent := font ascent. "/ maxAscent.
     fontWidth := font width.
     fontIsFixedWidth := font isFixedWidth.
@@ -3769,5 +3772,5 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.149 1998-02-21 16:15:53 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.150 1998-02-24 15:34:14 cg Exp $'
 ! !