[PD-cvs] pd/src desire.tk,1.1.2.600.2.366,1.1.2.600.2.367

chunlee chunlee at users.sourceforge.net
Tue Aug 14 09:28:16 CEST 2007


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
various fixes


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.366
retrieving revision 1.1.2.600.2.367
diff -C2 -d -r1.1.2.600.2.366 -r1.1.2.600.2.367
*** desire.tk	14 Aug 2007 05:12:33 -0000	1.1.2.600.2.366
--- desire.tk	14 Aug 2007 07:28:12 -0000	1.1.2.600.2.367
***************
*** 1882,1886 ****
  	set xw $win.xscroll; set yw $win.yscroll
  	$c configure -yscrollcommand "$self scroll_set $yw" -xscrollcommand "$self scroll_set $xw"
! 	$self adjust_scrollbars
  }
  
--- 1882,1886 ----
  	set xw $win.xscroll; set yw $win.yscroll
  	$c configure -yscrollcommand "$self scroll_set $yw" -xscrollcommand "$self scroll_set $xw"
! 	after 0 [list $self adjust_scrollbars]
  }
  
***************
*** 1902,1943 ****
  		mset {xmin ymin xmax ymax} {0 0 100 100}
  		mset {x1 y1 x2 y2} $size
- 		#if {$x1 < 0} {set xmin $x1}
  		if {$x2 > 100} {set xmax $x2}
- 		#if {$y1 < 0} {set ymin $y1}
  		if {$y2 > 100} {set ymax $y2}
  		set bbox [list $xmin $ymin $xmax $ymax]
! 		if {$@bbox != $bbox} {
! 			$c configure -scrollregion $bbox
! 			#$c configure -scrollregion $size
! 			set @bbox $bbox
! 		}
! 	}
! }
! 
! def Canvas get_foo {} {
! 	set c [$self widget]
! 	set foo {}
! 	foreach item [$c find withtag foo] {
! 		lappend foo [$c gettags $item]
  	}
- 	puts "foo::: $foo"
  }
  
  def Canvas auto_scrollbars {} {
- 	set win .$self
  	set c [$self widget]
! 	mset {l r} [$c xview]
! 	mset {t b} [$c yview]
! 	mset {w h} [$c bbox foo]
! 	set w2 [winfo width $c]
! 	set h2 [winfo height $c]
! 	if {[winfo exists $win.yscroll]} {
! 		if {$l == $r && $t == $b} {$self remove_scrollbars; return}
! 		if {$l == 0 && $r == 1 && $t == 0 && $b == 1} {$self remove_scrollbars; return}
! 	} else {
! 		if {[$c bbox foo] != ""} {
! 			if {$w > $w2 || $h > $h2} {$self init_scrollbars}
! 		}
  	}
  }
  
--- 1902,1926 ----
  		mset {xmin ymin xmax ymax} {0 0 100 100}
  		mset {x1 y1 x2 y2} $size
  		if {$x2 > 100} {set xmax $x2}
  		if {$y2 > 100} {set ymax $y2}
  		set bbox [list $xmin $ymin $xmax $ymax]
! 		$c configure -scrollregion $bbox
! 		set @bbox $bbox
  	}
  }
  
  def Canvas auto_scrollbars {} {
  	set c [$self widget]
! 	puts ">>> [$c bbox foo]"
! 	if {[$c bbox foo] != ""} {
! 		mset {cx1 cy1 cx2 cy2} [$c bbox foo]
! 	}  else {
! 		set cx2 [lindex $@canvas_size 0]; set cy2 [lindex $@canvas_size 1]
  	}
+ 	set x2 [$c canvasx [winfo width $c]]
+ 	set y2 [$c canvasy [winfo height $c]]
+ 	if {$x2 == 1} {set x2 $cx2; set y2 $cy2}
+ 	puts "cx $cx2 cy $cy2 x2 $x2 y2 $y2"
+ 	if {$cx2 <= $x2 && $cy2 <= $y2} {$self remove_scrollbars} {$self init_scrollbars}
  }
  
***************
*** 2075,2078 ****
--- 2058,2067 ----
  }
  
+ def Canvas obj {x y} {
+ 	set c [$self widget]
+ 	set @curpos [list [$c canvasx $x] [$c canvasy $y]]
+ 	$self new_object obj
+ }
+ 
  def Canvas new_object {sel args} {
  	$self editmode= 1
***************
*** 2949,2962 ****
  }
  
- def Canvas altkey {x y key iso shift} {
-     switch $key {
- 	Up    { $self quadrant +1 -1; return }
- 	Down  { $self quadrant -1 +1; return }
- 	Left  { $self quadrant +1 +1; return }
- 	Right { $self quadrant -1 -1; return }
-     }
-     super $x $y $key $iso $shift
- }
- 
  proc lsearch_minimum {l} {
  	set i 0
--- 2938,2941 ----
***************
*** 4446,4450 ****
  
  def Canvas key_nav {du dv shift} {
! 	if {$@keynav_shift && !$shift} {puts "keynav_shift but not shift"}
  	set @keynav_shift $shift
  	if {[$@objectsel size] > 1} {
--- 4425,4429 ----
  
  def Canvas key_nav {du dv shift} {
! 	if {$@keynav_shift && !$shift} {}
  	set @keynav_shift $shift
  	if {[$@objectsel size] > 1} {
***************
*** 4489,4493 ****
  def Canvas key_nav_ioselect {} {
  	if {![$@objectsel size]} {return}
! 	set var [lindex $@selection end]
  	if {$@keynav_iosel != $var} {set @keynav_iocount 0}
  	if {$@keynav_port != 0 && $@keynav_iosel == $var} {
--- 4468,4472 ----
  def Canvas key_nav_ioselect {} {
  	if {![$@objectsel size]} {return}
! 	set var [lindex [$@objectsel values] end]
  	if {$@keynav_iosel != $var} {set @keynav_iocount 0}
  	if {$@keynav_port != 0 && $@keynav_iosel == $var} {
***************
*** 4498,4504 ****
  	set ins  [$obj ninlets]
  	set outs [$obj noutlets]
! 	set ports {}
! 	set ports2 {}
! 	set ports3 {}
  	for {set i 0} {$i < $ins}  {incr i} {lappend ports ${obj}i${i}; lappend ports2 "i"; lappend ports3 $i}
  	for {set i 0} {$i < $outs} {incr i} {lappend ports ${obj}o${i}; lappend ports2 "o"; lappend ports3 $i}
--- 4477,4481 ----
  	set ins  [$obj ninlets]
  	set outs [$obj noutlets]
! 	set ports {}; set ports2 {}; set ports3 {}
  	for {set i 0} {$i < $ins}  {incr i} {lappend ports ${obj}i${i}; lappend ports2 "i"; lappend ports3 $i}
  	for {set i 0} {$i < $outs} {incr i} {lappend ports ${obj}o${i}; lappend ports2 "o"; lappend ports3 $i}
***************
*** 4514,4532 ****
  	# @keynav_iosel_o stores the selected outlets
  	foreach object [$@objectsel values] {
! 		if {$@keynav_iosel != $var} {set @keynav_iosel $var} else {
! 			switch $type {
! 				i {
! 					if {[lsearch $@keynav_iosel_i $object] == -1} {
! 						lappend @keynav_iosel_i $object
! 						set find [lsearch $@keynav_iosel_o $object]
! 						if {$find >= 0} {set @keynav_iosel_o [lreplace $@keynav_iosel_o $find $find]}
! 					}
  				}
! 				o {
! 					if {[lsearch $@keynav_iosel_o $object] == -1} {
! 						lappend @keynav_iosel_o $object
! 						set find [lsearch $@keynav_iosel_i $object]
! 						if {$find >= 0} {set @keynav_iosel_i [lreplace $@keynav_iosel_i $find $find]}
! 					}
  				}
  			}
--- 4491,4508 ----
  	# @keynav_iosel_o stores the selected outlets
  	foreach object [$@objectsel values] {
! 		if {$@keynav_iosel != $var} {set @keynav_iosel $var}
! 		switch $type {
! 			i {
! 				if {[lsearch $@keynav_iosel_i $object] == -1} {
! 					lappend @keynav_iosel_i $object
! 					set find [lsearch $@keynav_iosel_o $object]
! 					if {$find >= 0} {set @keynav_iosel_o [lreplace $@keynav_iosel_o $find $find]}
  				}
! 			}
! 			o {
! 				if {[lsearch $@keynav_iosel_o $object] == -1} {
! 					lappend @keynav_iosel_o $object
! 					set find [lsearch $@keynav_iosel_i $object]
! 					if {$find >= 0} {set @keynav_iosel_i [lreplace $@keynav_iosel_i $find $find]}
  				}
  			}
***************
*** 4539,4542 ****
--- 4515,4519 ----
  	}
  	incr @keynav_iocount
+ 	
  }
  
***************
*** 4700,4703 ****
--- 4677,4681 ----
  def Canvas return_key {x y key iso f} {
  	mset {type id detail} [$self identify_target $x $y $f]
+ 	puts "i:: $@keynav_iosel_i   o:: $@keynav_iosel_o"
  	if {![llength $@keynav_iosel_i] && ![llength $@keynav_iosel_o]} {
  		if {[$@objectsel size] == 1} {





More information about the Pd-cvs mailing list