Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12517
Modified Files: Tag: devel_0_39 desire.tk Log Message: moving $@selection with arrow keys worx, and start to fix some bugs for copy/paste
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.221 retrieving revision 1.1.2.222 diff -C2 -d -r1.1.2.221 -r1.1.2.222 *** desire.tk 4 Jun 2006 23:45:45 -0000 1.1.2.221 --- desire.tk 10 Jun 2006 19:13:50 -0000 1.1.2.222 *************** *** 405,409 **** set key(font_bomb) "" set key(tidy_up) "" ! set key(reload) "" set key(redraw) "" set key(crosshair) "" --- 405,409 ---- set key(font_bomb) "" set key(tidy_up) "" ! set key(reload) "Ctrl+r" set key(redraw) "" set key(crosshair) "" *************** *** 1125,1129 **** super global pd_opendir pd_tearoff OS cmdline look canvas ! set canvas(current) $self set name .$self set c .$self.c --- 1125,1129 ---- super global pd_opendir pd_tearoff OS cmdline look canvas ! set 5 $self set name .$self set c .$self.c *************** *** 1508,1512 **** $widget configure -state normal set @text [$widget get 1.0 1.end] - puts "text received after_key ----------------- $@text" #set l {} #foreach char [split $@text ""] {lappend l [scan $char %c]} --- 1508,1511 ---- *************** *** 1766,1770 **** .$@canvas.c move $self [expr $u-$x] [expr $v-$y] } ! def Canvas motion {x y mods state} { global font canvas --- 1765,1769 ---- .$@canvas.c move $self [expr $u-$x] [expr $v-$y] } ! def Canvas motion {x y mods state} { global font canvas *************** *** 1996,1999 **** --- 1995,2008 ----
def* Canvas paste {} { + set windowx [winfo width .$self.c] + set windowy [winfo height .$self.c] + mset {x1off x2off } [lindex [.$self.c xview]] + mset {y1off y2off } [lindex [.$self.c yview]] + set offx [expr ($windowx * $x1off) / [expr $x2off - $x1off]] + set offy [expr ($windowy * $y1off) / [expr $y2off - $y1off]] + puts "window size:: $windowx $windowy" + puts "canvas size:: [.$self.c cget -width] [.$self.c cget -height]" + puts "canvas view:: [.$self.c xview] [.$self.c yview]" + puts "canvas 0ff:: $offx $offy" global canvas _ set @selection "" *************** *** 2001,2004 **** --- 2010,2016 ---- foreach item $canvas(copy_obj) { mset {x1 y1} [$item xy] + puts "$item ::: $x1 $y1" + if {$x1 < $offx | $x1 > [expr $offx+$windowx]} {set x1 [expr $x1 + $offx]} + if {$y1 < $offx | $y1 > [expr $offx+$windowy]} {set y1 [expr $y1 + $offy]} if {$_($item:_class) == "Objectbox"} { set name $_($item:text) } else { *************** *** 2285,2289 **** #-----------------------------------------------------------------------------------#
! def Canvas key {x y key iso shift} { global OS _ set c .$self.c --- 2297,2301 ---- #-----------------------------------------------------------------------------------#
! def* Canvas key {x y key iso shift} { global OS _ set c .$self.c *************** *** 2325,2332 **** }
! #if {[string length $@focus] > 0} { ! # if {$@editmode} {set event keyedit} {set event key} ! # $@focus $event $self $key $shift ! #} }
--- 2337,2381 ---- }
! switch $key { ! Up { ! if {$@selection != ""} { ! foreach item $@selection { ! mset {x1 y1 x2 y2} [$item bbox] ! pd .$self object_moveto !$item $x1 [expr $y1 - 1] ! $item draw_wires ! } ! } ! } ! Down { ! if {$@selection != ""} { ! foreach item $@selection { ! mset {x1 y1 x2 y2} [$item bbox] ! pd .$self object_moveto !$item $x1 [expr $y1 + 1] ! $item draw_wires ! } ! } ! } ! Left { ! if {$@selection != ""} { ! foreach item $@selection { ! mset {x1 y1 x2 y2} [$item bbox] ! pd .$self object_moveto !$item [expr $x1-1] $y1 ! $item draw_wires ! } ! } ! } ! Right { ! if {$@selection != ""} { ! foreach item $@selection { ! mset {x1 y1 x2 y2} [$item bbox] ! pd .$self object_moveto !$item [expr $x1+1] $y1 ! $item draw_wires ! } ! } ! } ! default {} ! } ! ! }
*************** *** 2361,2365 **** }
! def* Box draw_wires {} { puts "wires:$@wires" foreach wire $@wires {$wire draw} --- 2410,2414 ---- }
! def Box draw_wires {} { puts "wires:$@wires" foreach wire $@wires {$wire draw} *************** *** 4543,4550 **** set accels [dict remove $accels $old_key] dict set accels $new_key $cmd } } ! if {[dict exists $check_key $new_key]} { ! error "$new_key already assigned" } else {dict set check_key $new_key key($item)} set key($item) $new_key puts $fd "$type $item $new_key" --- 4592,4602 ---- set accels [dict remove $accels $old_key] dict set accels $new_key $cmd + puts "$new_key ::: $cmd" } } ! if {[dict exists $check_key $new_key] && $new_key != ""} { ! error "$new_key already assigned" ! #dict set check_key $new_key key($item) ! } else {dict set check_key $new_key key($item)} set key($item) $new_key puts $fd "$type $item $new_key"