[PD-cvs] pd/src desire.tk,1.1.2.479,1.1.2.480

chunlee chunlee at users.sourceforge.net
Fri Sep 22 18:41:58 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
more on array


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.479
retrieving revision 1.1.2.480
diff -C2 -d -r1.1.2.479 -r1.1.2.480
*** desire.tk	22 Sep 2006 14:08:12 -0000	1.1.2.479
--- desire.tk	22 Sep 2006 16:41:55 -0000	1.1.2.480
***************
*** 2142,2145 ****
--- 2142,2146 ----
      if {!$@editmode & [$self focus] != $self & [$self focus] != ""} {[$self focus] motion $x $y $f $target}
      mset {type id detail} $target
+     if {$id != ""} {if {[$id class] == "Array"} {$id motion $x $y $f $target; return}}
      switch $@action {
        move {
***************
*** 4526,4530 ****
  	puts "data: $@data"
  	set i 0
! #		$self item RECT polygon [list 0 0 $c_width 0 $c_width $c_height 0 $c_height] -outline red -fill white
  	foreach val $@data {
  		set y [expr $c_height - ((($val+abs($yfrom))/($yto-($yfrom)) * $c_height))]
--- 4527,4532 ----
  	puts "data: $@data"
  	set i 0
! 	#cheats
! 	$self item RECT polygon [list 0 0 $c_width 0 $c_width $c_height 0 $c_height] -outline red -fill white
  	foreach val $@data {
  		set y [expr $c_height - ((($val+abs($yfrom))/($yto-($yfrom)) * $c_height))]
***************
*** 4533,4537 ****
  		set line [list $x1 $y $x2 $y]
  		set tag ${self}${i}
! 		$self item elem${i} line $line -fill [$@canvas look compfg] -width 2 -tags "$self"
  		incr i
  	}
--- 4535,4539 ----
  		set line [list $x1 $y $x2 $y]
  		set tag ${self}${i}
! 		$self item elem${i} line $line -fill [$@canvas look compfg] -width 2 -tags "$self ${self}elem${i}"
  		incr i
  	}
***************
*** 4542,4547 ****
  }
  
! def Array click {x y f target} {set @action "move"; puts "action:: $@action";puts "click on array........."}
! def Array motion {x y f target} {}
  def Array length= {val} {set @length $val}
  def Array name= {val} {set @name $val}
--- 4544,4560 ----
  }
  
! def Array click {x y f target} {puts "click on array........."}
! def Array motion {x y f target} {
! 	mset {c_width c_height} [$@canvas get_dimen]
! 	set width [expr $c_width / $@length]
! 	set i [format %d [expr int($x/$width)]]
! 	puts "  drawing this elem::: $i  -> $width"
! 	set x1 [expr $width * $i]
!        	set x2 [expr $x1 + $width]
!        	set line [list $x1 $y $x2 $y]
! 
! 	$self item elem${i} line $line -fill [$@canvas look compfg] -width 2 -tags " $self ${self}elem${i} "
! 
! }
  def Array length= {val} {set @length $val}
  def Array name= {val} {set @name $val}





More information about the Pd-cvs mailing list