ListView.st
changeset 2208 a37459b4dffa
parent 2202 edf8821d56a1
child 2209 70076d488bf7
equal deleted inserted replaced
2207:80ca02ca0111 2208:a37459b4dffa
  2486 xOfCol:col inVisibleLine:visLineNr
  2486 xOfCol:col inVisibleLine:visLineNr
  2487     "given a visible line- and colNr, return x-coordinate in view"
  2487     "given a visible line- and colNr, return x-coordinate in view"
  2488 
  2488 
  2489     |line lineSize tcol|
  2489     |line lineSize tcol|
  2490 
  2490 
       
  2491     col == 1 ifTrue:[^ textStartLeft].
  2491     tcol := col - 1.
  2492     tcol := col - 1.
       
  2493 
  2492     line := self visibleAt:visLineNr.
  2494     line := self visibleAt:visLineNr.
  2493     (fontIsFixedWidth 
  2495     (fontIsFixedWidth 
  2494     and:[line isNil
  2496     and:[line isNil
  2495 	 or:[line isMemberOf:String]]) ifTrue:[
  2497          or:[line isMemberOf:String]]) ifTrue:[
  2496 	^ (tcol * fontWidth) + textStartLeft
  2498         ^ (tcol * fontWidth) + textStartLeft
  2497     ].
  2499     ].
  2498     line notNil ifTrue:[
  2500     line notNil ifTrue:[
  2499 	lineSize := line size
  2501         lineSize := line size
  2500     ] ifFalse:[
  2502     ] ifFalse:[
  2501 	lineSize := 0
  2503         lineSize := 0
  2502     ].
  2504     ].
  2503     (lineSize == 0) ifTrue:[
  2505     (lineSize == 0) ifTrue:[
  2504 	^ (tcol * fontWidth) + textStartLeft
  2506         ^ (tcol * fontWidth) + textStartLeft
  2505     ].
  2507     ].
  2506 
  2508 
  2507     (lineSize < col) ifTrue:[
  2509     (lineSize < col) ifTrue:[
  2508 	^ (line widthOn:self) 
  2510         ^ (line widthOn:self) 
  2509 	  + (fontWidth * (tcol - lineSize)) 
  2511           + (fontWidth * (tcol - lineSize)) 
  2510 	  + textStartLeft
  2512           + textStartLeft
  2511     ].
  2513     ].
  2512     (line isMemberOf:String) ifTrue:[
  2514     (line isMemberOf:String) ifTrue:[
  2513 	^ (font widthOf:line from:1 to:tcol) + textStartLeft
  2515         ^ (font widthOf:line from:1 to:tcol) + textStartLeft
  2514     ].
  2516     ].
  2515     ^ ((line copyTo:tcol) widthOn:self) + textStartLeft
  2517     ^ ((line copyTo:tcol) widthOn:self) + textStartLeft
  2516 
  2518 
  2517     "Modified: / 3.9.1998 / 21:56:33 / cg"
  2519     "Modified: / 3.9.1998 / 21:56:33 / cg"
  2518 !
  2520 !
  4046 ! !
  4048 ! !
  4047 
  4049 
  4048 !ListView class methodsFor:'documentation'!
  4050 !ListView class methodsFor:'documentation'!
  4049 
  4051 
  4050 version
  4052 version
  4051     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.226 2000-07-28 14:55:40 cg Exp $'
  4053     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.227 2000-08-09 22:18:02 cg Exp $'
  4052 ! !
  4054 ! !