Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26245
Modified Files: Tag: devel_0_39 desire.tk Log Message: new hacks to get wires to work with canvas quadrant, seems to work quite ok. its not finished yet...
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.354 retrieving revision 1.1.2.355 diff -C2 -d -r1.1.2.354 -r1.1.2.355 *** desire.tk 16 Aug 2006 20:06:31 -0000 1.1.2.354 --- desire.tk 16 Aug 2006 22:54:57 -0000 1.1.2.355 *************** *** 2440,2465 **** set @keynav_active_obj $@keynav_next ! if {!$shift} { ! $self selection-= $@keynav_current ! $@keynav_current selected?= 0 ! } ! if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! $@keynav_next selected?= 1 ! set @keynav_current $@keynav_next } wire { $@keynav_current_wire selected?= 0 ! #set @keynav_next [$self quadrant $du $dv $@wires] #$self find_neighbor_wire $du $dv #set obj1 $_($@keynav_current:obj1) ! if {$@jump >= [llength $_($@keynav_current:wires)]} {set @jump 0} ! puts " jump::$@jump" ! set @keynav_current_wire [lindex $_($@keynav_current:wires) $@jump] ! incr @jump ! $@keynav_current_wire selected?= 1 ! puts "$@keynav_current" ! puts "$_($@keynav_current:wires)" #set @keynav_next [$self quadrant $du $dv $wires] --- 2440,2465 ---- set @keynav_active_obj $@keynav_next ! #if {!$shift} { ! #$self selection-= $@keynav_current ! #$@keynav_current selected?= 0 ! #} ! #if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! #$@keynav_next selected?= 1 ! #set @keynav_current $@keynav_next } wire { $@keynav_current_wire selected?= 0 ! set @keynav_next [$self quadrant $du $dv $@wires] #$self find_neighbor_wire $du $dv #set obj1 $_($@keynav_current:obj1) ! #if {$@jump >= [llength $_($@keynav_current:wires)]} {set @jump 0} ! #puts " jump::$@jump" ! #set @keynav_current_wire [lindex $_($@keynav_current:wires) $@jump] ! #incr @jump ! #$@keynav_current_wire selected?= 1 ! #puts "$@keynav_current" ! #puts "$_($@keynav_current:wires)" #set @keynav_next [$self quadrant $du $dv $wires] *************** *** 2467,2477 **** }
! #if {!$shift} { ! # $self selection-= $@keynav_current ! # $@keynav_current selected?= 0 ! #} ! #if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! #$@keynav_next selected?= 1 ! #set @keynav_current $@keynav_next }
--- 2467,2477 ---- }
! if {!$shift} { ! $self selection-= $@keynav_current ! $@keynav_current selected?= 0 ! } ! if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! $@keynav_next selected?= 1 ! set @keynav_current $@keynav_next }
*************** *** 2829,2837 **** set port2 $@port2 mset {x1 y1 x2 y2} [.$@canvas.c bbox ${obj1}o${port1}] ! mset {x3 y3 x4 y4} [.$@canvas.c bbox ${obj2}o${port2}] ! list [expr ($x2+$x1)/2] [expr ($y2+$y1)/2] [expr ($x4+$x3)/2] [expr ($y4+$y3)/2] }
! def Wire xy {} { set obj1 $@obj1 mset {x1 y1 x2 y2} [$obj1 xy] --- 2829,2838 ---- set port2 $@port2 mset {x1 y1 x2 y2} [.$@canvas.c bbox ${obj1}o${port1}] ! mset {x3 y3 x4 y4} [.$@canvas.c bbox ${obj2}i${port2}] ! #list [expr ($x2+$x1)/2] [expr ($y2+$y1)/2] [expr ($x4+$x3)/2] [expr ($y4+$y3)/2] ! list [expr (($x1+$x2)/2)/$_($@canvas:scale)] [expr (($y1+$y2)/2)/$_($@canvas:scale)] [expr (($x3+$x4)/2)/$_($@canvas:scale)] [expr (($y3+$y4)/2)/$_($@canvas:scale)] }
! def Wire xy_poo {} { set obj1 $@obj1 mset {x1 y1 x2 y2} [$obj1 xy] *************** *** 2845,2848 **** --- 2846,2854 ---- }
+ def Wire xy {} { + mset {x1 y1 x2 y2} [$self bbox] + list [expr $x1 + (($x2-$x1)*0.05)] [expr $y1 + (($y2-$y1)*0.05)] + } + def Wire report {} { list $@obj1 $@port1 $@obj2 $@port2 *************** *** 2868,2871 **** --- 2874,2882 ---- $self item WIRE line $xys -width [look wirethick] -smooth yes \ -arrow $arrow -arrowshape $arrowshape -fill $wire_color + #mset {dx dy dx2 dy2} [$self bbox] + mset {dx dy} [$self xy] + set off 1 + set rect [list [expr $dx+$off] [expr $dy+$off] [expr $dx-$off] [expr $dy-$off]] + $self item POO oval $rect -fill yellow -outline yellow }