TextView.st
changeset 1909 27778cfa4bda
parent 1893 bce50b364466
child 1922 87222b5b9e32
equal deleted inserted replaced
1908:3862a49ad525 1909:27778cfa4bda
   849     "mouse-click - prepare for selection change"
   849     "mouse-click - prepare for selection change"
   850 
   850 
   851     |sensor clickVisibleLine|
   851     |sensor clickVisibleLine|
   852 
   852 
   853     sensor := self sensor.
   853     sensor := self sensor.
   854     (sensor notNil and:[ sensor shiftDown]) ifTrue:[
   854     (sensor notNil and:[sensor shiftDown]) ifTrue:[
   855 	"mouse-click with shift - adding to selection"
   855         "mouse-click with shift - adding to selection"
   856 
   856 
   857 	"very simple - just simulate a move"
   857         "very simple - just simulate a move"
   858 	^ self buttonMotion:(device button1MotionMask) x:x y:y
   858         ^ self buttonMotion:(device button1MotionMask) x:x y:y
   859     ].
   859     ].
   860 
   860 
   861     ((button == 1) or:[button == #select]) ifTrue:[
   861     ((button == 1) or:[button == #select]) ifTrue:[
   862 	clickVisibleLine := self visibleLineOfY:y.
   862         clickVisibleLine := self visibleLineOfY:y.
   863 	clickPos := x @ y.
   863         clickPos := x @ y.
   864 	clickCol := self colOfX:x inVisibleLine:clickVisibleLine.
   864         clickCol := self colOfX:x inVisibleLine:clickVisibleLine.
   865 	clickLine := self visibleLineToAbsoluteLine:clickVisibleLine.
   865         clickLine := self visibleLineToAbsoluteLine:clickVisibleLine.
   866 	clickStartLine := clickLine.
   866         clickStartLine := clickLine.
   867 	clickStartCol := clickCol.
   867         clickStartCol := clickCol.
   868 	self unselect.
   868         self unselect.
   869 	clickCount := 1
   869         clickCount := 1
   870     ] ifFalse:[
   870     ] ifFalse:[
   871 	super buttonPress:button x:x y:y
   871         super buttonPress:button x:x y:y
   872     ]
   872     ]
   873 
   873 
   874     "Modified: 19.8.1997 / 17:01:15 / cg"
   874     "Modified: / 20.5.1999 / 17:02:45 / cg"
   875 !
   875 !
   876 
   876 
   877 buttonRelease:button x:x y:y
   877 buttonRelease:button x:x y:y
   878     "mouse- button release - turn off autoScroll if any"
   878     "mouse- button release - turn off autoScroll if any"
   879 
   879 
   880     ((button == 1) or:[button == #select]) ifTrue:[
   880     ((button == 1) or:[button == #select]) ifTrue:[
   881 	autoScrollBlock notNil ifTrue:[
   881         autoScrollBlock notNil ifTrue:[
   882 	    self stopScrollSelect
   882             self stopScrollSelect
   883 	].
   883         ].
       
   884         clickPos := nil.
   884     ] ifFalse:[
   885     ] ifFalse:[
   885 	super buttonRelease:button x:x y:y
   886         super buttonRelease:button x:x y:y
   886     ]
   887     ].
       
   888     "/ clickPos := clickLine := clickCol := nil.
       
   889 
       
   890     "Modified: / 20.5.1999 / 17:14:23 / cg"
   887 !
   891 !
   888 
   892 
   889 doubleClickX:x y:y
   893 doubleClickX:x y:y
   890     "double-click - select word under pointer"
   894     "double-click - select word under pointer"
   891 
   895 
  2953 ! !
  2957 ! !
  2954 
  2958 
  2955 !TextView class methodsFor:'documentation'!
  2959 !TextView class methodsFor:'documentation'!
  2956 
  2960 
  2957 version
  2961 version
  2958     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.135 1999-05-03 13:29:27 cg Exp $'
  2962     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.136 1999-05-20 15:24:18 cg Exp $'
  2959 ! !
  2963 ! !