[PD-cvs] extensions/gui/ix mat.wid,1.4,1.5

carmen rocco ix9 at users.sourceforge.net
Tue May 17 09:47:01 CEST 2005


Update of /cvsroot/pure-data/extensions/gui/ix
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9328

Modified Files:
	mat.wid 
Log Message:
http://www.drudge.com/weblog/3353/dj_injures_anus_firing_bottle_rockets.html

Index: mat.wid
===================================================================
RCS file: /cvsroot/pure-data/extensions/gui/ix/mat.wid,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mat.wid	16 May 2005 18:31:18 -0000	1.4
--- mat.wid	17 May 2005 07:46:57 -0000	1.5
***************
*** 6,14 ****
      }
      variable _
! 
      proc mat_click {button action p t x y} {
  	variable _
  	set clicked [$p.m find overlapping $x $y $x $y]
  	switch $action {
  	    first {
  #		if {$clicked ne ""} {
--- 6,26 ----
      }
      variable _
!     proc mat_note {p t item} {
! 	set id [lindex [$p.m itemcget $item -tags] 1]
! 	set len [expr [lindex $_($t:items:$id) 2] - [lindex $_($t:items:$id) 0]]
! 	set vel [$p.m itemcget $item -fillopacity]
! 	pd [concat $t.rp _cb note [lindex $_($t:items:$id) 1] $vel $len \;]
!     }
      proc mat_click {button action p t x y} {
  	variable _
  	set clicked [$p.m find overlapping $x $y $x $y]
  	switch $action {
+ 	    hover {
+ 		foreach item $clicked {
+ 		    if {[lindex [$p.m itemcget $item -tags] 0] eq "item"} {
+ 			mat_note $p $t $item
+ 		    }
+ 		}
+ 	    }
  	    first {
  #		if {$clicked ne ""} {
***************
*** 61,65 ****
  		    }
  		    3 {
! 			set velo [expr ($x - $_($t:fx)) / 100.0]
  			foreach item $_($t:cl) {
  			    set vel [expr $velo + [$p.m itemcget $item -fillopacity]]
--- 73,77 ----
  		    }
  		    3 {
! 			set velo [expr ($x - $_($t:cx)) / 100.0]
  			foreach item $_($t:cl) {
  			    set vel [expr $velo + [$p.m itemcget $item -fillopacity]]
***************
*** 88,93 ****
  		$p.m coords drawing [::tkpath::coords rect $xa $y [expr $xb - $xa] [mat_tr $p $t y id 1] -rx 3 -ry 3]
  		set yi [mat_tr $p $t y i $y]
! 		set _($t:items:$_($t:i)) [list [mat_tr $p $t x i $xa] $yi [mat_tr $p $t x i $xb] $yi 0 0 0]
! 		pd [concat $t.rp _cb note $yi \;]
  	    }
  	    first {
--- 100,105 ----
  		$p.m coords drawing [::tkpath::coords rect $xa $y [expr $xb - $xa] [mat_tr $p $t y id 1] -rx 3 -ry 3]
  		set yi [mat_tr $p $t y i $y]
! 		set _($t:items:$_($t:i)) [list [mat_tr $p $t x i $xa] $yi [mat_tr $p $t x i $xb] $yi]
! #		pd [concat $t.rp _cb note $yi \;]
  	    }
  	    first {
***************
*** 109,113 ****
  	    i {return [expr ($_($t:${d}b) - $_($t:${d}a)) * $v /([winfo $dm($d) $p.m] + 0.0) + $_($t:${d}a)]}
  	    d {return [expr ($_($t:${d}b) - $_($t:${d}a)) * $v /([winfo $dm($d) $p.m] + 0.0)]}
! 	    id {return [expr $v / ($_($t:${d}b) - $_($t:${d}a) + 0.0) * [winfo $dm($d) $p.m]]}
  	}
      }
--- 121,126 ----
  	    i {return [expr ($_($t:${d}b) - $_($t:${d}a)) * $v /([winfo $dm($d) $p.m] + 0.0) + $_($t:${d}a)]}
  	    d {return [expr ($_($t:${d}b) - $_($t:${d}a)) * $v /([winfo $dm($d) $p.m] + 0.0)]}
! #	    id {return [expr $v / ($_($t:${d}b) - $_($t:${d}a) + 0.0) * [winfo $dm($d) $p.m]]}
! 	    id {return [expr abs($v / ($_($t:${d}b) - $_($t:${d}a) + 0.0) * [winfo $dm($d) $p.m])]}
  	}
      }
***************
*** 137,140 ****
--- 150,154 ----
  	    canvas $path.m -bg $bg -width $w -height $h
  	    pack $path.m -side left
+ 	    bind $path.m <Motion> "::ix::mat_click 0 hover $path $target %x %y"
  	    bind $path.m <1> "::ix::mat_click 1 first $path $target %x %y"
  	    bind $path.m <B1-Motion> "::ix::mat_click 1 motion $path $target %x %y"
***************
*** 169,173 ****
  	    array set tj {x center y left}
  	    array set igx {y width x height}
! 	    for {set x [expr int($_($target:${xy}a) / ($_($target:q${xy}v) + 0.0) + 1)*($_($target:q${xy}v) + 0.0)]} {$x <= $_($target:${xy}b)} {set x [expr $x + $_($target:q${xy}v)]} {
  		set og [mat_tr $path $target $xy t $x]
  		set invgeo [winfo $igx($xy) $path.m]
--- 183,188 ----
  	    array set tj {x center y left}
  	    array set igx {y width x height}
! 	    if {$_($target:${xy}a) > $_($target:${xy}b)} {set oa ">=";set ob "-"} {set oa "<=";set ob "+"}
! 	    for {set x [expr int($_($target:${xy}a) / ($_($target:q${xy}v) + 0.0) + 1)*($_($target:q${xy}v) + 0.0)]} {[expr $x $oa $_($target:${xy}b)]} {set x [expr $x $ob $_($target:q${xy}v)]} {
  		set og [mat_tr $path $target $xy t $x]
  		set invgeo [winfo $igx($xy) $path.m]





More information about the Pd-cvs mailing list