[PD-cvs] pd/src desire.tk,1.1.2.517,1.1.2.518
chunlee
chunlee at users.sourceforge.net
Thu Oct 19 19:09:20 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29128
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
object insertion also work with drag while holding ctrl
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.517
retrieving revision 1.1.2.518
diff -C2 -d -r1.1.2.517 -r1.1.2.518
*** desire.tk 19 Oct 2006 12:01:49 -0000 1.1.2.517
--- desire.tk 19 Oct 2006 17:09:16 -0000 1.1.2.518
***************
*** 1574,1577 ****
--- 1574,1578 ----
$self bind <Motion> motion_wrap %x %y 0
$self bind <Alt-Motion> motion_wrap %x %y 4
+ $self bind <Control-Motion> motion_wrap %x %y 9
$self bind <Map> map
$self bind <Unmap> unmap
***************
*** 2311,2317 ****
switch $@action {
move {$self motion_move $oldpos $x $y; return}
! edit {$self motion_edit $x $y}
insert {}
chain_obj {}
none {}
default {$@action motion $x $y $f $target}
--- 2312,2319 ----
switch $@action {
move {$self motion_move $oldpos $x $y; return}
! edit {$self motion_edit $x $y $f}
insert {}
chain_obj {}
+ imove {$self motion_imove $oldpos $x $y; return}
none {}
default {$@action motion $x $y $f $target}
***************
*** 2332,2336 ****
}
! def Canvas motion_edit {x y} {
if {[distance [list $x $y] $@click_at] > 5} {
foreach obj $@selection {
--- 2334,2363 ----
}
! def Canvas motion_imove {oldpos x y} {
! mset {ox oy} $oldpos
! if {[llength $@selection] == 1} {set obj $@selection} else {return}
! if {[[$obj class] <= Box]} {
! [$self widget] raise $obj
! mset {type id detail} [$self identify_target $x $y 0]
! if {$type == "wire"} {
! #$self selection_wire= $id
! set wire2 [$self get_wire $id]
! mset {obj1 outlet obj2 inlet} [$id report]
! $self disconnect $wire2
! set obj1_idx [$self children_idx $obj1]
! set obj2_idx [$self children_idx $obj2]
! set obj3_idx [$self children_idx $obj]
! $self connect [list $obj1_idx $outlet $obj3_idx 0]
! $self connect [list $obj3_idx 0 $obj2_idx $inlet]
!
! }
! # puts " target:::: $target"
! $obj move [expr $x-$ox] [expr $y-$oy]
! } else {
! puts "Canvas motion warning: trying to move non-Box explicitly"
! }
! }
!
! def Canvas motion_edit {x y f} {
if {[distance [list $x $y] $@click_at] > 5} {
foreach obj $@selection {
***************
*** 2341,2345 ****
}
}
! set @action move
mset {ox oy} $@click_at
}
--- 2368,2372 ----
}
}
! if {$f == 9} {set @action imove} else {set @action move}
mset {ox oy} $@click_at
}
***************
*** 2398,2401 ****
--- 2425,2429 ----
foreach tag $stack {
set tags [$c gettags $tag]
+ # puts " tags::::: $tags"
if {[regexp {^[xo][0-9a-f]{6,8}} $tags id]} {
# prior to Aug 15th, Wires had lower priority as all objects together
***************
*** 2403,2408 ****
set class [$id class]
if {[$self == $id]} {continue}
! if {[$class <= Wire]} {return [list "wire" $id]}
if {[$class <= Box]} {
mset {x1 y1 x2 y2} [$id bbox]
set outs [$id noutlets]
--- 2431,2445 ----
set class [$id class]
if {[$self == $id]} {continue}
! if {[$class <= Wire]} {if {$@action != "imove"} {return [list "wire" $id]}}
if {[$class <= Box]} {
+ if {$@action == "imove"} {
+ foreach tag $stack {
+ set tags2 [$c gettags $tag]
+ if {[regexp {^[xo][0-9a-f]{6,8}} $tags2 id]} {
+ set class [$id class]
+ if {[$class <= Wire]} {return [list "wire" $id]}
+ }
+ }
+ }
mset {x1 y1 x2 y2} [$id bbox]
set outs [$id noutlets]
***************
*** 2842,2849 ****
$self selection+= $id; set @action edit
switch [expr $f&255] {
! 2 {$self auto_wire}
}
}
-
def Canvas click_on_wire {id f x y} {
set obj_selection [$self selection]
--- 2879,2885 ----
$self selection+= $id; set @action edit
switch [expr $f&255] {
! 2 {if {![llength [$id wires]]} {return}; $self auto_wire}
}
}
def Canvas click_on_wire {id f x y} {
set obj_selection [$self selection]
***************
*** 2887,2890 ****
--- 2923,2927 ----
insert {}
chain_obj {}
+ imove {}
default {$@action unclick $x $y $f $target}
}
***************
*** 2909,2912 ****
--- 2946,2950 ----
insert {}
chain_obj {}
+ imove {$self unclick_move}
default {$@action unclick $x $y $f $target}
}
***************
*** 3435,3438 ****
--- 3473,3478 ----
}
+ def Box wires {} {return $@wires}
+
def Box changed_wires {} {foreach wire $@wires {$wire changed}}
More information about the Pd-cvs
mailing list