ListView.st
changeset 890 abd28e2f66ca
parent 887 9b25df4d193a
child 895 02d8e324dca5
equal deleted inserted replaced
889:4ac8a54d1b1c 890:abd28e2f66ca
  1250 contentsChanged
  1250 contentsChanged
  1251     "contents changed - move origin up if possible"
  1251     "contents changed - move origin up if possible"
  1252 
  1252 
  1253     |listSize newOrigin|
  1253     |listSize newOrigin|
  1254 
  1254 
  1255     shown ifFalse:[^ self].
  1255     shown ifTrue:[
  1256     list isNil ifTrue:[^ self].
  1256         list notNil ifTrue:[
  1257 
  1257 
  1258     listSize := self numberOfLines.
  1258             listSize := self numberOfLines.
  1259     "
  1259             "
  1260      if we are beyond the end, scroll up a bit
  1260              if we are beyond the end, scroll up a bit
  1261     "
  1261             "
  1262     ((firstLineShown + nFullLinesShown) > listSize) ifTrue:[
  1262             ((firstLineShown + nFullLinesShown) > listSize) ifTrue:[
  1263         newOrigin := listSize - nFullLinesShown + 1.
  1263                 newOrigin := listSize - nFullLinesShown + 1.
  1264         newOrigin < 1 ifTrue:[
  1264                 newOrigin < 1 ifTrue:[
  1265             newOrigin := 1
  1265                     newOrigin := 1
       
  1266                 ].
       
  1267                 self scrollToLine: newOrigin.
       
  1268             ].
  1266         ].
  1269         ].
  1267         self scrollToLine: newOrigin.
       
  1268     ].
  1270     ].
  1269 
  1271 
  1270     ^ super contentsChanged
  1272     ^ super contentsChanged
  1271 
  1273 
  1272     "Modified: 18.11.1996 / 19:50:07 / stefan"
  1274     "Modified: 18.11.1996 / 19:50:07 / stefan"
       
  1275     "Modified: 21.11.1996 / 17:43:55 / cg"
  1273 !
  1276 !
  1274 
  1277 
  1275 keyPress:key x:x y:y
  1278 keyPress:key x:x y:y
  1276     "a key was pressed - handle page-keys here"
  1279     "a key was pressed - handle page-keys here"
  1277 
  1280 
  3500 ! !
  3503 ! !
  3501 
  3504 
  3502 !ListView class methodsFor:'documentation'!
  3505 !ListView class methodsFor:'documentation'!
  3503 
  3506 
  3504 version
  3507 version
  3505     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.107 1996-11-18 19:58:25 stefan Exp $'
  3508     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.108 1996-11-21 16:44:41 cg Exp $'
  3506 ! !
  3509 ! !