ListModelView.st
changeset 3712 1c9ef2f85066
parent 3576 e990d7f45310
child 3715 22a0f066793d
equal deleted inserted replaced
3711:ce2e9d1bcfcc 3712:1c9ef2f85066
   517 
   517 
   518     (newSz - 1) ~~ self size ifTrue:[
   518     (newSz - 1) ~~ self size ifTrue:[
   519         "/
   519         "/
   520         "/ no longer synchronized
   520         "/ no longer synchronized
   521         "/
   521         "/
   522         ^ self lostSynchronisation
   522         self lostSynchronisation.
   523     ].
   523         ^ self
   524     newLines := startOfLinesY copy.
   524     ].
       
   525     newLines := startOfLinesY. "/ copy.
   525     newLines addAll:(Array new:nLines) beforeIndex:start + 1.
   526     newLines addAll:(Array new:nLines) beforeIndex:start + 1.
   526     absY0 := newLines at:start.
   527     absY0 := newLines at:start.
   527     absY1 := absY0.
   528     absY1 := absY0.
   528     run   := start.
   529     run   := start.
   529 
   530 
   550         viewOrigin y:(dltY + orgY).
   551         viewOrigin y:(dltY + orgY).
   551         self originChanged:(0 @ dltY).
   552         self originChanged:(0 @ dltY).
   552     ].
   553     ].
   553 
   554 
   554     (visY0 >= maxHg or:[visY1 <= margin]) ifTrue:[
   555     (visY0 >= maxHg or:[visY1 <= margin]) ifTrue:[
   555         ^ self contentsChanged
   556         self contentsChanged.
       
   557         ^ self
   556     ].
   558     ].
   557     visY0 := visY0 max:margin.
   559     visY0 := visY0 max:margin.
   558     visY1 := visY1 min:maxHg.
   560     visY1 := visY1 min:maxHg.
   559 
   561 
   560     self hasDamage ifTrue:[
   562     self hasDamage ifTrue:[
   561         self invalidate:(Rectangle left:0
   563         self invalidate:(Rectangle left:0
   562                                     top:visY0 
   564                                     top:visY0 
   563                                   width:width 
   565                                   width:width 
   564                                  height:height - visY0).
   566                                  height:height - visY0).
   565 
   567 
   566         ^ self contentsChanged.
   568         self contentsChanged.
       
   569         ^ self
   567     ].
   570     ].
   568 
   571 
   569     (start == self size or:[(cpyHg := maxHg - visY1) < 20]) ifTrue:[
   572     (start == self size or:[(cpyHg := maxHg - visY1) < 20]) ifTrue:[
   570         visY1 := maxHg
   573         visY1 := maxHg
   571     ] ifFalse:[
   574     ] ifFalse:[
   625 
   628 
   626     absY0 := self yAbsoluteOfLine:start.
   629     absY0 := self yAbsoluteOfLine:start.
   627     absY1 := self yAbsoluteOfLine:stop + 1.
   630     absY1 := self yAbsoluteOfLine:stop + 1.
   628     dltY  := absY1 - absY0.
   631     dltY  := absY1 - absY0.
   629 
   632 
   630     newLines := startOfLinesY copy.
   633     newLines := startOfLinesY. "/ copy.
   631     newLines removeFromIndex:(start + 1) toIndex:(stop + 1).
   634     newLines removeFromIndex:(start + 1) toIndex:(stop + 1).
   632 
   635 
   633     (start + 1) to:newSz do:[:i|
   636     (start + 1) to:newSz do:[:i|
   634         absY0 := newLines at:i.
   637         absY0 := newLines at:i.
   635         newLines at:i put:(absY0 - dltY).
   638         newLines at:i put:(absY0 - dltY).
  1884 ! !
  1887 ! !
  1885 
  1888 
  1886 !ListModelView class methodsFor:'documentation'!
  1889 !ListModelView class methodsFor:'documentation'!
  1887 
  1890 
  1888 version
  1891 version
  1889     ^ '$Header: /cvs/stx/stx/libwidg2/ListModelView.st,v 1.110 2008-10-26 20:13:07 stefan Exp $'
  1892     ^ '$Header: /cvs/stx/stx/libwidg2/ListModelView.st,v 1.111 2009-06-08 16:50:58 ca Exp $'
  1890 ! !
  1893 ! !
  1891 
  1894 
  1892 ListModelView initialize!
  1895 ListModelView initialize!