[PD-cvs] pd/src desire.tk,1.1.2.349,1.1.2.350
chunlee
chunlee at users.sourceforge.net
Wed Aug 16 17:56:50 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv949
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
trivial commits of the progress in canvas key_nav
bind arrows to the xy scrollbars of the canvas
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.349
retrieving revision 1.1.2.350
diff -C2 -d -r1.1.2.349 -r1.1.2.350
*** desire.tk 16 Aug 2006 12:22:38 -0000 1.1.2.349
--- desire.tk 16 Aug 2006 15:56:48 -0000 1.1.2.350
***************
*** 2437,2443 ****
}
wire {
! set wire_sel [lindex $@wires 0]
$wire_sel selected?= 1
! set @keynav_current $wire_sel
set @selection_wire $@keynav_current
}
--- 2437,2444 ----
}
wire {
! #set wire_sel [lindex $@wires 0]
! set wire_sel [lindex $_($@keynav_current:wires) $@jump]
$wire_sel selected?= 1
! set @keynav_current_wire $wire_sel
set @selection_wire $@keynav_current
}
***************
*** 2474,2521 ****
object {
set @keynav_next [$self quadrant $du $dv $@children]
}
wire {
! set @keynav_next [$self quadrant $du $dv $@wires]
! #set find [lsearch $@wires $@keynav_current]
! #set all [lreplace $@wires $find $find]
! #mset {x1 y1 x2 y2} [$@keynav_current bbox]
! #set obj1 $_($@keynav_current:obj1)
! #set inlets [$obj1 ninlets]
! #set outlets [$obj1 noutlets]
! #set outlet_wire {}
! #set inlet_wire {}
! #for {set i 0} {$i<$outlets} {incr i} {lappend outlet_wire $i}
! #for {set i 0} {$i<$inlets} {incr i} {lappend inlet_wire $i}
! #puts "outlet_wire::: $outlet_wire"
! #puts "inlet_wire::: $inlet_wire"
! #puts "wire $@keynav_current comes from $obj1"
!
! #puts "and it has wires::: $_($obj1:wires)"
! #foreach wire $_($obj1:wires) {
! # set wire_info [$wire report]
! # set find [lsearch $wire_info $obj1]
! # if {$find == 0} {
! # set new [linsert [lindex $outlet_wire [lindex $wire_info 1]] 0 $wire]
! # set outlet_wire [lreplace $outlet_wire [lindex $wire_info 1] [lindex $wire_info 1] $new]
! # } else {
! # set new [linsert [lindex $inlet_wire [lindex $wire_info 3]] 0 $wire]
! # set inlet_wire [lreplace $inlet_wire [lindex $wire_info 3] [lindex $wire_info 3] $new]
! # }
! #}
! #puts "outlet_wire::: $outlet_wire"
! #puts "inlet_wire::: $inlet_wire"
}
}
! if {!$shift} {
! #set find [lsearch $@selection $@keynav_current]
! #set @selection [lreplace $@selection $find $find]
! $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
}
--- 2475,2555 ----
object {
set @keynav_next [$self quadrant $du $dv $@children]
+ 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]
!
}
}
! #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
! }
!
! def Canvas find_neighbor_wire {du dv} {
! set find [lsearch $@wires $@keynav_current]
! set all [lreplace $@wires $find $find]
! mset {x1 y1 x2 y2} [$@keynav_current bbox]
! set obj1 $_($@keynav_current:obj1)
! set inlets [$obj1 ninlets]
! set outlets [$obj1 noutlets]
! set outlet_wires {}
! set inlet_wires {}
! #stores all wires connected to the object and their coords
! set wires_coords {}
! set outport $_($@keynav_current:port1)
! set inport $_($@keynav_current:port2)
! for {set i 0} {$i<$outlets} {incr i} {lappend outlet_wires $i}
! for {set i 0} {$i<$inlets} {incr i} {lappend inlet_wires $i}
! puts "wire $@keynav_current comes from $obj1 of outlet $outport"
!
! puts "and it has wires::: $_($obj1:wires)"
! foreach wire $_($obj1:wires) {lappend wires_coords $wire}
! for {set i 0} {$i < [llength $wires_coords]} {incr i} {
! lset wires_coords $i [list [lindex $wires_coords $i] [[lindex [lindex $wires_coords $i] 0] bbox]]
}
! puts "wires_coords::: $wires_coords"
!
! #foreach wire $_($obj1:wires) {
! # set wire_info [$wire report]
! # set find [lsearch $wire_info $obj1]
! # if {$find == 0} {
! # set new [linsert [lindex $outlet_wires [lindex $wire_info 1]] end $wire]
! # set outlet_wires [lreplace $outlet_wires [lindex $wire_info 1] [lindex $wire_info 1] $new]
! # } else {
! # set new [linsert [lindex $inlet_wires [lindex $wire_info 3]] end $wire]
! # set inlet_wires [lreplace $inlet_wires [lindex $wire_info 3] [lindex $wire_info 3] $new]
! # }
! #}
! #
! # if {[llength [lindex $outlet_wires $outport]] > 2} {puts " this outlet has other wires"}
! # puts "outlet_wires::: $outlet_wires"
! # puts "inlet_wires::: $inlet_wires"
}
***************
*** 2674,2681 ****
switch -regexp -- $key {
BackSpace|Delete|KP_Delete {$self delete_selection}
! Up {$self selection_move 0 -$motion}
! Down {$self selection_move 0 +$motion}
! Left {$self selection_move -$motion 0}
! Right {$self selection_move +$motion 0}
Tab {$self tab_jump}
Return {
--- 2708,2715 ----
switch -regexp -- $key {
BackSpace|Delete|KP_Delete {$self delete_selection}
! Up {if {[llength $@selection]} {$self selection_move 0 -$motion} else {$self scroll y -$motion}}
! Down {if {[llength $@selection]} {$self selection_move 0 +$motion} else {$self scroll y +$motion}}
! Left {if {[llength $@selection]} {$self selection_move -$motion 0} else {$self scroll x -$motion}}
! Right {if {[llength $@selection]} {$self selection_move +$motion 0} else {$self scroll x +$motion}}
Tab {$self tab_jump}
Return {
***************
*** 2842,2845 ****
--- 2876,2885 ----
}
+ def Wire xy2 {} {
+ set obj2 $@obj2
+ mset {x1 y1 x2 y2} [$obj2 xy]
+ list $x1 $y1
+ }
+
def Wire report {} {
list $@obj1 $@port1 $@obj2 $@port2
More information about the Pd-cvs
mailing list