HierarchicalListView.st
changeset 1976 1788b0045176
parent 1916 3021f70d9211
child 2049 ad5f350ae2c2
equal deleted inserted replaced
1975:bad9d0302b03 1976:1788b0045176
   460         ].
   460         ].
   461         self repairDamage.
   461         self repairDamage.
   462         self invalidate:(Rectangle left:x0 top:y0 width:(x1 - x0) height:h) 
   462         self invalidate:(Rectangle left:x0 top:y0 width:(x1 - x0) height:h) 
   463               repairNow:true.
   463               repairNow:true.
   464     ]
   464     ]
   465 
   465 !
   466 
   466 
   467 
   467 listChangedInsert:firstAddedIndex nItems:nLines
   468 
   468     "must draw vertical lines above the added items
   469 
   469     "
       
   470     |item prnt idx level yTop yBot xLft rec start maxY|
       
   471 
       
   472     super listChangedInsert:firstAddedIndex nItems:nLines.
       
   473 
       
   474     (     shown
       
   475      and:[showLines
       
   476      and:[firstAddedIndex > 1
       
   477      and:[nLines ~~ 0
       
   478      and:[(item := list at:firstAddedIndex ifAbsent:nil) notNil
       
   479      and:[(level := item level) > 1]]]]]
       
   480     ) ifFalse:[
       
   481          ^ self.
       
   482     ].
       
   483     xLft := (self xOfFigureLevel:(level - 1)) + (imageWidth // 2) - 1.
       
   484 
       
   485     (xLft > margin and:[xLft < (width - margin)]) ifFalse:[
       
   486         ^ self
       
   487     ].
       
   488     start := firstAddedIndex - 1.
       
   489 
       
   490     start to:1 by:-1 do:[:i| |el|
       
   491         el := list at:i.
       
   492 
       
   493         el level <= level ifTrue:[
       
   494             i == start ifTrue:[^ self].
       
   495 
       
   496             yTop := (self yVisibleOfLine:i + 1) max:margin.
       
   497             maxY := height - margin.
       
   498 
       
   499             yTop < maxY ifTrue:[
       
   500                 yBot := (self yVisibleOfLine:firstAddedIndex) - 1 min:maxY.
       
   501                 self invalidate:(Rectangle left:xLft top:yTop width:3 height:(yBot - yTop))
       
   502             ].
       
   503             ^ self
       
   504         ]
       
   505     ].
   470 !
   506 !
   471 
   507 
   472 update:what with:aPara from:chgObj
   508 update:what with:aPara from:chgObj
   473     "get the status of <showRoot> from the list
   509     "get the status of <showRoot> from the list
   474     "
   510     "
  1137 ! !
  1173 ! !
  1138 
  1174 
  1139 !HierarchicalListView class methodsFor:'documentation'!
  1175 !HierarchicalListView class methodsFor:'documentation'!
  1140 
  1176 
  1141 version
  1177 version
  1142     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.36 2001-01-09 17:36:48 ca Exp $'
  1178     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.37 2001-07-04 08:35:29 ca Exp $'
  1143 ! !
  1179 ! !