[PD-cvs] pd/src desire.tk,1.1.2.217,1.1.2.218

chunlee chunlee at users.sourceforge.net
Sat Jun 3 04:05:56 CEST 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26009

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
modified the io hilite a bit


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.217
retrieving revision 1.1.2.218
diff -C2 -d -r1.1.2.217 -r1.1.2.218
*** desire.tk	2 Jun 2006 21:10:05 -0000	1.1.2.217
--- desire.tk	3 Jun 2006 02:05:53 -0000	1.1.2.218
***************
*** 830,833 ****
--- 830,834 ----
  set look(statusbar) 1
  set look(showcomp) 10
+ set look(tooltip) 1
  
  set look(extrapix) [switch $OS {
***************
*** 1379,1383 ****
  class_new io {ganymeda}
  
! def io draw/2 {which n y} {
      global look
      set nplus [expr $n==1 ? 1 : $n-1]
--- 1380,1384 ----
  class_new io {ganymeda}
  
! def* io draw/2 {which n y} {
      global look
      set nplus [expr $n==1 ? 1 : $n-1]
***************
*** 1809,1813 ****
  	  mset {x1 y1 x2 y2} [$id bbox]
  	  post %s "y=$y y1=$y1 y2=$y2"
! 	  if {$y<$y1+6} {
  		set port [$id hilite_io i $x $y]
  		if {$port==""} return
--- 1810,1814 ----
  	  mset {x1 y1 x2 y2} [$id bbox]
  	  post %s "y=$y y1=$y1 y2=$y2"
! 	  if {$y<$y1+2} {
  		set port [$id hilite_io i $x $y]
  		if {$port==""} return
***************
*** 1816,1820 ****
  		return
  	  }
! 	  if {$y>=$y2-6} {
  		set port [$id hilite_io o $x $y]
  		if {$port==""} return
--- 1817,1821 ----
  		return
  	  }
! 	  if {$y>=$y2-2} {
  		set port [$id hilite_io o $x $y]
  		if {$port==""} return
***************
*** 2288,2293 ****
  	set c .$@canvas.c
  	switch $type {i {set ports $@ninlets} o {set ports $@noutlets}}
! 	if {$ports==0} return
! 	set port [expr int(($x-$x1)*$ports/$xs)]
  	if {$port >= $ports} {set port [expr $ports-1]}
  	set p $self$type$port
--- 2289,2305 ----
  	set c .$@canvas.c
  	switch $type {i {set ports $@ninlets} o {set ports $@noutlets}}
! 	set port -1
! 	
! 	for {set n 0} {$n<$ports} {incr n} {
! 	set tag $self$type$n
! 	set area [.$@canvas.c bbox $self$type$n]
! 	set center [expr ([lindex $area 2] + [lindex $area 0]) / 2 ]
! 	set dist [expr abs($x - $center)]
! 	if {$dist < [expr ($look(iowidth)/2)+5] && $dist > 0} {set port $n}
! 	}
! 	
! 	
! 	if {$ports==0 | $port==-1} return
! 	#set port [expr int(($x-$x1)*$ports/$xs)]
  	if {$port >= $ports} {set port [expr $ports-1]}
  	set p $self$type$port
***************
*** 2295,2299 ****
  	$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
  }
--- 2307,2311 ----
  	$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"}}
! 	if {$look(tooltip)} {$@canvas show_tooltip $x $y $tip}
  	return $port
  }
***************
*** 3404,3408 ****
  set tooltip(on_hide) ""
  
! def* Canvas show_tooltip {x y text {on_hide ""}} {
  	global tooltip
  	if {$tooltip(visible) && [string compare $text $tooltip(text)]==0} {return}
--- 3416,3420 ----
  set tooltip(on_hide) ""
  
! def Canvas show_tooltip {x y text {on_hide ""}} {
  	global tooltip
  	if {$tooltip(visible) && [string compare $text $tooltip(text)]==0} {return}





More information about the Pd-cvs mailing list