Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8643
Modified Files: Tag: devel_0_39 desire.tk Log Message: multiple connections auto
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.531 retrieving revision 1.1.2.532 diff -C2 -d -r1.1.2.531 -r1.1.2.532 *** desire.tk 26 Oct 2006 02:42:42 -0000 1.1.2.531 --- desire.tk 27 Oct 2006 16:28:15 -0000 1.1.2.532 *************** *** 1131,1135 **** set canvas [$canvas canvas] } ! return $canvas }
--- 1131,1136 ---- set canvas [$canvas canvas] } ! if {$canvas != ""} {return $canvas} else {return none} ! #return $canvas }
*************** *** 1396,1402 **** set @jump 0 set @keynav_iocount 0 ;# the io select count ! set @keynav_port 0 ;# which in/outlet is select set @keynav 0 ;# the list of objects that has io selected ! set @keynav_iosel {} set @keynav_current 0 set @keynav_last 0 --- 1397,1405 ---- set @jump 0 set @keynav_iocount 0 ;# the io select count ! set @keynav_port 0 ;# which in/outlet is selected set @keynav 0 ;# the list of objects that has io selected ! set @keynav_iosel 0 ;# last object that is io selected ! set @keynav_iosel_o {} ;# list of objects that has outlet selected ! set @keynav_iosel_i {} ;# list of objects that has inlet selected set @keynav_current 0 set @keynav_last 0 *************** *** 3294,3343 ****
def Canvas key_nav_ioselect {} { ! if {[llength $@selection] == 1} { ! set var [lindex $@keynav_iosel end end] ! if {[lsearch $@keynav_iosel $@selection] < 0} { ! lappend @keynav_iosel $@selection ! set @keynav_iocount 0 ! } ! puts " iosel::: $@keynav_iosel" ! if {$@keynav_port != 0 && $@keynav_current == $var} { ! set hilitebox $@keynav_port ! [$self widget] delete ${hilitebox}b } ! puts " keynav_port::: $@keynav_port" set obj $@selection ! #"$self$which $self$which$i $self" ! set ins [$obj ninlets] ! set outs [$obj noutlets] ! set ports {} ! set ports2 {} ! set ports3 {} ! for {set i 0} {$i < $ins} {incr i} { ! lappend ports ${obj}i${i} ! lappend ports2 "i" ! lappend ports3 $i ! } ! for {set i 0} {$i < $outs} {incr i} { ! lappend ports ${obj}o${i} ! lappend ports2 "o" ! lappend ports3 $i } ! #incr @keynav_iocount ! if {$@keynav_iocount >= [llength $ports]} {set @keynav_iocount 0} ! mset {x y x1 y1} [[$self widget] bbox [lindex $ports $@keynav_iocount]] ! set @keynav_port [lindex $ports $@keynav_iocount] ! #set _($@selection:ioselect) [lindex $ports $@keynav_iocount] ! set _($@selection:ioselect) [list [lindex $ports3 $@keynav_iocount] [lindex $ports2 $@keynav_iocount]] ! $obj hilite_io [lindex $ports2 $@keynav_iocount] [expr $x/$@zoom] [expr $y/$@zoom] ! ! incr @keynav_iocount ! #mset {x y x1 y1} [[$self widget] bbox ${obj}i0] ! #set port [$obj hilite_io i $x $y] } }
def Canvas dehilite_io {} { ! if {![llength $@keynav_iosel]} {return} ! foreach io $@keynav_iosel { set box $_($io:ioselect) set type [lindex $_($io:ioselect) 1] --- 3297,3377 ----
def Canvas key_nav_ioselect {} { ! set var [lindex $@selection end end] ! if {$@keynav_iosel != $var} {set @keynav_iocount 0} ! ! if {$@keynav_port != 0 && $@keynav_iosel == $var} { ! #set hilitebox $@keynav_port ! ! foreach io $@keynav_port2 { ! [$self widget] delete ${io}b } ! } ! ! if {[llength $@selection] == 1} { set obj $@selection ! } else { ! set obj [lindex $@selection 0] ! } ! set ins [$obj ninlets] ! set outs [$obj noutlets] ! set ports {} ! set ports2 {} ! set ports3 {} ! for {set i 0} {$i < $ins} {incr i} { ! lappend ports ${obj}i${i} ! lappend ports2 "i" ! lappend ports3 $i ! } ! for {set i 0} {$i < $outs} {incr i} { ! lappend ports ${obj}o${i} ! lappend ports2 "o" ! lappend ports3 $i ! } ! #incr @keynav_iocount ! if {$@keynav_iocount >= [llength $ports]} {set @keynav_iocount 0} ! set port [lindex $ports3 $@keynav_iocount] ! set type [lindex $ports2 $@keynav_iocount] ! set @keynav_port ${obj}${type}${port} ! set @keynav_port2 {} ! # @keynav_port stores the current hilited in/outlets ! # @keynav_ports stores the current hilited in/outlets if there are multiple objects ! # @keynav_iosel_i stores the selected inlets ! # @keynav_iosel_o stores the selected outlets ! foreach object $@selection { ! if {$@keynav_iosel != $var} {set @keynav_iosel $object} ! if {$@keynav_iosel == $var} { ! switch $type { ! i { ! if {[lsearch $@keynav_iosel_i $object] == -1} { ! lappend @keynav_iosel_i $object ! set find [lsearch $@keynav_iosel_o $object] ! if {$find >= 0} { ! set @keynav_iosel_o [lreplace $@keynav_iosel_o $find $find] ! } ! } ! } ! o { ! if {[lsearch $@keynav_iosel_o $object] == -1} { ! lappend @keynav_iosel_o $object ! set find [lsearch $@keynav_iosel_i $object] ! if {$find >= 0} { ! set @keynav_iosel_i [lreplace $@keynav_iosel_i $find $find] ! } ! } ! } ! } } ! mset {x y x1 y1} [[$self widget] bbox ${object}${type}${port}] ! lappend @keynav_port2 ${object}${type}${port} ! set _($object:ioselect) [list [lindex $ports3 $@keynav_iocount] [lindex $ports2 $@keynav_iocount]] ! #set _($object:ioselect) [lindex $ports3 $@keynav_iocount] ! $object hilite_io [lindex $ports2 $@keynav_iocount] [expr $x/$@zoom] [expr $y/$@zoom] } + incr @keynav_iocount }
def Canvas dehilite_io {} { ! #if {![llength $@keynav_iosel_i] || ![llength $@keynav_iosel_o]} {return} ! foreach io $@keynav_iosel_i { set box $_($io:ioselect) set type [lindex $_($io:ioselect) 1] *************** *** 3347,3351 **** set _($io:ioselect) {} } ! set @keynav_iosel {} set @keynav_port 0 set @keynav_iocount 0 --- 3381,3393 ---- set _($io:ioselect) {} } ! foreach io $@keynav_iosel_o { ! set box $_($io:ioselect) ! set type [lindex $_($io:ioselect) 1] ! set port [lindex $_($io:ioselect) 0] ! set tag ${io}${type}${port} ! [$self widget] delete ${tag}b ! set _($io:ioselect) {} ! } ! set @keynav_iosel_i {}; set @keynav_iosel_o {} set @keynav_port 0 set @keynav_iocount 0 *************** *** 3481,3497 **** Tab {$self tab_jump} Return { ! if {[llength $@selection] == 1} { ! if {[llength $@keynav_iosel] < 2} { ! if {$_($@selection:_class) == "ObjectBox"} {$@selection edit; $self dehilite_io} ! } else { ! set from_obj [lindex $@keynav_iosel 0] ! set to_obj [lindex $@keynav_iosel 1] ! set from [lsearch $@children [lindex $@keynav_iosel 0]] ! set inlet [lindex $_($from_obj:ioselect) 0] ! set to [lsearch $@children [lindex $@keynav_iosel 1]] ! set outlet [lindex $_($to_obj:ioselect) 0] ! pd .$self connect [list $from $inlet $to $outlet] ! $self dehilite_io ! } } } --- 3523,3543 ---- Tab {$self tab_jump} Return { ! if {![llength $@keynav_iosel_i] && ![llength $@keynav_iosel_o]} { ! if {$_($@selection:_class) == "ObjectBox"} {$@selection edit; $self dehilite_io} ! } else { ! puts " iosel_i ---> $@keynav_iosel_i" ! puts " iosel_o ---> $@keynav_iosel_o" ! foreach out_obj $@keynav_iosel_o { ! set out_idx [$self children_idx $out_obj] ! set out_port [lindex $_($out_obj:ioselect) 0] ! puts " ----> $out_obj :: $out_idx :: $out_port" ! foreach in_obj $@keynav_iosel_i { ! set in_idx [$self children_idx $in_obj] ! set in_port [lindex $_($in_obj:ioselect) 0] ! puts " ----> $in_obj :: $in_idx :: $in_port" ! pd .$self connect [list $out_idx $out_port $in_idx $in_port] ! } ! } ! $self dehilite_io } }