[PD-cvs] pd/src desire.tk,1.1.2.600.2.202,1.1.2.600.2.203

chunlee chunlee at users.sourceforge.net
Fri Jul 6 12:43:37 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25724

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
fix canvas rightclick, removed a few unused defs


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.202
retrieving revision 1.1.2.600.2.203
diff -C2 -d -r1.1.2.600.2.202 -r1.1.2.600.2.203
*** desire.tk	5 Jul 2007 02:08:48 -0000	1.1.2.600.2.202
--- desire.tk	6 Jul 2007 10:43:31 -0000	1.1.2.600.2.203
***************
*** 1562,1566 ****
      set @cmd_hist {}
      set @cmd_histi 0
-     set @motion_watch 0
      set @iohilite {-1 0 0 0 0}
      set @pointer_sense 30
--- 1562,1565 ----
***************
*** 2724,2743 ****
  }
  
- def Canvas motion_watch {} {
- 	if {$@oldpos != $@curpos2} {
- 		after 100 $self motion_watch
- 		if {$@anchorx != [lindex $@curpos2 0] && $@anchory != [lindex $@curpos2 1]} {
- 			$@approx data= $@anchorx $@anchory [lindex $@curpos2 0] [lindex $@curpos2 1]
- 			$@approx draw
- 			puts "approx::: $@approx"
- 		}
- 		puts "watching.... from $@anchorx , $@anchory"
- 	} else {
- 		puts "end watching"
- 		set @motion_watch 0
- 	}
- 	set @oldpos $@curpos2
- }
- 
  def Canvas motion_move {oldpos x y} {
  	mset {ox oy} $oldpos
--- 2723,2726 ----
***************
*** 3943,3947 ****
  	set @click_at [list $x $y]
  	if {$f&8} {if {$id == ""} {set id $self}; $self right_click $id $x $y; return}
! 	if {!$@editmode} {$self run_click $id $x $y $f $target; return}
  	set in_selection [expr [lsearch $@selection $id]>=0]
  	switch $type {
--- 3926,3930 ----
  	set @click_at [list $x $y]
  	if {$f&8} {if {$id == ""} {set id $self}; $self right_click $id $x $y; return}
! 	if {!$@editmode} {$self click_runmode $id $x $y $f $target; return}
  	set in_selection [expr [lsearch $@selection $id]>=0]
  	switch $type {
***************
*** 3975,3979 ****
  }
  
! def Canvas run_click {id x y f target} {
  	if {[llength $id]} {
  		if {[$id class] != "Canvas"} {
--- 3958,3962 ----
  }
  
! def Canvas click_runmode {id x y f target} {
  	if {[llength $id]} {
  		if {[$id class] != "Canvas"} {
***************
*** 4061,4065 ****
  
  def Canvas right_click {id x y} {
- 	if {!$@editmode} return
  	set c [$self widget]
  	set @insert_x $x; set @insert_y $y
--- 4044,4047 ----
***************
*** 4267,4315 ****
  }
  
- def Canvas find_neighbor_obj {object direction} {
- 	set group ""
- 	set distances ""
- 	set find [lsearch $@children $object]
- 	set all [lreplace $@children $find $find]
- 	set x1 $_($object:x1); set xs $_($object:xs)
- 	set y1 $_($object:y1); set ys $_($object:ys)
- 	set off 0
- 	set max 100
- 	while {![llength $group]} {
- 	  set left  [expr $x1 - $xs*$off]; set right  [expr $x1 + $xs + $xs*$off]
- 	  set top   [expr $y1 - $ys*$off]; set bottom [expr $y1 + $ys + $ys*$off]
- 	  foreach item $all {
- 	    mset {ix1 iy1 ix2 iy2} [$item bbox]
- 	    set add 0
- 	    switch $direction {
- 	      up    {if {$iy1 < $y1} {set add [overlap $ix1 $ix2 $left $right]}}
- 	      down  {if {$iy1 > $y1} {set add [overlap $ix1 $ix2 $left $right]}}
- 	      left  {if {$ix1 < $x1} {set add [overlap $iy1 $iy2 $top $bottom]}}
- 	      right {if {$ix1 > $x1} {set add [overlap $iy1 $iy2 $top $bottom]}}
- 	    }
- 	    if {$add} {
- 	      lappend group $item
- 	      lappend distances [switch -regexp $direction {
- 		up|down    {expr abs($iy1-$y1)}
- 		left|right {expr abs($ix1-$x1)}
- 	      }]
- 	    }
- 	  }
- 	  incr off
- 	  if {$off == $max} {break}
- 	}
- 	if {[llength $group] > 0} {
- 		set closest [lindex $distances 0]
- 		for {set i 1} {$i<[llength $distances]} {incr i} {
- 			set val [lindex $distances $i]
- 			if {$val < $closest} {set closest [lindex $distances $i]}
- 		}
- 		set index [lsearch $distances $closest]
- 		return [lindex $group $index]
- 	} else {
- 		return [lindex $@selection end end]
- 	}
- }
- 
  def Canvas key_nav_ioselect {} {
  	if {![llength $@selection]} {return}
--- 4249,4252 ----
***************
*** 4777,4793 ****
  }
  
- def Box clickedit {x y butt key in_selection selection} {
-     if {($key&1) && $selection>0} {puts "add $self to selection...."}
-     #if clicked obj is part of the $@selection, than....
-     if {$in_selection && [llength $_($@canvas:selection)]>1} {
-        foreach obj $_($@canvas:selection) {mset {x y} [$obj xy];$obj set_orig_xy $x $y}
-        set _($@canvas:action) move
-     } {
-        $@canvas deselect_all
-        set _($@canvas:selection) $self
-        set _($@canvas:action) edit
-     }
- }
- 
  def Box draw_io2 {which n color} {
  	for {set i 0} {$i<$n} {incr i} {
--- 4714,4717 ----





More information about the Pd-cvs mailing list