SelTreeV.st
changeset 773 b3596157f97d
parent 771 0c57b324cf4d
child 774 98d6c7e3e851
equal deleted inserted replaced
772:9ae43992a603 773:b3596157f97d
    15 	instanceVariableNames:'validateDoubleClickBlock selectionHolder rootHolder imageWidth
    15 	instanceVariableNames:'validateDoubleClickBlock selectionHolder rootHolder imageWidth
    16 		showLines listOfNodes imageInset textInset labelOffsetY lineMask
    16 		showLines listOfNodes imageInset textInset labelOffsetY lineMask
    17 		lineColor openIndicator computeResources closeIndicator showRoot
    17 		lineColor openIndicator computeResources closeIndicator showRoot
    18 		extentOpenIndicator extentCloseIndicator showDirectoryIndicator
    18 		extentOpenIndicator extentCloseIndicator showDirectoryIndicator
    19 		showDirectoryIndicatorForRoot indicatorExtentDiv2 imageOpened
    19 		showDirectoryIndicatorForRoot indicatorExtentDiv2 imageOpened
    20 		imageClosed imageItem discardMotionEvents'
    20 		imageClosed imageItem discardMotionEvents registeredImages'
    21 	classVariableNames:'ImageOpened ImageClosed ImageItem OpenIndicator CloseIndicator'
    21 	classVariableNames:'ImageOpened ImageClosed ImageItem OpenIndicator CloseIndicator'
    22 	poolDictionaries:''
    22 	poolDictionaries:''
    23 	category:'Views-Text'
    23 	category:'Views-Text'
    24 !
    24 !
    25 
    25 
   944 initialize
   944 initialize
   945     "setup instance attributes
   945     "setup instance attributes
   946     "
   946     "
   947     super initialize.
   947     super initialize.
   948     self bitGravity:#NorthWest.
   948     self bitGravity:#NorthWest.
   949     showLines := true.
   949     showRoot := showDirectoryIndicatorForRoot      := showLines := computeResources := true.
   950     showRoot  := true.
   950     showDirectoryIndicator := discardMotionEvents := false.
   951     computeResources := true.
       
   952     showDirectoryIndicator := false.
       
   953     showDirectoryIndicatorForRoot := true.
       
   954     discardMotionEvents := false.
       
   955     lineMask := Form width:2 height:2 fromArray:#[16rAA 16r55].
   951     lineMask := Form width:2 height:2 fromArray:#[16rAA 16r55].
   956 
   952     registeredImages := IdentityDictionary new.
   957     textInset  := 4.
   953     textInset  := 4.
   958     imageInset := 0.    "/ set during indication enabled
   954     imageInset := 0.    "/ set during indication enabled
   959     imageWidth := 8.    "/ default: will change during startup
   955     imageWidth := 8.    "/ default: will change during startup
   960     self model:nil.     "/ creates a default model.
   956     self model:nil.     "/ creates a default model.
   961 !
   957 !
  1268 !SelectionInTreeView methodsFor:'queries'!
  1264 !SelectionInTreeView methodsFor:'queries'!
  1269 
  1265 
  1270 figureFor:aNode
  1266 figureFor:aNode
  1271     "access figure for a node
  1267     "access figure for a node
  1272     "
  1268     "
  1273     |icon|
  1269     |unregisteredImage registeredImage|
  1274     (icon := aNode icon) notNil
  1270 
       
  1271     (unregisteredImage := aNode icon) notNil
  1275     ifTrue:
  1272     ifTrue:
  1276     [
  1273     [
  1277         icon device ~= device 
  1274         (registeredImage := registeredImages at: unregisteredImage ifAbsent: nil) isNil
  1278         ifTrue: 
  1275         ifTrue:
  1279         [
  1276         [           
  1280             icon := icon onDevice: device. 
  1277             registeredImage := unregisteredImage on: device. 
  1281             aNode icon: icon. 
  1278             registeredImage clearMaskedPixels.
  1282             icon clearMaskedPixels
  1279             registeredImages at: unregisteredImage put: registeredImage
  1283         ].
  1280         ].
  1284         ^icon
  1281         ^registeredImage
  1285     ].
  1282     ].
  1286 
  1283 
  1287     aNode hasChildren ifTrue:[
  1284     aNode hasChildren ifTrue:[
  1288         aNode isExpandable ifTrue:[ ^ imageClosed ]
  1285         aNode isExpandable ifTrue:[ ^ imageClosed ]
  1289                           ifFalse:[ ^ imageOpened ]
  1286                           ifFalse:[ ^ imageOpened ]
  1555 ! !
  1552 ! !
  1556 
  1553 
  1557 !SelectionInTreeView class methodsFor:'documentation'!
  1554 !SelectionInTreeView class methodsFor:'documentation'!
  1558 
  1555 
  1559 version
  1556 version
  1560     ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.42 1998-02-20 18:35:45 cg Exp $'
  1557     ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.43 1998-02-22 13:36:02 tz Exp $'
  1561 ! !
  1558 ! !