Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29239
Modified Files: Tag: devel_0_39 desire.tk Log Message: class objectbox: merging hilite_in and hilite_out together.
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.74 retrieving revision 1.1.2.75 diff -C2 -d -r1.1.2.74 -r1.1.2.75 *** desire.tk 22 Sep 2005 07:50:46 -0000 1.1.2.74 --- desire.tk 23 Sep 2005 12:05:33 -0000 1.1.2.75 *************** *** 70,74 **** global _ set self [lindex $args 0] ! if {[regexp match $self {^$}]} {error null pointer you black emperor} set selector [lindex $args 1] if {[llength [array names _ $self:_class]] == 0} { --- 70,74 ---- global _ set self [lindex $args 0] ! if {[regexp match $self {^$}]} {error "null pointer you black emperor"} set selector [lindex $args 1] if {[llength [array names _ $self:_class]] == 0} { *************** *** 178,191 **** switch $OS { win32 { ! set pd_gui2 [string range $argv0 0 [expr [string last \ $argv0] - 1]] regsub -all \\ $pd_gui2 / pd_gui3 set pd_guidir $pd_gui3/.. - load $pd_guidir/bin/pdtcl set pd_tearoff 1 } ! osx { ! set pd_gui2 [string range $argv0 0 [expr [string last / $argv0] - 1]] set pd_guidir $pd_gui2/.. - load $pd_guidir/bin/pdtcl set pd_tearoff 0 } --- 178,189 ---- switch $OS { win32 { ! set pd_gui2 [file dirname $argv0] regsub -all \\ $pd_gui2 / pd_gui3 set pd_guidir $pd_gui3/.. set pd_tearoff 1 } ! Darwin { ! set pd_gui2 [file dirname $argv0] set pd_guidir $pd_gui2/.. set pd_tearoff 0 } *************** *** 1189,1193 **** foreach wire_id $_($self:i:$x) { wire_update $wire_id $_($wire_id) - wire_draw2 $wire_id $canvas #set i [lsearch $@selection_wire $wire_id] #if {$i<0} {lappend @selection_wire $wire_id} --- 1187,1190 ---- *************** *** 1199,1203 **** foreach wire_id $_($self:o:$x) { wire_update $wire_id $_($wire_id) - wire_draw2 $wire_id $canvas #set i [lsearch $@selection_wire $wire_id] #if {$i<0} {lappend @selection_wire $wire_id} --- 1196,1199 ---- *************** *** 1277,1307 **** }
! def objectbox hilite_in {x y} { ! puts "** hilite inlet **" ! global look _ ! set ports 0 set c .x$_($self:canvas).c ! catch {set ports $@ninlets} if {$ports==0} return set port [expr int(($x-$@cx)*$ports/$@xs)] ! set p ${self}i${port}b #if {![llength $@wire_from]} {} ! $c create rectangle [l+ [$c coords ${self}i${port}] {-4 -4 +4 +4}] \ ! -outline $look(outletfg) -width 1 -tags $p return $port - } - - def objectbox hilite_out {x y} { - global look _ - set ports 0 - set c .x$_($self:canvas).c - catch {set ports $@noutlets} - if {$ports==0} return - set port [expr int(($x-$@cx)*$ports/$@xs)] - set p ${self}o${port}b - $c create rectangle [l+ [$c coords ${self}o${port}] {-4 -4 +4 +4}] \ - -outline $look(outletfg) -width 1 -tags $p
- return $port }
--- 1273,1290 ---- }
! # type is i or o ! def objectbox hilite_io {type x y} { ! global look set c .x$_($self:canvas).c ! set ports 0; catch {set ports $@ninlets} if {$ports==0} return set port [expr int(($x-$@cx)*$ports/$@xs)] ! set port [expr int(($x-$@cx)*$ports/$@xs)] ! set p ${self}${type}${port}b #if {![llength $@wire_from]} {} ! set outline [switch $type {i {list $look(outletfg)} o {list $look(inletfg)}] ! $c create rectangle [l+ [$c coords ${self}i${port}] {-4 -4 +4 +4}] -outline $outline -width 1 -tags $p return $port
}
*************** *** 1357,1364 **** mset {x1 y1 x2 y2} [$id bbox] if {abs($y1+3-$y)<=3} { ! #set port [$self hilite_in $_($id:cx) $_($id:cy)] ! #set dehighlight "$c delete ${self}i${port}b; set wire_to {}" ! #set wire_to [list $id $port] ! set port [$id hilite_in $x $y] set dehighlight "$c delete ${id}i${port}b; set wire_to {}" set wire_to [list $id $port] --- 1340,1344 ---- mset {x1 y1 x2 y2} [$id bbox] if {abs($y1+3-$y)<=3} { ! set port [$id hilite i $x $y] set dehighlight "$c delete ${id}i${port}b; set wire_to {}" set wire_to [list $id $port] *************** *** 1366,1372 **** } if {abs($y2-3-$y)<=3} { ! #set port [$self hilite_out $x $y] ! #set dehighlight "$c delete ${self}o${port}b" ! set port [$id hilite_out $x $y] set dehighlight "$c delete ${id}o${port}b" return --- 1346,1350 ---- } if {abs($y2-3-$y)<=3} { ! set port [$id hilite o $x $y] set dehighlight "$c delete ${id}o${port}b" return *************** *** 1615,1619 **** set _($wire_id) $d wire_update $wire_id $d - wire_draw2 $wire_id $c #pd "$self add-wire x$@wire_from x$wire_to ;" #puts "::::connect from $@wire_from to $wire_to" --- 1593,1596 ---- *************** *** 1669,1673 **** foreach wire_id $_($obj:i:$x) { #wire_update $wire_id $_($wire_id) - #wire_draw2 $wire_id $self set i [lsearch $@selection_wire $wire_id] if {$i<0} {lappend @selection_wire $wire_id} --- 1646,1649 ---- *************** *** 1679,1683 **** foreach wire_id $_($obj:o:$x) { #wire_update $wire_id $_($wire_id) - #wire_draw2 $wire_id $self set i [lsearch $@selection_wire $wire_id] if {$i<0} {lappend @selection_wire $wire_id} --- 1655,1658 ---- *************** *** 1851,1854 **** --- 1826,1830 ---- set @inlet $inlet set @type $kind + $self draw }