[PD-cvs] pd/src desire.tk,1.1.2.600.2.329,1.1.2.600.2.330

chunlee chunlee at users.sourceforge.net
Thu Aug 9 07:32:16 CEST 2007


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

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


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.329
retrieving revision 1.1.2.600.2.330
diff -C2 -d -r1.1.2.600.2.329 -r1.1.2.600.2.330
*** desire.tk	9 Aug 2007 03:21:33 -0000	1.1.2.600.2.329
--- desire.tk	9 Aug 2007 05:32:11 -0000	1.1.2.600.2.330
***************
*** 2514,2517 ****
--- 2514,2518 ----
  	# stores which line is the longest if multiple line
  	set @longline 1
+ 	set @max_width 40
  	set @selected? 1
  	$c delete ${self}TEXT
***************
*** 2536,2542 ****
  		set fg [$self look fg]
  	}
  	text $t -height $nl -width $width -relief flat -bg [$self look bgedit] -borderwidth 0 \
! 		-highlightthickness 0 -font $font_str -fg $fg -insertbackground $insertbg
! 	bind $t <Key>            "$self key_input %W %x %y %K %A 0; after 0 \[$self resize %K\]"
  	bind $t <Control-Return> "$self key_input %W %x %y 10 %A 0"
  	bind $t <Control-v>      "$self paste_resize"
--- 2537,2546 ----
  		set fg [$self look fg]
  	}
+ 	if {$width > $@max_width} {set width $@max_width}
+ 	if {$width == 0} {set width $@max_width}
  	text $t -height $nl -width $width -relief flat -bg [$self look bgedit] -borderwidth 0 \
! 		-highlightthickness 0 -font $font_str -fg $fg -insertbackground $insertbg -wrap word
! 	#bind $t <Key>            "$self key_input %W %x %y %K %A 0; after 1 \[$self resize %K\]"
! 	bind $t <Key>            "$self key_input %W %x %y %K %A 0"
  	bind $t <Control-Return> "$self key_input %W %x %y 10 %A 0"
  	bind $t <Control-v>      "$self paste_resize"
***************
*** 2552,2557 ****
  	mset {cx cy} [$self xy]
  	$self item text window [l+ $@textoffset [$self xy]] -window $t -anchor nw -tags "${self}text $self text"
! 	$t configure -pady 0 -padx 0
  	$t insert 1.0 $@text
  	#$t insert 1.0 [$self filter_text 1]
  	if {[[$self class] <= AtomBox]} {} else {$self resize none}
--- 2556,2563 ----
  	mset {cx cy} [$self xy]
  	$self item text window [l+ $@textoffset [$self xy]] -window $t -anchor nw -tags "${self}text $self text"
! 	#$t configure -pady 0 -padx 0
  	$t insert 1.0 $@text
+ 	set line_height [$t count -displaylines 1.0 end]
+ 	$t configure -pady 0 -padx 0
  	#$t insert 1.0 [$self filter_text 1]
  	if {[[$self class] <= AtomBox]} {} else {$self resize none}
***************
*** 2565,2569 ****
  	$self long_line
  	set fixed [font metrics [$self look font] -fixed]
! 	set text [$t get $@longline.0 "$@longline.end + 1 chars"]
  	if {$fixed} {
  		set width [string length $text]
--- 2571,2576 ----
  	$self long_line
  	set fixed [font metrics [$self look font] -fixed]
! 	#set text [$t get $@longline.0 "$@longline.end + 1 chars"]
! 	set text [$t get 1.0 end]
  	if {$fixed} {
  		set width [string length $text]
***************
*** 2573,2578 ****
  		set width [expr (($textpix+$fwidth-1)/$fwidth)+1]
  	}
! 	set maxwidth 40
! 	if {$key == "BackSpace"} {set width [expr $width - 2]}
          mset {y1 y2} [$t yview]
          set height [$t cget -height]
--- 2580,2585 ----
  		set width [expr (($textpix+$fwidth-1)/$fwidth)+1]
  	}
! 	set maxwidth $@max_width
! 	#if {$key == "BackSpace"} {set width [expr $width - 2]}
          mset {y1 y2} [$t yview]
          set height [$t cget -height]
***************
*** 2580,2588 ****
  		set height [expr $height/($y2-$y1)]
  	}
! 	$t configure -width [min $width $maxwidth] -height $height -wrap word
  }
  
  def TextBox key_input {widget x y key iso shift} {
! 	after 0 "$self after_key $widget"
  	set c [$@canvas widget]
  	set t $c.${self}text
--- 2587,2597 ----
  		set height [expr $height/($y2-$y1)]
  	}
! 	set line_height [$t count -displaylines 1.0 end]
! 	#if {$width < $maxwidth} {set height 1} {set height [expr $width/$maxwidth]}
! 	$t configure -width [min $width $maxwidth] -height $line_height -wrap word
  }
  
  def TextBox key_input {widget x y key iso shift} {
! 	after 0 "$self after_key $widget $key"
  	set c [$@canvas widget]
  	set t $c.${self}text
***************
*** 2598,2603 ****
  }
  
! def TextBox after_key {widget} {
  	$widget configure -state normal
  	#$self long_line
  	$self changed
--- 2607,2613 ----
  }
  
! def TextBox after_key {widget key} {
  	$widget configure -state normal
+ 	$self resize $key
  	#$self long_line
  	$self changed
***************
*** 2620,2628 ****
  	set maxwidth 40
          mset {y1 y2} [$t yview]
!         set height [$t cget -height]
!         if {$y2-$y1 < 1} {
! 		set height [expr $height/($y2-$y1)]
! 	}
  	$t configure -width [min $width $maxwidth] -height $height -wrap word
  	$self update_size
  	$self changed
--- 2630,2637 ----
  	set maxwidth 40
          mset {y1 y2} [$t yview]
!         if {$width < $maxwidth} {set height 1} {set height [expr ceil($width/$maxwidth.0)]}
  	$t configure -width [min $width $maxwidth] -height $height -wrap word
+ 	after 0 [list $t mark set insert 1.end]
+ 	$t mark set insert 1.0
  	$self update_size
  	$self changed
***************
*** 2630,2633 ****
--- 2639,2643 ----
  
  def TextBox scroll_history {incr} {
+ 	if {[[$self class] <= MessageBox]} {return}
  	set c [$self cwidget]
  	set t $c.${self}text





More information about the Pd-cvs mailing list