[PD-cvs] pd/src desire.tk,1.1.2.537,1.1.2.538

chunlee chunlee at users.sourceforge.net
Mon Oct 30 17:41:32 CET 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
more on hilite io stuff


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.537
retrieving revision 1.1.2.538
diff -C2 -d -r1.1.2.537 -r1.1.2.538
*** desire.tk	30 Oct 2006 12:02:49 -0000	1.1.2.537
--- desire.tk	30 Oct 2006 16:41:28 -0000	1.1.2.538
***************
*** 3009,3016 ****
--- 3009,3018 ----
  	switch [expr $f&255] {
  		0 {
+ 			if {[lsearch $@selection $id] < 0 || [llength $@selection] == 0} {
  			if {[llength $@obj_in_edit]} {$@obj_in_edit unedit; set @obj_in_edit {}}
  			$self deselect_all
  			$self selection+= $id
  			set @action edit
+ 			} else {set @action edit}
  		}
  		1 {
***************
*** 3390,3394 ****
  			}
  		}
! 		mset {x y x1 y1} [[$self widget] bbox ${object}${type}${port}]	
  		lappend @keynav_port2 ${object}${type}${port}
  		set _($object:ioselect) [list [lindex $ports3 $@keynav_iocount] [lindex $ports2 $@keynav_iocount]]
--- 3392,3396 ----
  			}
  		}
! 		mset {x y x1 y1} [[$self widget] bbox ${object}${type}${port}]
  		lappend @keynav_port2 ${object}${type}${port}
  		set _($object:ioselect) [list [lindex $ports3 $@keynav_iocount] [lindex $ports2 $@keynav_iocount]]
***************
*** 3675,3678 ****
--- 3677,3681 ----
  def Box draw {} {
  	$self draw_box
+ 	$self update_hilite_io
  #	if {[$self class] == "Canvas"} {$self restack}
  }
***************
*** 3794,3798 ****
  
  	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
--- 3797,3800 ----
***************
*** 3801,3810 ****
  	set hilitebox [lmap * [list -3 -3 +3 +3] [$@canvas zoom]]
  	set outline [switch $type {i {concat [$self look outletfg]} o {concat [$self look inletfg]}}]
! 	#$c create rectangle [l+ [$c coords $p] $hilitebox] -outline $outline -width 1 -tags ${p}b
! 	$self item ${p}b rectangle [l+ [$c coords $p2] $hilitebox] -outline $outline -width 1
  	switch $type {i {set tip "inlet $port"} o {set tip "outlet $port"}}
  	if {[$self look tooltip]} {$@canvas show_tooltip $x $y $tip $type}
  	return $port
  }
  #-----------------------------------------------------------------------------------#
  class_new Wire {View}
--- 3803,3831 ----
  	set hilitebox [lmap * [list -3 -3 +3 +3] [$@canvas zoom]]
  	set outline [switch $type {i {concat [$self look outletfg]} o {concat [$self look inletfg]}}]
! 	switch $type {i {set ns $@ninlets} o {set ns $@noutlets}}
! 	$self item ${p}b rectangle [l+ [$self io_bbox $type $port $ns] $hilitebox] -outline $outline -width 1
! 	#$self item ${p}b rectangle [l+ [lmap / [$c coords $p2] [$@canvas zoom]] $hilitebox] -outline $outline -width 1
  	switch $type {i {set tip "inlet $port"} o {set tip "outlet $port"}}
  	if {[$self look tooltip]} {$@canvas show_tooltip $x $y $tip $type}
  	return $port
  }
+ 
+ def Box update_hilite_io {} {
+ 	if {![llength $@ioselect]} {return}
+ 	set type [lindex $@ioselect 1]
+ 	set zoom [$@canvas zoom]
+ 	set n [lindex $@ioselect 0]
+ 	set port ${self}${type}${n}
+ 	set p $type$n
+ 	set hilitebox [lmap * [list -3 -3 +3 +3] [$@canvas zoom]]
+ 	set outline [switch $type {i {concat [$self look outletfg]} o {concat [$self look inletfg]}}]
+ 	set c [$@canvas widget]
+ 	switch $type {
+ 		i {set ns $@ninlets}
+ 		o {set ns $@noutlets}
+ 	}
+ 	$self item ${p}b rectangle [l+ [$self io_bbox $type $n $ns] $hilitebox] -outline $outline -width 1
+ }
+ 
  #-----------------------------------------------------------------------------------#
  class_new Wire {View}





More information about the Pd-cvs mailing list