Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17413
Modified Files: Tag: impd_0_37 u_object.tk Log Message: i'll "standardize" on using the global array $_ to do OO Tcl...
Index: u_object.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/u_object.tk,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** u_object.tk 14 Mar 2004 22:33:55 -0000 1.1.2.8 --- u_object.tk 16 Mar 2004 21:53:16 -0000 1.1.2.9 *************** *** 16,28 **** }
- set palette { - #fcfcfc #a0a0a0 #404040 #fce0e0 #fce0c0 - #fcfcc8 #d8fcd8 #d8fcfc #dce4fc #f8d8fc - #e0e0e0 #7c7c7c #202020 #fc2828 #fcac44 - #e8e828 #14e814 #28f4f4 #3c50fc #f430f0 - #bcbcbc #606060 #000000 #8c0808 #583000 - #782814 #285014 #004450 #001488 #580050 - } - proc parse_color {c} { #puts "parse_color: $c" --- 16,19 ---- *************** *** 57,61 ****
proc update_object {x d} { ! global data global fields set class [lindex $d 4] --- 48,52 ----
proc update_object {x d} { ! global _ global fields set class [lindex $d 4] *************** *** 64,68 **** set i 0 foreach f $fields($class) { ! set data($x:$f) [lindex $d $i] incr i } --- 55,59 ---- set i 0 foreach f $fields($class) { ! set _($x:$f) [lindex $d $i] incr i } *************** *** 244,256 **** proc numbox_draw {tag canvas} { global look ! global data ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set xs [expr 10*$data($tag:w)] ! set ys $data($tag:h) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2] if {[llength [$canvas gettags ${tag}BASE]] != 0} { --- 235,247 ---- proc numbox_draw {tag canvas} { global look ! global _ ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set xs [expr 10*$_($tag:w)] ! set ys $_($tag:h) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] set points [list $x1 $y1 [expr $x2-4] $y1 $x2 [expr $y1+4] $x2 $y2 $x1 $y2] if {[llength [$canvas gettags ${tag}BASE]] != 0} { *************** *** 283,287 ****
proc bluebox_draw {canvas tag x1 y1 xs ys ins outs colour} { ! global data set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] --- 274,278 ----
proc bluebox_draw {canvas tag x1 y1 xs ys ins outs colour} { ! global _ set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] *************** *** 290,295 **** set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! #puts "bluebox: [parse_color $data($tag:col0)] [parse_color $data($tag:col1)] [parse_color $data($tag:col2)]" ! set color [bluify [parse_color $data($tag:col0)]] if {$isnew} { $canvas create rectangle $xya -tag ${tag}BASE -fill $color --- 281,286 ---- set xyc [list [expr $x2-1] [expr $y1+1] [expr $x2-1] [expr $y2-1] [expr $x1+1] [expr $y2-1]] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! #puts "bluebox: [parse_color $_($tag:col0)] [parse_color $_($tag:col1)] [parse_color $_($tag:col2)]" ! set color [bluify [parse_color $_($tag:col0)]] if {$isnew} { $canvas create rectangle $xya -tag ${tag}BASE -fill $color *************** *** 322,341 ****
proc radio_draw {tag canvas} { ! global data set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! switch $data($tag:class) { hradio {set orient 0} hdl {set orient 0} vradio {set orient 1} vdl {set orient 1} } ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set n $data($tag:n) ! set xs [expr $data($tag:w)*($orient?1:$n)] ! set ys [expr $data($tag:w)*($orient?$n:1)] set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] ! set colour [parse_color $data($tag:col0)] bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour if {$orient} {set size $ys} {set size $xs} --- 313,332 ----
proc radio_draw {tag canvas} { ! global _ set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! switch $_($tag:class) { hradio {set orient 0} hdl {set orient 0} vradio {set orient 1} vdl {set orient 1} } ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set n $_($tag:n) ! set xs [expr $_($tag:w)*($orient?1:$n)] ! set ys [expr $_($tag:w)*($orient?$n:1)] set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] ! set colour [parse_color $_($tag:col0)] bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour if {$orient} {set size $ys} {set size $xs} *************** *** 369,381 **** proc slider_draw {tag canvas} { set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! global data ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set xs $data($tag:w) ! set ys $data($tag:h) ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] ! switch $data($tag:class) {hsl {set orient 0} vsl {set orient 1}} ! set colour [parse_color $data($tag:col0)] bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour if {$isnew} { --- 360,372 ---- proc slider_draw {tag canvas} { set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! global _ ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set xs $_($tag:w) ! set ys $_($tag:h) ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] ! switch $_($tag:class) {hsl {set orient 0} vsl {set orient 1}} ! set colour [parse_color $_($tag:col0)] bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour if {$isnew} { *************** *** 419,433 ****
proc label_draw {tag canvas} { ! global data set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set lx [expr $x1+$data($tag:ldx)] ! set ly [expr $y1+$data($tag:ldy)] ! set label $data($tag:lab); switch $label { empty { set label "" }} set lfont [list \ ! [lindex {courier helvetica times} $data($tag:fstyle)] \ ! $data($tag:fs) bold] ! set lcolor [parse_color $data($tag:col2)] if {$isnew} { $canvas create text $lx $ly -text $label -anchor w \ --- 410,424 ----
proc label_draw {tag canvas} { ! global _ set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set lx [expr $x1+$_($tag:ldx)] ! set ly [expr $y1+$_($tag:ldy)] ! set label $_($tag:lab); switch $label { empty { set label "" }} set lfont [list \ ! [lindex {courier helvetica times} $_($tag:fstyle)] \ ! $_($tag:fs) bold] ! set lcolor [parse_color $_($tag:col2)] if {$isnew} { $canvas create text $lx $ly -text $label -anchor w \ *************** *** 444,458 ****
proc bang_draw {tag canvas} { ! global data set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set xs $data($tag:w) ! set ys $data($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] ! set colour [parse_color $data($tag:col0)] bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs --- 435,449 ----
proc bang_draw {tag canvas} { ! global _ set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set xs $_($tag:w) ! set ys $_($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] ! set colour [parse_color $_($tag:col0)] bluebox_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs $colour io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs *************** *** 479,493 ****
proc toggle_draw {tag canvas} { ! global data ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set xs $data($tag:w) ! set ys $data($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set colour [parse_color $data($tag:col0)] bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs --- 470,484 ----
proc toggle_draw {tag canvas} { ! global _ ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set xs $_($tag:w) ! set ys $_($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set colour [parse_color $_($tag:col0)] bluebox_draw $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour io_draw $canvas $tag $x1 $y1 $xs $ys $ins $outs *************** *** 508,512 **** } label_draw $tag $canvas ! toggle_set $tag $canvas $data($tag:on) }
--- 499,503 ---- } label_draw $tag $canvas ! toggle_set $tag $canvas $_($tag:on) }
*************** *** 529,542 **** proc vu_draw {tag canvas} { set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $data($tag:x1) ! set y1 $data($tag:y1) ! set xs $data($tag:w) ! set ys $data($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $data($tag:snd) empty]==0] ! set outs [expr [string compare $data($tag:snd) empty]==0] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set colour [parse_color $data($tag:col0)] bluebox_draw $tag $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour } --- 520,533 ---- proc vu_draw {tag canvas} { set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set x1 $_($tag:x1) ! set y1 $_($tag:y1) ! set xs $_($tag:w) ! set ys $_($tag:w) set x2 [expr $x1+$xs] set y2 [expr $y1+$ys] ! set ins [expr [string compare $_($tag:snd) empty]==0] ! set outs [expr [string compare $_($tag:snd) empty]==0] set isnew [expr [llength [$canvas gettags ${tag}BASE]] == 0] ! set colour [parse_color $_($tag:col0)] bluebox_draw $tag $canvas ${tag} $x1 $y1 $xs $ys $ins $outs $colour }