Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15933
Modified Files: Tag: devel_0_39 desire.tk Log Message: keys work with NumBox
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.256 retrieving revision 1.1.2.257 diff -C2 -d -r1.1.2.256 -r1.1.2.257 *** desire.tk 21 Jun 2006 05:49:45 -0000 1.1.2.256 --- desire.tk 21 Jun 2006 06:14:10 -0000 1.1.2.257 *************** *** 2305,2309 ****
def* Canvas unclickrun {x y b} { ! if {[$self focus] != $self} {[$self focus] unclick $x $y $b} }
--- 2305,2309 ----
def* Canvas unclickrun {x y b} { ! if {[$self focus] != ""} {[$self focus] unclick $x $y $b} }
*************** *** 3357,3360 **** --- 3357,3361 ---- set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] + set c .$@canvas.c set ins [expr [string compare $@rcv empty]==0] set outs [expr [string compare $@snd empty]==0] *************** *** 3372,3384 **** $self item NUMBER text [list $xt $yt] -anchor w -text [$self ftoa] \ -font $font(str) -fill [parse_color $@fcol] ! .$@canvas.c delete ${self}CURS if {[string length $@buf]>0} { ! mset {blah blah x3 blah} [$@canvas bbox ${self}NUMBER] ! $@canvas create line $x3 $y1 $x3 $y2 -tags ${self}CURS -fill red } io_draw $self Labeled_draw $self if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! .$@canvas.c itemconfigure ${self}BASE -outline $frcol }
--- 3373,3385 ---- $self item NUMBER text [list $xt $yt] -anchor w -text [$self ftoa] \ -font $font(str) -fill [parse_color $@fcol] ! $c delete ${self}CURS if {[string length $@buf]>0} { ! mset {blah blah x3 blah} [$c bbox ${self}NUMBER] ! $c create line $x3 $y1 $x3 $y2 -tags ${self}CURS -fill red } io_draw $self Labeled_draw $self if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $c itemconfigure ${self}BASE -outline $frcol }
*************** *** 3438,3463 ****
def* NumBox key {key shift} { ! set c -1 ! catch {set c [format %c $key]} ! if {[string first $c 0123456789.eE+-]>=0} { ! set @buf "$@buf$c" $self changed ! } elseif {$key==13} { ! # Return catch {set @val [expr $@buf]} ! $@canvas unfocus ! pd x$self float $@val ! } elseif {$key==8 || $key==127} { ! # Backspace if {[string length $@buf] >= 0} { set @buf [string range $@buf 0 end-1] } $self changed ! } elseif {$key==27} { ! # Escape set @val $@oval $@canvas unfocus ! } else { puts "NumBox_key $key" } } --- 3439,3467 ----
def* NumBox key {key shift} { ! switch -regexp -- $key { ! ^[\d\.eE+-]$ { ! set @buf "$@buf$key" $self changed ! } ! ^Return$ { catch {set @val [expr $@buf]} ! $@canvas focus= "" ! pd .$self float $@val ! set @buf "" ! $self changed ! } ! ^BackSpace|Delete$ { if {[string length $@buf] >= 0} { set @buf [string range $@buf 0 end-1] } $self changed ! } ! ^Escape$ { set @val $@oval $@canvas unfocus ! } ! default { puts "NumBox_key $key" + } } }