ListView.st
changeset 1451 3598c65cd89d
parent 1450 4ae9757ed852
child 1452 d4c481299b88
equal deleted inserted replaced
1450:4ae9757ed852 1451:3598c65cd89d
  1826      The code below uses the fonts average height parameters - these
  1826      The code below uses the fonts average height parameters - these
  1827      are not OK for some oversized national characters (such as A-dieresis).
  1827      are not OK for some oversized national characters (such as A-dieresis).
  1828      Therefore, this method should be redefined in views which will be used
  1828      Therefore, this method should be redefined in views which will be used
  1829      with national characters (i.e. editTextViews)."
  1829      with national characters (i.e. editTextViews)."
  1830 
  1830 
       
  1831     |hMax|
       
  1832 
  1831     font := font on:device.
  1833     font := font on:device.
       
  1834     hMax := font height.
       
  1835 
  1832     includesNonStrings == true ifTrue:[
  1836     includesNonStrings == true ifTrue:[
  1833         |el|
  1837         "/
  1834 
  1838         "/ find maximum height of lines
  1835         "/ for now, we do not support variable height entries ...
  1839         "/
  1836         el := list first.
  1840         hMax := list inject:hMax into:[:maxSoFar :thisLine | 
  1837         el isNil ifTrue:[
  1841                                         thisLine isNil ifTrue:[
  1838             list findFirst:[:e | e notNil 
  1842                                             maxSoFar
  1839 				    ifTrue:[el := e. true] 
  1843                                         ] ifFalse:[
  1840 				    ifFalse:[false]].
  1844                                             (thisLine isMemberOf:String) ifTrue:[
  1841         ].
  1845                                                 maxSoFar
  1842         el isNil ifTrue:[
  1846                                             ] ifFalse:[   
  1843             fontHeight := font height. "/ maxHeight.
  1847                                                 maxSoFar max:(thisLine heightOn:self)
  1844         ] ifFalse:[
  1848                                             ]
  1845             fontHeight := el heightOn:self
  1849                                         ]
  1846         ]
  1850                               ].
  1847     ] ifFalse:[
  1851 
  1848         fontHeight := font height. "/ maxHeight.
  1852     ].
  1849     ].
  1853     fontHeight := hMax + lineSpacing.
  1850     fontHeight := fontHeight + lineSpacing.
       
  1851     fontAscent := font ascent. "/ maxAscent.
  1854     fontAscent := font ascent. "/ maxAscent.
  1852     fontWidth := font width.
  1855     fontWidth := font width.
  1853     fontIsFixedWidth := font isFixedWidth.
  1856     fontIsFixedWidth := font isFixedWidth.
  1854 
  1857 
  1855     "Modified: 3.7.1997 / 12:24:25 / cg"
  1858     "Modified: 3.7.1997 / 12:24:25 / cg"
  3767 ! !
  3770 ! !
  3768 
  3771 
  3769 !ListView class methodsFor:'documentation'!
  3772 !ListView class methodsFor:'documentation'!
  3770 
  3773 
  3771 version
  3774 version
  3772     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.149 1998-02-21 16:15:53 ca Exp $'
  3775     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.150 1998-02-24 15:34:14 cg Exp $'
  3773 ! !
  3776 ! !