Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18852
Modified Files: Tag: devel_0_39 desire.tk Log Message: more fixes to selection
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.341 retrieving revision 1.1.2.342 diff -C2 -d -r1.1.2.341 -r1.1.2.342 *** desire.tk 15 Aug 2006 15:49:59 -0000 1.1.2.341 --- desire.tk 15 Aug 2006 16:34:49 -0000 1.1.2.342 *************** *** 1234,1241 **** default {error "wrong number of arguments (expecting 5 or 6)"} } - $self init_window - $self editmode= 0 - $self new_menubar - $self new_binds set @scale 1.5 ;# must be a float, not int set @action none --- 1234,1237 ---- *************** *** 1252,1256 **** set @wires {} set @wires_pair {} ;# stores wires in the format of {0 1 1 0} id {1 1 2 0} id ! set @duplicating 0 #set @wire_hilite {} set @history $history --- 1248,1255 ---- set @wires {} set @wires_pair {} ;# stores wires in the format of {0 1 1 0} id {1 1 2 0} id ! $self init_window ! $self editmode= 0 ! $self new_menubar ! $self new_binds #set @wire_hilite {} set @history $history *************** *** 1863,1867 **** }
! def* Canvas motion_wrap {x y f} { set c .$self.c #if {$@crosshair} {$self show_crosshair [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale]} --- 1862,1866 ---- }
! def Canvas motion_wrap {x y f} { set c .$self.c #if {$@crosshair} {$self show_crosshair [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale]} *************** *** 1869,1885 **** $self motion [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $f } ! def* Canvas click_wrap {x y b f} { set c .$self.c $self click [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f] } ! def* Canvas unclick_wrap {x y b f} { set c .$self.c $self unclick [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f] } ! def* Canvas key_wrap {x y key iso shift} { set c .$self.c $self key [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $key $iso $shift } ! def* Canvas keyup_wrap {x y key iso shift} { set c .$self.c $self keyup [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $key $iso $shift --- 1868,1884 ---- $self motion [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $f } ! def Canvas click_wrap {x y b f} { set c .$self.c $self click [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f] } ! def Canvas unclick_wrap {x y b f} { set c .$self.c $self unclick [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f] } ! def Canvas key_wrap {x y key iso shift} { set c .$self.c $self key [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $key $iso $shift } ! def Canvas keyup_wrap {x y key iso shift} { set c .$self.c $self keyup [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $key $iso $shift *************** *** 2117,2121 ****
def Canvas deselect_all {} { ! foreach o $@selection {$o selected?= 0; puts "----------- deselecte $o"} foreach w $@selection_wire {$w selected?= 0} set @selection {} --- 2116,2120 ----
def Canvas deselect_all {} { ! foreach o $@selection {$o selected?= 0} foreach w $@selection_wire {$w selected?= 0} set @selection {} *************** *** 2202,2206 ****
class_new SelRect {View} ! def* SelRect init {canvas x y bf target} { super set @x1 $x --- 2201,2205 ----
class_new SelRect {View} ! def SelRect init {canvas x y bf target} { super set @x1 $x *************** *** 2209,2218 **** $self motion $x $y 0 $target } ! def* SelRect motion {x y f target} { set @x2 $x set @y2 $y $self draw } ! def* SelRect unclick {x y bf target} { $self motion $x $y 0 $target set sel {} --- 2208,2217 ---- $self motion $x $y 0 $target } ! def SelRect motion {x y f target} { set @x2 $x set @y2 $y $self draw } ! def SelRect unclick {x y bf target} { $self motion $x $y 0 $target set sel {} *************** *** 2227,2230 **** --- 2226,2230 ---- foreach tag $sel { if {[regexp {^[xz]?[0-9a-f]{6,8}} [$c gettags $tag] id]} { + if {$@canvas == $id} {continue} switch $_($id:_class) { SelRect {} *************** *** 2242,2246 **** $@canvas end_action } ! def* SelRect draw {} { $self item RECT line [list $@x1 $@y1 $@x2 $@y1 $@x2 $@y2 $@x1 $@y2 $@x1 $@y1] \ -fill black -dash {3 3 3 3} -dashoffset 3 -fill [look selrect] --- 2242,2246 ---- $@canvas end_action } ! def SelRect draw {} { $self item RECT line [list $@x1 $@y1 $@x2 $@y1 $@x2 $@y2 $@x1 $@y2 $@x1 $@y1] \ -fill black -dash {3 3 3 3} -dashoffset 3 -fill [look selrect] *************** *** 2610,2614 **** def* Canvas selection_move {dx dy} { foreach item $@selection { - puts "moving: [$item _inspect]" mset {x1 y1 x2 y2} [$item bbox] pd .$self object_moveto !$item [expr $x1+$dx] [expr $y1+$dy] --- 2610,2613 ---- *************** *** 4293,4297 **** pack [entry $bb.name -font {courier 10} -width 10 -border 0] -side right pack [spinbox $bb.scale -width 6 -command "$canvas zoom %d" -state readonly] -side right ! $bb.scale set "100%" $bb.name insert 0 .$@canvas } --- 4292,4296 ---- pack [entry $bb.name -font {courier 10} -width 10 -border 0] -side right pack [spinbox $bb.scale -width 6 -command "$canvas zoom %d" -state readonly] -side right ! $bb.scale set [format %d%% [expr int(100*[$@canvas scale])]] $bb.name insert 0 .$@canvas }