[PD-cvs] pd/src desire.tk,1.1.2.600.2.181,1.1.2.600.2.182
chunlee
chunlee at users.sourceforge.net
Thu May 10 03:42:31 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15630
Modified Files:
Tag: desiredata
desire.tk
Log Message:
wire can now be connected with the mouse pointer approximately nearby
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.181
retrieving revision 1.1.2.600.2.182
diff -C2 -d -r1.1.2.600.2.181 -r1.1.2.600.2.182
*** desire.tk 9 May 2007 00:53:10 -0000 1.1.2.600.2.181
--- desire.tk 10 May 2007 01:42:27 -0000 1.1.2.600.2.182
***************
*** 1538,1541 ****
--- 1538,1542 ----
set @cmd_histi 0
set @motion_watch 0
+ set @iohilite {}
}
***************
*** 2659,2664 ****
set c [$self widget]
$self motion_checkhairtip $target $x $y
! eval $@dehighlight
! set @dehighlight {}
set oldpos $@curpos
set @curpos [list $x $y]
--- 2660,2665 ----
set c [$self widget]
$self motion_checkhairtip $target $x $y
! #eval $@dehighlight
! #set @dehighlight {}
set oldpos $@curpos
set @curpos [list $x $y]
***************
*** 2679,2683 ****
if {$@editmode} {$self motion_iohilite2 $x $y $f}
if {$id == ""} {return}
! $self motion_iohilite $target $x $y
}
--- 2680,2684 ----
if {$@editmode} {$self motion_iohilite2 $x $y $f}
if {$id == ""} {return}
! #$self motion_iohilite $target $x $y
}
***************
*** 2801,2805 ****
set c [$self widget]
set obj [$self identify_closestobj $x $y $f]
! if {$obj < 0} {return}
mset {cx cy} [rect_centre [$obj bbox]]
if {$y < $cy} {set io i} else {set io o}
--- 2802,2817 ----
set c [$self widget]
set obj [$self identify_closestobj $x $y $f]
! if {$obj < 0} {if {$@dehighlight != ""} {
! set @iohilite [list -1 0 0 0 0]
! eval $@dehighlight}
! return
! }
! mset {x1 y1 x2 y2} [$obj bbox]
! if {$x > $x1 && $x < $x2 && $y > $y1 && $y < $y2} {
! set @iohilite [list -1 0 0 0 0]
! if {$@dehighlight != ""} {eval $@dehighlight}
! set @dehighlight ""
! return
! }
mset {cx cy} [rect_centre [$obj bbox]]
if {$y < $cy} {set io i} else {set io o}
***************
*** 2812,2826 ****
set idx 0
for {set i 0} {$i < $ports} {incr i} {
! set point2 [rect_centre [$c bbox ${obj}$io${i}]]
set point1 [list $x $y]
set dist [distance $point1 $point2]
if {$dist < $mindist} {set mindist $dist; set idx $i; mset {iox ioy} $point2}
}
! $obj hilite_io $io $iox $ioy
! set @dehighlight [list $c delete ${obj}$io${idx}b]
#puts "obj:: $obj :: [$obj text] :: hilite $io :: $idx"
}
def Canvas motion_iohilite {target x y} {
set c [$self widget]
--- 2824,2847 ----
set idx 0
for {set i 0} {$i < $ports} {incr i} {
! set point2 [lmap / [rect_centre [$c bbox ${obj}$io${i}]] $@zoom]
set point1 [list $x $y]
set dist [distance $point1 $point2]
if {$dist < $mindist} {set mindist $dist; set idx $i; mset {iox ioy} $point2}
}
! $obj hilite_io $io [expr floor($iox)] [expr floor($ioy)]
! set hilite ${obj}$io${idx}b
! set @iohilite [list $obj [expr floor($iox)] [expr floor($ioy)] $io $idx]
! if {$hilite != [lindex $@dehighlight 2]} {
! eval $@dehighlight
! set @dehighlight [list $c delete $hilite]
! }
! #set @dehighlight [list $c delete ${obj}$io${idx}b]
! #puts "dehilite is :: $@dehighlight"
#puts "obj:: $obj :: [$obj text] :: hilite $io :: $idx"
}
+ def Canvas iohilite {} {return $@iohilite}
+
def Canvas motion_iohilite {target x y} {
set c [$self widget]
***************
*** 2918,2922 ****
set cx [expr $x*$@zoom]
set cy [expr $y*$@zoom]
! set offset 100
set stack [$c find overlapping [expr $cx-$offset] [expr $cy-$offset] [expr $cx+$offset] [expr $cy+$offset]]
set stack [lreverse $stack]
--- 2939,2943 ----
set cx [expr $x*$@zoom]
set cy [expr $y*$@zoom]
! set offset 50
set stack [$c find overlapping [expr $cx-$offset] [expr $cy-$offset] [expr $cx+$offset] [expr $cy+$offset]]
set stack [lreverse $stack]
***************
*** 2927,2931 ****
set class [$id class]
switch $class {
! Wire {} Crosshair {} Tooltip {} Comment {} SelRect {}
default {lappend objs $id}
}
--- 2948,2952 ----
set class [$id class]
switch $class {
! Wire {} Crosshair {} Tooltip {} Comment {} SelRect {} FutureWire {}
default {lappend objs $id}
}
***************
*** 3810,3813 ****
--- 3831,3839 ----
def FutureWire unclick {x y f target} {
mset [list type foo bar] $target
+ mset {obj iox ioy io idx} [$@canvas iohilite]
+ if {$obj != -1} {
+ switch $io {i {set type "inlet"} o {set type "outlet"}}
+ set target [list $type $obj $idx]
+ }
switch $type {
outlet {
***************
*** 3902,3911 ****
if {!$@editmode} {$self run_click $id $x $y $f $target; return}
set in_selection [expr [lsearch $@selection $id]>=0]
switch $type {
outlet {
! if {$@action == "none" && [$id canvas] == $self} {
! set @action [FutureWire new $self $x $y $f $target]
! }
! return
}
inlet {}
--- 3928,3948 ----
if {!$@editmode} {$self run_click $id $x $y $f $target; return}
set in_selection [expr [lsearch $@selection $id]>=0]
+ mset {obj iox ioy io idx} $@iohilite
+ if {$obj != -1 && $type != "wire"} {
+ switch $io {
+ i {set type "inlet"}
+ o {set type "outlet"}
+ }
+ if {$@action == "none" && [$obj canvas] == $self} {
+ set @action [FutureWire new $self $iox $ioy $f [list $type $obj $idx]]
+ }
+ return
+ }
switch $type {
outlet {
! #if {$@action == "none" && [$id canvas] == $self} {
! # set @action [FutureWire new $self $x $y $f $target]
! #}
! #return
}
inlet {}
More information about the Pd-cvs
mailing list