[PD-cvs] pd/src desire.tk,1.1.2.351,1.1.2.352

Mathieu Bouchard matju at users.sourceforge.net
Wed Aug 16 20:08:13 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
fixed Radio and multiple tags


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.351
retrieving revision 1.1.2.352
diff -C2 -d -r1.1.2.351 -r1.1.2.352
*** desire.tk	16 Aug 2006 17:50:47 -0000	1.1.2.351
--- desire.tk	16 Aug 2006 18:08:11 -0000	1.1.2.352
***************
*** 1018,1025 ****
  }
  
! def View item {suffix type coords args} {
  	global font
  	set c .$@canvas.c
- 	set ss $self$suffix
  	set scale [$@canvas scale]
  	set coords [lmap * $coords $scale]
--- 1018,1024 ----
  }
  
! def View item {suffixes type coords args} {
  	global font
  	set c .$@canvas.c
  	set scale [$@canvas scale]
  	set coords [lmap * $coords $scale]
***************
*** 1039,1045 ****
  		}
  	}
! 	
  	if {![llength [$c gettags $ss]]} {
! 		eval  [concat [list $c create $type $coords  -tags "$ss $self"] $args]
  	} {
  		eval [concat [list $c itemconfigure $ss] $args]
--- 1038,1047 ----
  		}
  	}
! 
! 	set tags {}
! 	foreach s $suffixes {lappend tags "$self$s"}
! 	set ss [lindex $tags 0]
  	if {![llength [$c gettags $ss]]} {
! 		eval  [concat [list $c create $type $coords  -tags $tags] $args]
  	} {
  		eval [concat [list $c itemconfigure $ss] $args]
***************
*** 1056,1060 ****
  
  def  View  delete {} {$self _delete}
! def* View _delete {} {$self erase; io_erase $self}
  def* View erase {} {$self item_delete}
  def View selected?  {}  {return $@selected?}
--- 1058,1062 ----
  
  def  View  delete {} {$self _delete}
! def* View _delete {} {$self erase}
  def* View erase {} {$self item_delete}
  def View selected?  {}  {return $@selected?}
***************
*** 1533,1547 ****
          set onset [expr $x1 + ($xs-([look iowidth])) * $i / $nplus]
          set points [list [expr $onset] [expr $y-1] [expr $onset+[look iowidth]] $y]
- 	#will update this code when proc item deals with mult.tags
- 	#if {[llength [$c gettags $self$which$i]] != 0} {
-         #    $c coords ${self}$which$i $points
-         #} {
-         #    $c create rectangle $points -tags "$self$which $self$which$i $self" \
- 	#	-outline [switch $which { i {concat [look inletfg]} o {concat [look outletfg]}}]
-         #}
- 	
  	switch $which { i {set color [look inletfg]} o {set color [look outletfg]}}
! 	$self item $which$i rectangle $points -outline $color -fill $color -tags "$self$which $self$which$i $self"
! 	 
      }
  }
--- 1535,1540 ----
          set onset [expr $x1 + ($xs-([look iowidth])) * $i / $nplus]
          set points [list [expr $onset] [expr $y-1] [expr $onset+[look iowidth]] $y]
  	switch $which { i {set color [look inletfg]} o {set color [look outletfg]}}
! 	$self item [list $which$i $which] rectangle $points -outline $color -fill $color
      }
  }
***************
*** 1554,1559 ****
  }
  
- def io erase {} {.$@canvas.c delete ${self}i ${self}o}
- 
  #-----------------------------------------------------------------------------------#
  class_new TextBox {Box}
--- 1547,1550 ----
***************
*** 1978,1989 ****
        default {$@action motion $x $y $f $target}
      }
!     switch $type {
!       inlet  {set port [$id hilite_io i $x $y]; set @dehighlight [list $c delete ${id}i${port}b]}
!       outlet {set port [$id hilite_io o $x $y]; set @dehighlight [list $c delete ${id}o${port}b]}
!       object {
! 	#if {$@editmode} {set event motionedit} {set event motion}
! 	#$id $event $x $y $f $target
        }
-       wire {}
      }
  }
--- 1969,1977 ----
        default {$@action motion $x $y $f $target}
      }
!     if {$@editmode} {
!       switch $type {
! 	inlet  {set port [$id hilite_io i $x $y]; set @dehighlight [list $c delete ${id}i${port}b]}
! 	outlet {set port [$id hilite_io o $x $y]; set @dehighlight [list $c delete ${id}o${port}b]}
        }
      }
  }
***************
*** 2357,2361 ****
  }
  
- # should be renamed to "click" when the other "click" becomes unneeded.
  def* Canvas click {x y f target} {
      if {[winfo exists .completion]} {
--- 2345,2348 ----
***************
*** 2370,2379 ****
      if {$@editmode} {$self clickedit $x $y $f $target; return}
      mset {type id detail} $target
!     if {![llength $id]} {return}
!     switch $type {
!       object {$id click $x $y $f $target}
!       wire   {$id click $x $y $f $target}
!       default {error BORK}
!     }
  }
  
--- 2357,2361 ----
      if {$@editmode} {$self clickedit $x $y $f $target; return}
      mset {type id detail} $target
!     if {[llength $id]} {$id click $x $y $f $target}
  }
  
***************
*** 3812,3817 ****
  	super
  	for {set i 0} {$i<$@n} {incr i} {
! 		#fixme: item doesn't support multiple tags yet
! 		$self item "BUT$i BUT" rectangle \
  			[list [expr $x1+3] [expr $y1+3] [expr $x1+$@w-3] [expr $y1+$@w-3]] \
  			-fill #ffffff -outline #000000 
--- 3794,3798 ----
  	super
  	for {set i 0} {$i<$@n} {incr i} {
! 		$self item [list BUT$i BUT] rectangle \
  			[list [expr $x1+3] [expr $y1+3] [expr $x1+$@w-3] [expr $y1+$@w-3]] \
  			-fill #ffffff -outline #000000 





More information about the Pd-cvs mailing list