SelectionInListModelView.st
changeset 2790 9c3b49bf7ace
parent 2701 d95a0a764f4d
child 2791 ebf038543951
--- a/SelectionInListModelView.st	Mon Feb 28 15:29:56 2005 +0100
+++ b/SelectionInListModelView.st	Mon Feb 28 15:48:44 2005 +0100
@@ -1204,7 +1204,7 @@
 buttonPress:button x:x y:y
     "a button was pressed - handle selection here
     "
-    |sensor item menu appl isSelected lineNr startLine|
+    |sensor item menu appl isSelected lineNr startLine clickPoint|
 
     buttonMotionAction := buttonReleaseAction := nil.
 
@@ -1269,7 +1269,7 @@
 
     (isSelected and:[sensor shiftDown not and:[self canDrag]]) ifTrue:[
         buttonMotionAction := [:p|
-            ((x@y) dist:p) > 5.0 ifTrue:[
+            ((x@y) dist:p) > (DSVColumnView dragMotionDistance) ifTrue:[
                 buttonMotionAction := buttonReleaseAction := nil.
                 self startDragAt:p.
             ]
@@ -1309,13 +1309,22 @@
         self buttonPressOrReleaseAtLine:lineNr x:x y:y.
     ].
 
+    clickPoint := x@y.
+
     multipleSelectOk ifTrue:[
         buttonMotionAction := [:p| |ln|
             (p y between:0 and:height) ifTrue:[
                 ln := self yVisibleToLineNr:p y.
                 ln isNil ifTrue:[ln := self size].
-                self selectFrom:startLine to:ln.
+                (ln ~~ self lastInSelection and:[ln ~~ self firstInSelection]) ifTrue:[
+                    self selectFrom:startLine to:ln.
+                    clickPoint := p.
+                ]
             ].
+            (clickPoint x dist:p x) > (DSVColumnView dragMotionDistance) ifTrue:[
+                buttonMotionAction := buttonReleaseAction := nil.
+                self startDragAt:p.
+            ]
         ].
     ].
 !
@@ -2343,5 +2352,5 @@
 !SelectionInListModelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInListModelView.st,v 1.99 2004-04-14 10:37:09 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInListModelView.st,v 1.100 2005-02-28 14:48:44 cg Exp $'
 ! !