TextView.st
changeset 53 b587b15eafab
parent 45 e900c30938c8
child 59 450ce95a72a4
equal deleted inserted replaced
52:e69fade0aa8e 53:b587b15eafab
    30 
    30 
    31 TextView comment:'
    31 TextView comment:'
    32 COPYRIGHT (c) 1989 by Claus Gittinger
    32 COPYRIGHT (c) 1989 by Claus Gittinger
    33              All Rights Reserved
    33              All Rights Reserved
    34 
    34 
    35 $Header: /cvs/stx/stx/libwidg/TextView.st,v 1.8 1994-08-11 23:48:09 claus Exp $
    35 $Header: /cvs/stx/stx/libwidg/TextView.st,v 1.9 1994-08-23 23:39:35 claus Exp $
    36 '!
    36 '!
    37 
    37 
    38 !TextView class methodsFor:'documentation'!
    38 !TextView class methodsFor:'documentation'!
    39 
    39 
    40 copyright
    40 copyright
    51 "
    51 "
    52 !
    52 !
    53 
    53 
    54 version
    54 version
    55 "
    55 "
    56 $Header: /cvs/stx/stx/libwidg/TextView.st,v 1.8 1994-08-11 23:48:09 claus Exp $
    56 $Header: /cvs/stx/stx/libwidg/TextView.st,v 1.9 1994-08-23 23:39:35 claus Exp $
    57 "
    57 "
    58 !
    58 !
    59 
    59 
    60 documentation
    60 documentation
    61 "
    61 "
  1254 
  1254 
  1255 buttonShiftPress:button x:x y:y
  1255 buttonShiftPress:button x:x y:y
  1256     "mouse-click with shift - adding to selection"
  1256     "mouse-click with shift - adding to selection"
  1257 
  1257 
  1258     "very simple - just simulate a move"
  1258     "very simple - just simulate a move"
  1259     ^ self buttonMotion:button x:x y:y
  1259     ^ self buttonMotion:(device button1MotionMask) x:x y:y
  1260 !
  1260 !
  1261 
  1261 
  1262 buttonMultiPress:button x:x y:y
  1262 buttonMultiPress:button x:x y:y
  1263     "multi-mouse-click - select word under pointer"
  1263     "multi-mouse-click - select word under pointer"
  1264 
  1264 
  1296     ] ifFalse:[
  1296     ] ifFalse:[
  1297         super buttonMultiPress:button x:x y:y
  1297         super buttonMultiPress:button x:x y:y
  1298     ]
  1298     ]
  1299 !
  1299 !
  1300 
  1300 
  1301 buttonMotion:button x:x y:y
  1301 buttonMotion:buttonMask x:x y:y
  1302     "mouse-move while button was pressed - handle selection changes"
  1302     "mouse-move while button was pressed - handle selection changes"
  1303 
  1303 
  1304     |movedVisibleLine movedLine movedCol 
  1304     |movedVisibleLine movedLine movedCol 
  1305      movedUp 
  1305      movedUp 
  1306      oldStartLine oldEndLine oldStartCol oldEndCol|
  1306      oldStartLine oldEndLine oldStartCol oldEndCol|
  1307 
  1307 
  1308     clickLine isNil ifTrue:[^ self].
  1308     clickLine isNil ifTrue:[^ self].
       
  1309 
       
  1310     "
       
  1311      check if its a button-1 motion
       
  1312     "
       
  1313     ((buttonMask bitAnd:(device button1MotionMask)) ~~ 0) ifFalse:[
       
  1314         ^ self
       
  1315     ].
  1309 
  1316 
  1310     "if moved outside of view, start autoscroll"
  1317     "if moved outside of view, start autoscroll"
  1311     (y < 0) ifTrue:[
  1318     (y < 0) ifTrue:[
  1312         self compressMotionEvents:false.
  1319         self compressMotionEvents:false.
  1313         self startScrollUp:y.
  1320         self startScrollUp:y.