[PD-cvs] pd/src desire.tk,1.1.2.600.2.261,1.1.2.600.2.262

chunlee chunlee at users.sourceforge.net
Wed Aug 1 20:50:07 CEST 2007


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
tweak for previous commit


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.261
retrieving revision 1.1.2.600.2.262
diff -C2 -d -r1.1.2.600.2.261 -r1.1.2.600.2.262
*** desire.tk	1 Aug 2007 17:49:10 -0000	1.1.2.600.2.261
--- desire.tk	1 Aug 2007 18:50:00 -0000	1.1.2.600.2.262
***************
*** 1995,2004 ****
  
  set obj_history {}
  def Canvas add_to_obj_history {obj} {
  	if {![[$obj class] <= ObjectBox]} {return}
  	set ::obj_history [linsert $::obj_history 0 [$obj text]]
! 	if {[llength $::obj_history] >= 5} {set ::obj_history [lrange $::obj_history 0 4]}
! 	puts "history:::::: $::obj_history"
! 	
  }
  
--- 1995,2004 ----
  
  set obj_history {}
+ set obj_history_num 5
  def Canvas add_to_obj_history {obj} {
+ 	set i $::obj_history_num
  	if {![[$obj class] <= ObjectBox]} {return}
  	set ::obj_history [linsert $::obj_history 0 [$obj text]]
! 	if {[llength $::obj_history] >= $i} {set ::obj_history [lrange $::obj_history 0 [expr $i-1]]}
  }
  
***************
*** 2275,2278 ****
--- 2275,2281 ----
  	set @tab_repeats 0
  	set @histi -1
+ 	set @hist $::obj_history
+ 	set @tmp_text {}
+ 	set @hist_on 0
  	# stores which line is the longest if multiple line
  	set @longline 1
***************
*** 2344,2347 ****
--- 2347,2351 ----
  	set t $c.${self}text
  	if {[[$self class] <= AtomBox]} {if {$@clear} {$t delete 1.0 1.end; set @clear 0}}
+ 	set @tmp_text [$t get 1.0 1.end]$key
  	switch -- $key {
  		Tab {
***************
*** 2361,2367 ****
  
  def TextBox scroll_history {incr} {
  	if {![llength $::obj_history]} {return}
  	set @histi [expr $@histi + $incr]
! 	set mod [expr ([llength $::obj_history]<5) ?[llength $::obj_history]:5]
  	if {$@histi >=$mod} {set @histi [expr $@histi%$mod]}
  	if {$@histi < 0} {set @histi [expr ($@histi+$mod)%$mod]}
--- 2365,2373 ----
  
  def TextBox scroll_history {incr} {
+ 	set i $::obj_history_num
  	if {![llength $::obj_history]} {return}
+ 	if {$@tmp_text != "" && !$@hist_on} {lappend @hist $@tmp_text; set @hist_on 1}
  	set @histi [expr $@histi + $incr]
! 	set mod [expr ([llength $@hist]<[expr $i+1]) ?[llength $@hist]:[expr $i+1]]
  	if {$@histi >=$mod} {set @histi [expr $@histi%$mod]}
  	if {$@histi < 0} {set @histi [expr ($@histi+$mod)%$mod]}
***************
*** 2369,2374 ****
  	set t $c.${self}text
  	$t delete 1.0 1.end
! 	set text [lindex $::obj_history $@histi]
! 	$t insert 1.0 [lindex $::obj_history $@histi]
  	$t configure -width [string length $text]
  	$self update_size
--- 2375,2380 ----
  	set t $c.${self}text
  	$t delete 1.0 1.end
! 	set text [lindex $@hist $@histi]
! 	$t insert 1.0 $text
  	$t configure -width [string length $text]
  	$self update_size
***************
*** 2489,2494 ****
  	set xya [$self bbox]
  	mset {x1 y1 x2 y2} $xya
- 	puts "width::::: [expr $x2-$x1]"
- 	puts "height::::: [expr $y2-$y1]"
  	#set xyb [l+ [list $x2 $y1 $x1 $y1 $x1 $y2] [list -1 +1 +1 +1 +1 -1]]
  	#set xyc [l+ [list $x2 $y1 $x2 $y2 $x1 $y2] [list -1 +1 -1 -1 +1 -1]]
--- 2495,2498 ----





More information about the Pd-cvs mailing list