Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18770
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
fixs in copy/paste and the Menuable getkey
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.433
retrieving revision 1.1.2.434
diff -C2 -d -r1.1.2.433 -r1.1.2.434
*** desire.tk 31 Aug 2006 12:19:03 -0000 1.1.2.433
--- desire.tk 31 Aug 2006 17:00:03 -0000 1.1.2.434
***************
*** 868,873 ****
global accels
if {[dict exists $accels $k]} {
! mset {class key} [split [dict get $accels $k] ":"]
! if {$class != $@_class} {return ""} else {return $key}
}
}
--- 868,878 ----
global accels
if {[dict exists $accels $k]} {
! set vars [dict get $accels $k]
! foreach var $vars {
! #mset {class key} [split [dict get $accels $k] ":"]
! mset {class key} [split $var ":"]
! #if {$class != $@_class} {return ""} else {return $key}
! if {$class == $@_class} {return $key}
! }
}
}
***************
*** 878,881 ****
--- 883,887 ----
#set key "Ctrl+$key"
set key [$self getkey "Ctrl+$key"]
+ puts "*** key::: $key"
if {[string length $key]} {
$self eval% "%W $key"
***************
*** 937,941 ****
}
}
! foreach k [array names key] {dict set accels $key($k) $k}
set_fontstring
}
--- 943,955 ----
}
}
! foreach k [array names key] {
! if {[llength $key($k)]} {
! if {![dict exists $accels $key($k)]} {
! dict set accels $key($k) $k
! } else {
! dict lappend accels $key($k) $k
! }
! }
! }
set_fontstring
}
***************
*** 964,968 ****
read_ddrc [file join [file dirname $argh0] "../lib/pd/bin/defaults.ddrc"]
}
- read_ddrc
#-----------------------------------------------------------------------------------#
set pd_apilist "{ALSA 1}"
--- 978,981 ----
***************
*** 1061,1064 ****
--- 1074,1078 ----
}
+
def View item_delete {{suffix all}} {
switch -- $suffix {
***************
*** 1280,1283 ****
--- 1294,1298 ----
set @keynav_last 0
set @keynav_tab_sel "wire"
+ set @copy_count 0
}
***************
*** 2104,2107 ****
--- 2119,2125 ----
}
+ def Canvas copy_times= {c} {set @copy_count $c}
+ def Canvas copy_times {} {return $@copy_count}
+
def Canvas copy {} {
global clipboard obj_index_sel
***************
*** 2109,2113 ****
#$clipboard value= [$self deconstruct]
$clipboard value= ""
! $clipboard copy_times= 0
array unset obj_index_sel $self:*
foreach child $@selection {
--- 2127,2131 ----
#$clipboard value= [$self deconstruct]
$clipboard value= ""
! $self copy_times= 1
array unset obj_index_sel $self:*
foreach child $@selection {
***************
*** 2124,2131 ****
}
- # todo: reimplement copy-count with 15px offset
def Canvas paste {} {
global clipboard
set n [llength $@children] ;# is a racecondition
foreach line [split [$clipboard value] ";"] {
if {[llength $line] == 0} {continue}
--- 2142,2156 ----
}
def Canvas paste {} {
global clipboard
+ #$self copy_times= [expr [$self copy_times] + 1]
+ $self do_paste [expr [$self copy_times] * 15]
+ $self copy_times= [expr [$self copy_times] + 1]
+ }
+
+ def Canvas do_paste {offset} {
+ global clipboard
set n [llength $@children] ;# is a racecondition
+ set m [llength $@wires] ;#let's race!!
foreach line [split [$clipboard value] ";"] {
if {[llength $line] == 0} {continue}
***************
*** 2139,2143 ****
pd .$@canvas connect [expr $n+$from] $outlet [expr $n+$to] $inlet
}
! default {eval [concat [list pd .$self] [lrange $line 1 end]]}
}
--- 2164,2173 ----
pd .$@canvas connect [expr $n+$from] $outlet [expr $n+$to] $inlet
}
! default {
! set line2 [lrange $line 1 end]
! mset {x y} [lrange $line2 1 2]
! set line2 [lreplace $line2 1 2 [expr $x+$offset] [expr $y+$offset]]
! eval [concat [list pd .$self] $line2]
! }
}
***************
*** 2147,2154 ****
}
#after 1 "$self paste2 $n"
! after 300 "$self paste2 $n" ;# racecondition
}
# part two
! def Canvas paste2 {n} {$self selection= [lrange [$self children] $n end]}
def Canvas cut {} {
--- 2177,2187 ----
}
#after 1 "$self paste2 $n"
! after 300 "$self do_paste2 $n $m" ;# racecondition
}
# part two
! def Canvas do_paste2 {n m} {
! $self selection= [lrange [$self children] $n end]
! $self selection_wire= [lrange [$self wires] $m end]
! }
def Canvas cut {} {
***************
*** 2164,2168 ****
set clipboard [Clipboard2 new]
$self copy
! $self paste
$clipboard delete
set clipboard $backup
--- 2197,2201 ----
set clipboard [Clipboard2 new]
$self copy
! $self do_paste 15
$clipboard delete
set clipboard $backup
***************
*** 2999,3003 ****
if {$arrowsize < 5} {set arrow none} {set arrow last}
set arrowshape [list $arrowsize [expr $arrowsize*4/5] [expr $arrowsize/3]]
! if {[$self selected?]} {set wire_color [$self look fg2]} else {
if {[info exists _($@obj1:text)] && [info exists _($@obj2:text)]} {
if {[regexp -nocase {~$} [lindex $_($@obj1:text) 0]] && \
--- 3032,3036 ----
if {$arrowsize < 5} {set arrow none} {set arrow last}
set arrowshape [list $arrowsize [expr $arrowsize*4/5] [expr $arrowsize/3]]
! if {[$self selected?]} {set wire_color [$self look fg2];set wire_width [$self look thick]} else {
if {[info exists _($@obj1:text)] && [info exists _($@obj2:text)]} {
if {[regexp -nocase {~$} [lindex $_($@obj1:text) 0]] && \