[PD-cvs] pd/src desire.tk,1.1.2.142,1.1.2.143
chunlee
chunlee at users.sourceforge.net
Wed Feb 15 18:04:13 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14910
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
added code for hilite wire...
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.142
retrieving revision 1.1.2.143
diff -C2 -d -r1.1.2.142 -r1.1.2.143
*** desire.tk 10 Feb 2006 16:03:41 -0000 1.1.2.142
--- desire.tk 15 Feb 2006 17:04:11 -0000 1.1.2.143
***************
*** 994,997 ****
--- 994,998 ----
set @dehighlight {}
set @wires {}
+ set @wire_hilite {}
global history
set @history $history
***************
*** 1531,1534 ****
--- 1532,1536 ----
# }
mset {type id} [$self identify_target $x $y -1 -1 "move "]
+ #puts "type :: $type"
switch $type {
object {
***************
*** 1553,1556 ****
--- 1555,1561 ----
}
}
+ wire {
+ puts " over a wire! -> $id"
+ }
}
}
***************
*** 1572,1577 ****
foreach tag $stack {
set tags [$c gettags $tag]
! if {[regexp {^l([a-f0-9]{6,8})} $tags id]} {
! #post "(.....) $id is a wire"
return [list "wire" $id]
}
--- 1577,1582 ----
foreach tag $stack {
set tags [$c gettags $tag]
! if {[regexp {^([0-9]{6,8})} $tags id]} {
! puts "tags:: $tags"
return [list "wire" $id]
}
***************
*** 1641,1652 ****
#-----------------------------------------------------------------------------------#
! def* canvas click_on_wire {x y b f id} {
! set c .$self.c
! if {$f&8} {post "rightclick wire"}
#$c create line $xys -tags $self -width $thick \
#-arrow $arrow -arrowshape $arrowshape -fill $look(wirefg)
#$c itemconfigure ${obj}BASE -outline $look(wirefg2)
! $c itemconfigure $id -fill $look(wirefg2)
! set @selection_wire $id
# my wire click select end
}
--- 1646,1658 ----
#-----------------------------------------------------------------------------------#
! def* canvas click_on_wire {x y b f} {
! puts "click on wire!!!"
! #set c .$self.c
! #if {$f&8} {post "rightclick wire"}
#$c create line $xys -tags $self -width $thick \
#-arrow $arrow -arrowshape $arrowshape -fill $look(wirefg)
#$c itemconfigure ${obj}BASE -outline $look(wirefg2)
! #$c itemconfigure $id -fill $look(wirefg2)
! #set @selection_wire $id
# my wire click select end
}
***************
*** 1661,1664 ****
--- 1667,1671 ----
foreach o $@selection {$o selected?= 0}
set @selection {}
+ if {$@wire_hilite != ""} {$@wire_hilite select 0}
#set @select_by ""
}
***************
*** 1679,1685 ****
}
set in_selection [expr [lsearch $@selection $id]>=0]
! mset {x1 y1 x2 y2} [$id bbox]
! set outs 0; set outs [$id noutlets]
! if {$y>=$y2-6 && $outs} {
set out [expr int(($x-$x1)*$outs/($x2-$x1))]
mset {x1 y1 x2 y2} [$c bbox ${id}o${out}]
--- 1686,1706 ----
}
set in_selection [expr [lsearch $@selection $id]>=0]
!
! #mset {x1 y1 x2 y2} [$id bbox]
! #set outs 0; set outs [$id noutlets]
! #if {$y>=$y2-6 && $outs} {
! # set out [expr int(($x-$x1)*$outs/($x2-$x1))]
! # mset {x1 y1 x2 y2} [$c bbox ${id}o${out}]
! # $c create line [expr ($x1+$x2)/2] [expr ($y1+$y2)/2] $x $y -dash {4 4 4 4} -tags lnew
! # set @wire_from [list $id $out]
! # set @action wire
! # return
! #}
! switch $type {
! object {
! # handles the wire drawing
! mset {x1 y1 x2 y2} [$id bbox]
! set outs 0; set outs [$id noutlets]
! if {$y>=$y2-6 && $outs} {
set out [expr int(($x-$x1)*$outs/($x2-$x1))]
mset {x1 y1 x2 y2} [$c bbox ${id}o${out}]
***************
*** 1688,1695 ****
set @action wire
return
! }
! switch $type {
! object {$id clickedit $x $y $b $f $in_selection $@selection}
! wire {$id clickedit $x $y $b $f}
default {error BORK}
}
--- 1709,1721 ----
set @action wire
return
! }
! # clcik on object
! $id clickedit $x $y $b $f $in_selection $@selection
! }
! wire {
! if {$@wire_hilite != ""} {$@wire_hilite select 0}
! set @wire_hilite $id
! $id select 1
! }
default {error BORK}
}
***************
*** 2006,2013 ****
}
! def wire select {flag} {
global look
if {$flag} {set colour #ff8000} {set colour $look(wirefg)}
! $canvas itemconfigure $self -fill $colour
}
--- 2032,2039 ----
}
! def* wire select {flag} {
global look
if {$flag} {set colour #ff8000} {set colour $look(wirefg)}
! .$@canvas.c itemconfigure ${self}WIRE -fill $colour
}
More information about the Pd-cvs
mailing list