Re: tkined-1.3.2 & Button-2

Erik Schoenfelder (schoenfr@ibr.cs.tu-bs.de)
Mon, 3 Jul 1995 16:31:35 +0200

Hi!

On Mon, 03 Jul 1995 15:06:14 +0200, Joergen Haegg <jh@axis.se> said:

Joergen> In Select-mode I could use Button-2 to move all
Joergen> currently selected objects together in earlier
Joergen> versions. But now Button-2 first sele= ct the object
Joergen> that the pointer happens to be at before the move,
Joergen> resulting in movement of one object only.

Juergen Schoenwaelder is currently in Toronto, so please allow me to
answer.

Yes, this is broken, if the move is selected at a object, which is
overlapping other objects. (If the selected object is in `back' of the
unselected ones, it should work).

anyway, the appended diff should fix this (and will be in the next
release i guess).

Have fun.

Erik

--
--- /usr/local/tmp/tkined-1.3.2/Tool.tcl	Mon Jun 19 19:08:36 1995
+++ tkined-1.3.2a/Tool.tcl	Mon Jun 26 17:24:21 1995
@@ -358,15 +358,27 @@
     set y1 [expr {$y-5}]
     set x2 [expr {$x+5}]
     set y2 [expr {$y+5}]
+    set unselected ""
     set tkined_valid 0
     foreach item [$c find overlapping $x1 $y1 $x2 $y2] {
 	set id [Tool::GetId $c $item]
 	if {$id == ""} continue
 	if {[catch {$id selected} sel]} continue
-	if {! $sel} {
-	    $editor selection clear
-	    $id select
+#	if {! $sel} {
+#	    $editor selection clear
+#	    $id select
+#	}
+#	set tkined_valid 1
+        if {$sel} {
+	    set tkined_valid 1
+	    break
+	} else {
+	    set unselected $id
 	}
+    }
+    if {! $tkined_valid && $unselected != ""} {
+	$editor selection clear
+	if {[catch {$unselected select}]} return
 	set tkined_valid 1
     }
     if {!$tkined_valid} return