Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17183
Modified Files: Tag: devel_0_39 desire.tk Log Message: crosshair has arrvied.....
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.339 retrieving revision 1.1.2.340 diff -C2 -d -r1.1.2.339 -r1.1.2.340 *** desire.tk 15 Aug 2006 03:21:53 -0000 1.1.2.339 --- desire.tk 15 Aug 2006 14:59:57 -0000 1.1.2.340 *************** *** 1202,1207 **** $self changed ;#$self draw } ! def Canvas editmodeswitch {args} { set @editmode [expr !$@editmode] pd .$self editmode $@editmode } --- 1202,1208 ---- $self changed ;#$self draw } ! def* Canvas editmodeswitch {args} { set @editmode [expr !$@editmode] + if {$@crosshair && !$@editmode} {$self hide_crosshair} pd .$self editmode $@editmode } *************** *** 1272,1275 **** --- 1273,1277 ---- set @shift_wires {} set @keynav_tab_sel "wire" + set @crosshair 1 }
*************** *** 1858,1869 **** def* Canvas motion {x y f} { set c .$self.c ! $self motion2 [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $f }
#!@#$ this method is too long ! def Canvas motion2 {x y f} { global font canvas tooltip set canvas(current) $self set c .$self.c if {$tooltip(visible)} { if {[expr [distance $tooltip(curpos) [list $x $y]] > 10]} { --- 1860,1874 ---- def* Canvas motion {x y f} { set c .$self.c ! #if {$@crosshair} {$self show_crosshair [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale]} ! #if {$@crosshair} {$self show_crosshair $x $y} ! $self motion2 [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $f }
#!@#$ this method is too long ! def* Canvas motion2 {x y f} { global font canvas tooltip set canvas(current) $self set c .$self.c + if {$@crosshair && $@editmode} {$self show_crosshair $x $y} if {$tooltip(visible)} { if {[expr [distance $tooltip(curpos) [list $x $y]] > 10]} { *************** *** 4291,4294 **** --- 4296,4323 ---- pd $c obj 0 } + ############ crosshair + + def* Canvas show_crosshair {x y} { + set width [expr [winfo width .$self.c] * (1/$@scale)] + set height [expr [winfo height .$self.c] * (1/$@scale)] + set off [expr 7 * (1/$@scale)] + puts " off ::: $off" + set v1 [list $x 0 $x [expr $y - $off]] + set h1 [list 0 $y [expr $x - $off] $y] + set v2 [list $x [expr $y + $off] $x $height] + set h2 [list [expr $x + $off] $y $width $y] + set eye [list [expr $x - $off] [expr $y - $off] [expr $x + $off] [expr $y + $off]] + #puts "vertical ::: $vertical" + puts "eye ::: $eye" + $self item VHAIR1 line $v1 -fill [look objectfg] -width 0.5 -dash {4 4 4 4} + $self item HHAIR1 line $h1 -fill [look objectfg] -width 0.5 -dash {4 4 4 4} + $self item VHAIR2 line $v2 -fill [look objectfg] -width 0.5 -dash {4 4 4 4} + $self item HHAIR2 line $h2 -fill [look objectfg] -width 0.5 -dash {4 4 4 4} + $self item EYE oval $eye -dash {4 4 4 4} -outline [look selrect] + } + + def* Canvas hide_crosshair {} { + .$self.c delete ${self}VHAIR1 ${self}HHAIR1 ${self}VHAIR2 ${self}HHAIR2 ${self}EYE + }
############ tooltips