[PD-cvs] pd/src desire.tk,1.1.2.76,1.1.2.77
Mathieu Bouchard
matju at users.sourceforge.net
Fri Sep 23 14:37:01 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3647
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
re-fixed hilite_io. also added inlet/outlet tooltip (without actual content)
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.76
retrieving revision 1.1.2.77
diff -C2 -d -r1.1.2.76 -r1.1.2.77
*** desire.tk 23 Sep 2005 12:12:27 -0000 1.1.2.76
--- desire.tk 23 Sep 2005 12:36:59 -0000 1.1.2.77
***************
*** 1256,1290 ****
}
! def view move {dx dy} {
set @cx [expr $@cx+$dx]
set @cy [expr $@cy+$dy]
! #.x$@canvas.c move $self $dx $dy; return
! $self draw $_($self:canvas)
for {set x 0} {$x<$@ninlets} {incr x} {
! if {[info exists _($self:i:$x)]} {
! foreach wire $_($self:i:$x) {$wire draw $self}
! }
}
for {set x 0} {$x<$@noutlets} {incr x} {
! if {[info exists _($self:o:$x)]} {
! foreach wire $_($self:o:$x) {$wire draw $self}
! }
}
}
# 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}
#if {![llength $@wire_from]} {}
set outline [switch $type {i {list $look(outletfg)} o {list $look(inletfg)}}]
$c create rectangle [l+ [$c coords $p] {-4 -4 +4 +4}] -outline $outline -width 1 -tags ${p}b
return $port
-
}
--- 1256,1288 ----
}
! def view move {canvas dx dy} {
set @cx [expr $@cx+$dx]
set @cy [expr $@cy+$dy]
! .x$@canvas.c move $self $dx $dy
! #$self draw
for {set x 0} {$x<$@ninlets} {incr x} {
! set v $self:i:$x
! if {[info exists _($v)]} {foreach wire $_($v) {$wire draw $self}}
}
for {set x 0} {$x<$@noutlets} {incr x} {
! set v $self:o:$x
! if {[info exists _($v)]} {foreach wire $_($v) {$wire draw $self}}
}
}
# type is i or o
! def objectbox hilite_io {canvas type x y} {
global look
! set c .x$canvas.c
set ports 0; catch {set ports $@ninlets}
if {$ports==0} return
set port [expr int(($x-$@cx)*$ports/$@xs)]
set p ${self}${type}${port}
#if {![llength $@wire_from]} {}
set outline [switch $type {i {list $look(outletfg)} o {list $look(inletfg)}}]
$c create rectangle [l+ [$c coords $p] {-4 -4 +4 +4}] -outline $outline -width 1 -tags ${p}b
+ switch $type {i {set tip "inlet $port"} o {set tip "outlet $port"}}
+ $canvas show_tooltip $x $y $tip
return $port
}
***************
*** 1317,1321 ****
switch $@action {
move {
! foreach obj $@selection {$obj move [expr $x-$ox] [expr $y-$oy]}
return
}
--- 1315,1319 ----
switch $@action {
move {
! foreach obj $@selection {$obj move $self [expr $x-$ox] [expr $y-$oy]}
return
}
***************
*** 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]
--- 1338,1342 ----
mset {x1 y1 x2 y2} [$id bbox]
if {abs($y1+3-$y)<=3} {
! set port [$id hilite_io $self i $x $y]
set dehighlight "$c delete ${id}i${port}b; set wire_to {}"
set wire_to [list $id $port]
***************
*** 1346,1350 ****
}
if {abs($y2-3-$y)<=3} {
! set port [$id hilite o $x $y]
set dehighlight "$c delete ${id}o${port}b"
return
--- 1344,1348 ----
}
if {abs($y2-3-$y)<=3} {
! set port [$id hilite_io $self o $x $y]
set dehighlight "$c delete ${id}o${port}b"
return
***************
*** 2777,2781 ****
set c .x$self.c
$c create text $x $y -text $text -anchor w -tags tooltip_fg
! mset {x1 y1 x2 y2} [$canvas bbox tooltip_fg]
set w 0
set h 0
--- 2775,2779 ----
set c .x$self.c
$c create text $x $y -text $text -anchor w -tags tooltip_fg
! mset {x1 y1 x2 y2} [$c bbox tooltip_fg]
set w 0
set h 0
***************
*** 2793,2799 ****
def canvas hide_tooltip {} {
set c .x$self.c
$c delete tooltip_bg tooltip_fg
- global tooltip
set tooltip(visible) 0
}
--- 2791,2797 ----
def canvas hide_tooltip {} {
+ global tooltip
set c .x$self.c
$c delete tooltip_bg tooltip_fg
set tooltip(visible) 0
}
More information about the Pd-cvs
mailing list