Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26381
Modified Files: Tag: devel_0_39 desire.tk Log Message: moving some code from FloatAtom to AtomBox. beginning SymbolBox support (readonly).
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.263 retrieving revision 1.1.2.264 diff -C2 -d -r1.1.2.263 -r1.1.2.264 *** desire.tk 25 Jun 2006 10:57:58 -0000 1.1.2.263 --- desire.tk 25 Jun 2006 11:08:57 -0000 1.1.2.264 *************** *** 2692,2696 **** set classinfo(canvas) {Canvas} set classinfo(cnv) {Cnv} ! set classinfo(floatatom) {FloatAtom}
# --- 2692,2697 ---- set classinfo(canvas) {Canvas} set classinfo(cnv) {Cnv} ! set classinfo(floatatom) {FloatAtom} ! set classinfo(symbolatom) {SymbolAtom}
# *************** *** 2929,2933 **** class_new AtomBox {Box} def* AtomBox draw {} { ! global look $self update_size mset {x1 y1} [$self xy] --- 2930,2934 ---- class_new AtomBox {Box} def* AtomBox draw {} { ! global font look $self update_size mset {x1 y1} [$self xy] *************** *** 2940,2943 **** --- 2941,2958 ---- if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} .$@canvas.c itemconfigure ${self}BASE -outline $frcol + + mset {x1 y1} [$self xy] + set xs [expr 4+10*$@w] + set ys $font(height) + set @xt [expr $x1+$ys/2-2] + set @yt [expr $y1+$ys/2+3+$xs/34] + if {[$self selected?]} {set fcol red} else {set fcol $look(objectfg)} + if {[string length $@val] <= $@w} { + set string $@text + } else { + set string [string range $@text 0 [expr $@w-1]] + } + $self item TEXT text [list $@xt $@yt] -anchor w -text $string \ + -font $font(str) -fill $fcol }
*************** *** 3251,3255 ****
class_new FloatAtom {AtomBox} ! def* FloatAtom init {args} { super global font look --- 3266,3271 ----
class_new FloatAtom {AtomBox} ! ! def* AtomBox init {args} { super global font look *************** *** 3267,3291 **** }
- - def* FloatAtom draw {} { - $self update_size - global font look - super - mset {x1 y1} [$self xy] - set xs [expr 4+10*$@w] - set ys $font(height) - set @xt [expr $x1+$ys/2-2] - set @yt [expr $y1+$ys/2+3+$xs/34] - if {[$self selected?]} {set fcol red} else {set fcol $look(objectfg)} - if {[string length $@val] <= $@w} { - set string $@text - } else { - set string [string range $@text 0 [expr $@w-1]] - } - $self item TEXT text [list $@xt $@yt] -anchor w -text $string \ - -font $font(str) -fill $fcol - - } - def* FloatAtom key {key shift} { global font look --- 3283,3286 ---- *************** *** 3344,3348 **** }
! def FloatAtom update_size {} { global font look #set @textwidth [expr $font(padx)+$font(width)*[string length $@val]] --- 3339,3343 ---- }
! def AtomBox update_size {} { global font look #set @textwidth [expr $font(padx)+$font(width)*[string length $@val]] *************** *** 3400,3403 **** --- 3395,3416 ---- }
+ class_new SymbolAtom {AtomBox} + + # copypaste from FloatAtom init + def* SymbolAtom init {args} { + super + global font look + eval [concat [list super] $args] + set @clicking 0 + set @val 0 + set @old_val 0 + set @valid 0 + set @clickpos {} + set @key_input 0 + set @text 0 + set @edit 0 + #set @isnew 1 + } + class_new NumBox {Labeled Box} def* NumBox init {args} {