added query for height with n lines
authorClaus Gittinger <cg@exept.de>
Sat, 27 Jan 1996 18:32:13 +0100
changeset 311 cddf10b2207e
parent 310 4bbc8deffc8c
child 312 008267b920d9
added query for height with n lines
ListView.st
--- a/ListView.st	Sat Jan 27 18:30:14 1996 +0100
+++ b/ListView.st	Sat Jan 27 18:32:13 1996 +0100
@@ -1554,6 +1554,16 @@
     ^ firstLineShown
 !
 
+heightForLines:numberOfLines
+    "return the height of the receiver, if numberOfLines are to be displayed"
+
+    "need a device font for query"
+    font := font on:device.
+    ^ numberOfLines * fontHeight + topMargin + font descent + (lineSpacing) + (margin * 2)
+
+    "Created: 27.1.1996 / 16:55:39 / cg"
+!
+
 heightOfContents
     "return the height of the contents in pixels
      - used for scrollbar interface"
@@ -2781,5 +2791,5 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.58 1996-01-27 11:51:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.59 1996-01-27 17:32:13 cg Exp $'
 ! !