Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28033
Modified Files: Tag: devel_0_39 desire.tk Log Message: cleanup
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.575 retrieving revision 1.1.2.576 diff -C2 -d -r1.1.2.575 -r1.1.2.576 *** desire.tk 20 Nov 2006 04:50:10 -0000 1.1.2.575 --- desire.tk 20 Nov 2006 05:17:54 -0000 1.1.2.576 *************** *** 544,548 ****
set zoom(canned) [list 25 33 50 75 100 125 150 200 250 300 400] ! set scale(amount) 0.1 #-----------------------------------------------------------------------------------#
--- 544,548 ----
set zoom(canned) [list 25 33 50 75 100 125 150 200 250 300 400] ! set scale_amount 1.1 #-----------------------------------------------------------------------------------#
*************** *** 833,838 **** }
! def Client pdrc_editor {} {ServerPrefsDialog new_as pdrc} ! def Client ddrc_editor {} {ClientPrefsDialog new_as ddrc}
proc menu_pop_pd {} {raise .} --- 833,838 ---- }
! def Client server_prefs {} {ServerPrefsDialog new_as pdrc} ! def Client client_prefs {} {ClientPrefsDialog new_as ddrc}
proc menu_pop_pd {} {raise .} *************** *** 857,861 **** $self populate_menu file { new_file open_file {} ! pdrc_editor ddrc_editor send_message paths {} audio_on audio_off {} quit} --- 857,861 ---- $self populate_menu file { new_file open_file {} ! server_prefs client_prefs send_message paths {} audio_on audio_off {} quit} *************** *** 3008,3012 **** set from_idx [$@canvas children_idx $@from] set to_idx [$@canvas children_idx $@to] ! if {$from_idx >= 0 && $@from != $@to} { $@canvas connect [list $from_idx $@outlet $to_idx $@inlet] } --- 3008,3012 ---- set from_idx [$@canvas children_idx $@from] set to_idx [$@canvas children_idx $@to] ! if {$from_idx >= 0 && $to_idx >= 0 && $@from != $@to} { $@canvas connect [list $from_idx $@outlet $to_idx $@inlet] } *************** *** 3149,3167 **** set wire [lindex $@wires_pair [expr [lsearch $@wires_pair $id]-1]] $self disconnect $wire ! set obj1 [lindex $@children [lindex $wire 0]] ! set outlet [lindex $wire 1] ! set obj2 [lindex $@children [lindex $wire 2]] ! set inlet [lindex $wire 3] ! mset {x1 y1 x2 y2} [lmap / [$c bbox ${obj1}o${outlet}] [$self zoom]] ! mset {x3 y3 x4 y4} [lmap / [$c bbox ${obj2}i${inlet}] [$self zoom]] ! puts " x3 $x3 y3 $y3 x4 $x4 y4 $y4" set d_outlet [distance [list $x $y] [list [expr ($x1+$x2)/2] [expr ($y1+$y2)/2]]] ! set d_inlet [distance [list $x $y] [list [expr ($x3+$x4)/2] [expr ($y3+$y4)/2]]] if {$d_outlet > $d_inlet} { set x5 $x1; set y5 $y1 ! set target [list outlet $obj1 $outlet] } else { set x5 [expr ($x3+$x4)/2]; set y5 [expr ($y3+$y4)/2] ! set target [list inlet $obj2 $inlet] } set @action [FutureWire new $self $x1 $y1 $f $target] --- 3149,3164 ---- set wire [lindex $@wires_pair [expr [lsearch $@wires_pair $id]-1]] $self disconnect $wire ! set from [lindex $@children [lindex $wire 0]]; set outlet [lindex $wire 1] ! set to [lindex $@children [lindex $wire 2]]; set inlet [lindex $wire 3] ! mset {x1 y1 x2 y2} [lmap / [$c bbox ${from}o${outlet}] [$self zoom]] ! mset {x3 y3 x4 y4} [lmap / [$c bbox ${to}i${inlet}] [$self zoom]] set d_outlet [distance [list $x $y] [list [expr ($x1+$x2)/2] [expr ($y1+$y2)/2]]] ! set d_inlet [distance [list $x $y] [list [expr ($x3+$x4)/2] [expr ($y3+$y4)/2]]] if {$d_outlet > $d_inlet} { set x5 $x1; set y5 $y1 ! set target [list outlet $from $outlet] } else { set x5 [expr ($x3+$x4)/2]; set y5 [expr ($y3+$y4)/2] ! set target [list inlet $to $inlet] } set @action [FutureWire new $self $x1 $y1 $f $target] *************** *** 3187,3194 ****
def Canvas right_click {id x y} { - #if {!$@editmode} {return} set c [$self widget] set @insert_x $x; set @insert_y $y - puts " id:::: $id" if {[$id class] != "Canvas"} { if {![winfo exists [[$id canvas] widget]]} {set id [$id canvas]} --- 3184,3189 ---- *************** *** 3292,3296 **** set @keynav_current [lindex [$@keynav_current wires] 0] set @keynav_last_wire $@keynav_current - } else { # check if the canvas has wires, if yes, use it --- 3287,3290 ---- *************** *** 3304,3312 **** } } - } else { - } $self selection_wire= $@keynav_current - }
--- 3298,3303 ---- *************** *** 3316,3320 **** if {!$olength} { # if keynav_current is 0, aka the start of key navigation - if {$@keynav_current == 0} { if {[llength $@children]} { --- 3307,3310 ---- *************** *** 3349,3353 **** } $self selection= $@keynav_current - }
--- 3339,3342 ---- *************** *** 3360,3364 **** def Canvas key_nav_down_shift {} {$self key_nav -1 +1 1} def Canvas key_nav_right_shift {} {$self key_nav -1 -1 1} ! def Canvas key_nav_left_shift {} {$self key_nav +1 +1 1}
# intervals --- 3349,3353 ---- def Canvas key_nav_down_shift {} {$self key_nav -1 +1 1} def Canvas key_nav_right_shift {} {$self key_nav -1 -1 1} ! def Canvas key_nav_left_shift {} {$self key_nav +1 +1 1}
# intervals *************** *** 3367,3377 ****
def Canvas key_nav {du dv shift} { ! #puts " keynav_tab_sel::: $@keynav_tab_sel" ! #puts " selection_wire::: $@selection_wire" ! #puts " selection::: $@selection" ! if {$@keynav_shift && !$shift} { ! puts " SOMETHING HAPPENED..............." ! #$self deselect_all ! } set @keynav_shift $shift if {[llength $@selection] > 1} { --- 3356,3360 ----
def Canvas key_nav {du dv shift} { ! if {$@keynav_shift && !$shift} {puts "keynav_shift but not shift"} set @keynav_shift $shift if {[llength $@selection] > 1} { *************** *** 3382,3416 **** if {!$@keynav} {$self tab_jump} switch $@keynav_tab_sel { ! object { ! set @keynav_next [$self quadrant $du $dv $@children] if {!$shift} { ! $self selection-= $@keynav_current ! $@keynav_current selected?= 0 ! set @keynav_last_obj $@keynav_next } if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! } ! wire { #$@keynav_current selected?= 0 - set @keynav_next [$self quadrant $du $dv $@wires] if {!$shift} { ! $self selection_wire-= $@keynav_current ! $@keynav_current selected?= 0 ! set @keynav_last_wire $@keynav_next } if {[lsearch $@selection_wire $@keynav_next] < 0} {lappend @selection_wire $@keynav_next} ! } } - - #if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} $@keynav_next selected?= 1 set @keynav_current $@keynav_next - #puts "--------------------------------------------" - #puts " keynav_tab_sel::: $@keynav_tab_sel" - #puts " selection_wire::: $@selection_wire" - #puts " selection::: $@selection" }
--- 3365,3391 ---- if {!$@keynav} {$self tab_jump} switch $@keynav_tab_sel { ! object { set @keynav_next [$self quadrant $du $dv $@children] if {!$shift} { ! $self selection-= $@keynav_current ! $@keynav_current selected?= 0 ! set @keynav_last_obj $@keynav_next } if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} ! } ! wire { #$@keynav_current selected?= 0 set @keynav_next [$self quadrant $du $dv $@wires] if {!$shift} { ! $self selection_wire-= $@keynav_current ! $@keynav_current selected?= 0 ! set @keynav_last_wire $@keynav_next } if {[lsearch $@selection_wire $@keynav_next] < 0} {lappend @selection_wire $@keynav_next} ! } } #if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} $@keynav_next selected?= 1 set @keynav_current $@keynav_next }
*************** *** 3475,3487 **** 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 --- 3450,3457 ---- 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 *************** *** 3553,3570 **** $self dehilite_io } - }
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] ! set port [lindex $_($io:ioselect) 0] ! set tag ${io}${type}${port} ! [$self widget] delete ${tag}b ! set _($io:ioselect) {} ! } ! foreach io $@keynav_iosel_o { set box $_($io:ioselect) set type [lindex $_($io:ioselect) 1] --- 3523,3530 ---- $self dehilite_io } }
def Canvas dehilite_io {} { ! foreach io [concat $@keynav_iosel_i $@keynav_iosel_o] { set box $_($io:ioselect) set type [lindex $_($io:ioselect) 1] *************** *** 3574,3587 **** set _($io:ioselect) {} } ! set @keynav_iosel_i {}; set @keynav_iosel_o {} set @keynav_port 0 set @keynav_iocount 0 }
! def Canvas incr_scale {} {$self scale "out"} ! def Canvas decr_scale {} {$self scale "in"}
def Canvas scale {mode} { ! global scale if {[llength $@selection]} { foreach children $@selection { --- 3534,3549 ---- set _($io:ioselect) {} } ! set @keynav_iosel_i {} ! set @keynav_iosel_o {} set @keynav_port 0 set @keynav_iocount 0 }
! def Canvas incr_scale {} {$self scale out} ! def Canvas decr_scale {} {$self scale in}
def Canvas scale {mode} { ! set s $::scale_amount ! switch $mode { in { set s [expr 1/$s] }} if {[llength $@selection]} { foreach children $@selection { *************** *** 3589,3606 **** switch $mode { out { ! set x1 [expr $x*(1+$scale(amount))] ! set y1 [expr $y*(1+$scale(amount))] ! $children position= [list $x1 $y1] ! $children changed ! pd .$self object_moveto !$children $x1 $y1 } in { ! set x1 [expr $x*(1-$scale(amount))] ! set y1 [expr $y*(1-$scale(amount))] ! $children position= [list $x1 $y1] ! $children changed ! pd .$self object_moveto !$children $x1 $y1 } } }
--- 3551,3565 ---- switch $mode { out { ! set x1 [expr $x*$s] ! set y1 [expr $y*$s] } in { ! set x1 [expr $x*$s] ! set y1 [expr $y*$s] } } + $children position= [list $x1 $y1] + $children changed + pd .$self object_moveto !$children $x1 $y1 }
*************** *** 3612,3629 **** switch $mode { out { ! set x1 [expr $x*(1+$scale(amount))] ! set y1 [expr $y*(1+$scale(amount))] ! $children position= [list $x1 $y1] ! $children changed ! pd .$self object_moveto !$children $x1 $y1 } in { ! set x1 [expr $x*(1-$scale(amount))] ! set y1 [expr $y*(1-$scale(amount))] ! $children position= [list $x1 $y1] ! $children changed ! pd .$self object_moveto !$children $x1 $y1 } } } foreach children $@children { $self changed_wires} --- 3571,3585 ---- switch $mode { out { ! set x1 [expr $x*$s] ! set y1 [expr $y*$s] } in { ! set x1 [expr $x*$s] ! set y1 [expr $y*$s] } } + $children position= [list $x1 $y1] + $children changed + pd .$self object_moveto !$children $x1 $y1 } foreach children $@children { $self changed_wires} *************** *** 5680,5684 ****
def ButtonBar init {canvas} { ! global buttons_loaded butt scale set @canvas $canvas set bb .$@canvas.bbar --- 5636,5640 ----
def ButtonBar init {canvas} { ! global buttons_loaded butt set @canvas $canvas set bb .$@canvas.bbar *************** *** 6853,6857 **** key Canvas {new_file open_file} key Canvas {save save_as} ! key Client {pdrc_editor ddrc_editor} key Canvas {close quit} key Canvas {find find_again} --- 6809,6813 ---- key Canvas {new_file open_file} key Canvas {save save_as} ! key Client {server_prefs client_prefs} key Canvas {close quit} key Canvas {find find_again}