Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20878
Modified Files: Tag: devel_0_39 desire.tk Log Message: some wire hilite fixes...
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.147 retrieving revision 1.1.2.148 diff -C2 -d -r1.1.2.147 -r1.1.2.148 *** desire.tk 8 Apr 2006 14:06:51 -0000 1.1.2.147 --- desire.tk 8 Apr 2006 16:00:55 -0000 1.1.2.148 *************** *** 1443,1447 **** set born [lwithout $wires $@wires];foreach x $born {$x subscribe $self;$x changed;$x canvas= $self} ! puts "===== born:$born" --- 1443,1447 ---- set born [lwithout $wires $@wires];foreach x $born {$x subscribe $self;$x changed;$x canvas= $self} ! puts "===== born:$born children:$@children" *************** *** 1482,1486 **** }
! def view move {dx dy} { mset {x y} [$self xy] set @x1 [expr $@x1+$dx] --- 1482,1486 ---- }
! def* view move {dx dy} { mset {x y} [$self xy] set @x1 [expr $@x1+$dx] *************** *** 1666,1680 **** }
! def canvas select_all {} { foreach o $@children {$o selected?= 0} set @selection $@children }
! def canvas deselect_all {} { #puts "selection:$@selection" foreach o $@selection {$o selected?= 0} set @selection {} ! if {$@selection_wire != ""} {$@selection_wire select 0} ! #set @select_by "" }
--- 1666,1682 ---- }
! def* canvas select_all {} { foreach o $@children {$o selected?= 0} set @selection $@children }
! def* canvas deselect_all {} { #puts "selection:$@selection" foreach o $@selection {$o selected?= 0} set @selection {} ! if {$@selection_wire != ""} { ! foreach wire $@selection_wire {$wire select 0} ! } ! set @select_by "" }
*************** *** 1764,1777 **** set element_tags {} set ids {} foreach tag $selected_elements { if {[regexp {^x([a-f0-9]{6,8})} [$c gettags $tag] id]} {lappend ids $id} } set selected_objs [lsort -unique $ids] foreach obj $selected_objs { set i [lsearch $@selection $obj] if {$i<0} {lappend @selection $obj} } ! puts "selected_objs:$selected_objs selection:$@selection" foreach obj $@selection {$c itemconfigure ${obj}BASE -outline $look(objectframe4)} } set @select_by "selrect" --- 1766,1794 ---- set element_tags {} set ids {} + set wids {} foreach tag $selected_elements { + # to get objects if {[regexp {^x([a-f0-9]{6,8})} [$c gettags $tag] id]} {lappend ids $id} + # to get wires + if {[regexp {^([0-9a-f]{6,8})} [$c gettags $tag] id]} {lappend wids $id} } set selected_objs [lsort -unique $ids] + set selected_wires [lsort -unique $wids] + foreach obj $selected_objs { set i [lsearch $@selection $obj] if {$i<0} {lappend @selection $obj} } ! ! foreach wire $selected_wires { ! set i [lsearch $@selection_wire $wire] ! if {$i<0} {lappend @selection_wire $wire} ! } ! ! puts "selected_objs:$selected_objs selection:$@selection selection_wire:$@selection_wire" ! # hilite objects foreach obj $@selection {$c itemconfigure ${obj}BASE -outline $look(objectframe4)} + # hilite wire + foreach wire $@selection_wire {$wire select 1} } set @select_by "selrect" *************** *** 1953,1960 ****
def* box move {dx dy} { super $dx $dy ! $self draw_wires }
def* box clickedit {x y butt key in_selection selection} { #handles the shift click --- 1970,1984 ----
def* box move {dx dy} { + global _ super $dx $dy ! #$self draw_wires ! foreach wire $@wires { ! # the select_by is ugly, remove later... $_($@canvas:select_by) ! set _($wire:select_by) $_($@canvas:select_by) ! $wire draw ! } }
+ def* box clickedit {x y butt key in_selection selection} { #handles the shift click *************** *** 2011,2017 **** lappend _($@obj1:wires) $self lappend _($@obj2:wires) $self ! #puts "......from:$@obj1 outlet:$@port1 to:$@obj2 inlet:$@port2" ! # no time to carry on for now...... ! }
--- 2035,2040 ---- lappend _($@obj1:wires) $self lappend _($@obj2:wires) $self ! # select_by is a hack to get wires remain hilited if selected by serect.... ! set @select_by "" }
*************** *** 2032,2037 **** if {$arrowsize < 5} {set arrow none} {set arrow last} set arrowshape [list $arrowsize [expr $arrowsize*4/5] [expr $arrowsize/3]] $self item WIRE line $xys -width $thick -smooth yes \ ! -arrow $arrow -arrowshape $arrowshape -fill $look(wirefg) #puts ".......tags: [.$@canvas.c gettags $self]" --- 2055,2063 ---- if {$arrowsize < 5} {set arrow none} {set arrow last} set arrowshape [list $arrowsize [expr $arrowsize*4/5] [expr $arrowsize/3]] + # need this, maybe... + if {$@select_by == "selrect"} {set wire_color $look(wirefg2)} {set wire_color $look(wirefg)} + #set wire_color $look(wirefg) $self item WIRE line $xys -width $thick -smooth yes \ ! -arrow $arrow -arrowshape $arrowshape -fill $wire_color #puts ".......tags: [.$@canvas.c gettags $self]" *************** *** 2049,2053 **** def* wire select {flag} { global look ! if {$flag} {set colour #ff8000} {set colour $look(wirefg)} .$@canvas.c itemconfigure ${self}WIRE -fill $colour } --- 2075,2079 ---- def* wire select {flag} { global look ! if {$flag} {set colour $look(wirefg2)} {set colour $look(wirefg)} .$@canvas.c itemconfigure ${self}WIRE -fill $colour } *************** *** 2062,2067 **** }
- # mset [list @obj1 @port1 @obj2 @port2] [lrange $d 0 3] - #-----------------------------------------------------------------------------------# ############ colouring --- 2088,2091 ----