HierarchicalListView.st
changeset 5003 3ad28e66c27e
parent 4969 338e10e12404
child 5282 ae9d2fd997ef
equal deleted inserted replaced
5002:ab6066bcf4d7 5003:3ad28e66c27e
   392     "
   392     "
   393     (aColor notNil and:[aColor ~= lineColor]) ifTrue:[
   393     (aColor notNil and:[aColor ~= lineColor]) ifTrue:[
   394         lineColor := aColor.
   394         lineColor := aColor.
   395 
   395 
   396         shown ifTrue:[
   396         shown ifTrue:[
   397             lineColor := lineColor onDevice:self graphicsDevice.
   397             lineColor := lineColor onDevice:device.
   398             showLines ifTrue:[ self invalidate ]
   398             showLines ifTrue:[ self invalidate ]
   399         ]
   399         ]
   400     ].
   400     ].
   401 ! !
   401 ! !
   402 
   402 
  1288     "
  1288     "
  1289     |image defaultWidth|
  1289     |image defaultWidth|
  1290 
  1290 
  1291     super fetchResources.
  1291     super fetchResources.
  1292 
  1292 
  1293     lineColor      := lineColor onDevice:self graphicsDevice.
  1293     lineColor      := lineColor onDevice:device.
  1294     openIndicator  := self imageOnMyDevice:openIndicator.
  1294     openIndicator  := self imageOnMyDevice:openIndicator.
  1295     closeIndicator := self imageOnMyDevice:closeIndicator.
  1295     closeIndicator := self imageOnMyDevice:closeIndicator.
  1296     defaultWidth   := imageWidth.
  1296     defaultWidth   := imageWidth.
  1297 
  1297 
  1298     icons keysAndValuesDo:[:aKey :anImage|
  1298     icons keysAndValuesDo:[:aKey :anImage|
  1302             image := self imageOnMyDevice:anImage.
  1302             image := self imageOnMyDevice:anImage.
  1303             icons at:aKey put:image.
  1303             icons at:aKey put:image.
  1304             imageWidth := image width max:imageWidth.
  1304             imageWidth := image width max:imageWidth.
  1305         ]
  1305         ]
  1306     ].
  1306     ].
  1307     imageWidth      := (imageWidth + 1 // 2 * 2) max:defaultWidth.
  1307     imageWidth      := ((imageWidth + 1) // 2 * 2) max:defaultWidth.
  1308     alignTextRightX := imageWidth + 20 max:alignTextRightX.
  1308     alignTextRightX := imageWidth + 20 max:alignTextRightX.
  1309 ! !
  1309 ! !
  1310 
  1310 
  1311 !HierarchicalListView methodsFor:'initialization & release'!
  1311 !HierarchicalListView methodsFor:'initialization & release'!
  1312 
  1312 
  1371 
  1371 
  1372     iconOrKey notNil ifTrue:[
  1372     iconOrKey notNil ifTrue:[
  1373         iconOrKey isImageOrForm ifTrue:[
  1373         iconOrKey isImageOrForm ifTrue:[
  1374             "/ got an image; have to register the image on my device
  1374             "/ got an image; have to register the image on my device
  1375 
  1375 
  1376             iconOrKey device == self graphicsDevice ifTrue:[
  1376             iconOrKey device == device ifTrue:[
  1377                 ^ iconOrKey
  1377                 ^ iconOrKey
  1378             ].
  1378             ].
  1379             ^ icons at:iconOrKey ifAbsentPut:[ self imageOnMyDevice:iconOrKey ].
  1379             ^ icons at:iconOrKey ifAbsentPut:[ self imageOnMyDevice:iconOrKey ].
  1380         ].
  1380         ].
  1381         iconOrKey == #none ifTrue:[^ nil].
  1381         iconOrKey == #none ifTrue:[^ nil].