ListView.st
changeset 607 67462978fb20
parent 598 5d5194703de8
child 627 257058092fbf
equal deleted inserted replaced
606:682579fa3b62 607:67462978fb20
  1941 
  1941 
  1942 widthOfContents
  1942 widthOfContents
  1943     "return the width of the contents in pixels
  1943     "return the width of the contents in pixels
  1944      - used for scrollbar interface"
  1944      - used for scrollbar interface"
  1945 
  1945 
  1946     |max|
  1946     |max f|
  1947 
  1947 
  1948     list isNil ifTrue:[^ 0].
  1948     list isNil ifTrue:[^ 0].
  1949     widthOfWidestLine notNil ifTrue:[^ widthOfWidestLine + (leftMargin * 2)].
  1949     widthOfWidestLine notNil ifTrue:[^ widthOfWidestLine + (leftMargin * 2)].
  1950     font := font on:device.
  1950 
       
  1951     device isNil ifTrue:[
       
  1952         "/ mhmh - really dont know yet
       
  1953         f := font on:Display
       
  1954     ] ifFalse:[
       
  1955         f := font := font on:device.
       
  1956     ].
  1951 
  1957 
  1952     includesNonStrings ifTrue:[
  1958     includesNonStrings ifTrue:[
  1953 	max := list 
  1959         max := list 
  1954 		   inject:0 
  1960                    inject:0 
  1955 		   into:[:maxSoFar :entry |
  1961                    into:[:maxSoFar :entry |
  1956 			     (
  1962                              (
  1957 				 entry isNil ifTrue:[
  1963                                  entry isNil ifTrue:[
  1958 				     0
  1964                                      0
  1959 				 ] ifFalse:[
  1965                                  ] ifFalse:[
  1960 				    entry isString ifTrue:[
  1966                                     entry isString ifTrue:[
  1961 					font widthOf:entry
  1967                                         f widthOf:entry
  1962 				    ] ifFalse:[
  1968                                     ] ifFalse:[
  1963 					entry widthIn:self
  1969                                         entry widthIn:self
  1964 				    ]
  1970                                     ]
  1965 				 ]
  1971                                  ]
  1966 			     ) max:maxSoFar.
  1972                              ) max:maxSoFar.
  1967 			]
  1973                         ]
  1968     ] ifFalse:[
  1974     ] ifFalse:[
  1969 	fontIsFixedWidth ifTrue:[
  1975         fontIsFixedWidth ifTrue:[
  1970 	    max := self lengthOfLongestLine * fontWidth
  1976             max := self lengthOfLongestLine * fontWidth
  1971 	] ifFalse:[
  1977         ] ifFalse:[
  1972 	    max := 0.
  1978             max := 0.
  1973 	    list notNil ifTrue:[
  1979             list notNil ifTrue:[
  1974 		max := max max:(font widthOf:list)
  1980                 max := max max:(f widthOf:list)
  1975 	    ].
  1981             ].
  1976 	].
  1982         ].
  1977     ].
  1983     ].
  1978     widthOfWidestLine := max.
  1984     widthOfWidestLine := max.
  1979     ^ max + (leftMargin * 2)
  1985     ^ max + (leftMargin * 2)
       
  1986 
       
  1987     "Modified: 30.4.1996 / 17:33:57 / cg"
  1980 !
  1988 !
  1981 
  1989 
  1982 xOriginOfContents
  1990 xOriginOfContents
  1983     "return the horizontal origin of the contents in pixels
  1991     "return the horizontal origin of the contents in pixels
  1984      - used for scrollbar interface"
  1992      - used for scrollbar interface"
  3080 ! !
  3088 ! !
  3081 
  3089 
  3082 !ListView class methodsFor:'documentation'!
  3090 !ListView class methodsFor:'documentation'!
  3083 
  3091 
  3084 version
  3092 version
  3085     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.80 1996-04-30 09:39:03 cg Exp $'
  3093     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.81 1996-04-30 15:36:22 cg Exp $'
  3086 ! !
  3094 ! !