Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17849
Modified Files: Tag: desiredata desire.tk Log Message: adding pointer_sense to change the sensitivity of mouse pointer in inlet/outlet hilite, together with simple visual indicator
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.182 retrieving revision 1.1.2.600.2.183 diff -C2 -d -r1.1.2.600.2.182 -r1.1.2.600.2.183 *** desire.tk 10 May 2007 01:42:27 -0000 1.1.2.600.2.182 --- desire.tk 11 May 2007 00:51:01 -0000 1.1.2.600.2.183 *************** *** 1539,1542 **** --- 1539,1543 ---- set @motion_watch 0 set @iohilite {} + set @pointer_sense 50 }
*************** *** 1679,1682 **** --- 1680,1684 ---- set @crosshair [Crosshair new $self] set @active [Active new $self] + set @sense [Sense new $self] }
*************** *** 2939,2944 **** set cx [expr $x*$@zoom] set cy [expr $y*$@zoom] ! set offset 50 ! set stack [$c find overlapping [expr $cx-$offset] [expr $cy-$offset] [expr $cx+$offset] [expr $cy+$offset]] set stack [lreverse $stack] set objs {} --- 2941,2947 ---- set cx [expr $x*$@zoom] set cy [expr $y*$@zoom] ! #set offset 50 ! set stack [$c find overlapping [expr $cx-$@pointer_sense] [expr $cy-$@pointer_sense] \ ! [expr $cx+$@pointer_sense] [expr $cy+$@pointer_sense]] set stack [lreverse $stack] set objs {} *************** *** 2948,2952 **** set class [$id class] switch $class { ! Wire {} Crosshair {} Tooltip {} Comment {} SelRect {} FutureWire {} default {lappend objs $id} } --- 2951,2955 ---- set class [$id class] switch $class { ! Wire {} Crosshair {} Tooltip {} Comment {} SelRect {} FutureWire {} Sense {} default {lappend objs $id} } *************** *** 2968,2971 **** --- 2971,2982 ---- }
+ def Canvas pointer_sense {sense} { + set @pointer_sense $sense + mset {x y} $@curpos + $@sense data= $x $y $@pointer_sense + $@sense draw + after 500 $@sense erase + puts "sense is now $@pointer_sense :: $@curpos" + }
#-----------------------------------------------------------------------------------# *************** *** 6357,6360 **** --- 6368,6392 ----
#def Crosshair erase {} {$self item_delete VHAIR1; $self item_delete HHAIR1} + class_new Sense {View} + + def Sense init {canvas} { + super + set @canvas $canvas + $self data= 0 0 0 + } + + def Sense data= {x y range} { + set @x $x + set @y $y + set @range $range + } + + def Sense draw {} { + set c [$@canvas widget] + set x1 [expr $@x-$@range]; set y1 [expr $@y-$@range] + set x2 [expr $@x+$@range]; set y2 [expr $@y+$@range] + $self item SENSE oval [list $x1 $y1 $x2 $y2] -fill red -outline yellow + } +
############ tooltips (only those that are drawn as canvas items)