Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9872
Modified Files: Tag: devel_0_39 desire.tk Log Message: [nbx] now renders
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.135 retrieving revision 1.1.2.136 diff -C2 -d -r1.1.2.135 -r1.1.2.136 *** desire.tk 4 Dec 2005 12:14:40 -0000 1.1.2.135 --- desire.tk 4 Dec 2005 12:58:54 -0000 1.1.2.136 *************** *** 725,729 **** }
! def view item_delete {} {.$@canvas.c delete $self} def* view delete {} {$self erase; $self _delete; io_erase $self} def* view erase {} {$self item_delete} --- 725,733 ---- }
! def view item_delete {{suffix all}} { ! switch -- $suffix { ! all {.$@canvas.c delete $self } ! default {.$@canvas.c delete $self$suffix}}} ! def* view delete {} {$self erase; $self _delete; io_erase $self} def* view erase {} {$self item_delete} *************** *** 969,972 **** --- 973,977 ---- def* canvas noutlets= {n} {} def canvas focus {} {return $@focus} + def canvas focus= {o} {set @focus $o}
*************** *** 1177,1187 **** global look set nplus [expr $n==1 ? 1 : $n-1] ! mset {x1 y1} [$self xy] set c .$@canvas.c for {set i 0} {$i<$n} {incr i} { ! set onset [expr $x1 + ($@xs-$look(iowidth)) * $i / $nplus] set points [list [expr $onset] $y [expr $onset+$look(iowidth)] [expr $y+1]] # will update this code when proc item deals with mult.tags ! if {[llength [$c gettags ${self}$which$i]] != 0} { $c coords ${self}$which$i $points } { --- 1182,1195 ---- global look set nplus [expr $n==1 ? 1 : $n-1] ! #mset {x1 y1} [$self xy] ! mset {x1 y1 x2 y2} [.$@canvas.c bbox ${self}BASE] ! set xs [expr $x2-$x1] ! set ys [expr $y2-$y1] set c .$@canvas.c for {set i 0} {$i<$n} {incr i} { ! set onset [expr $x1 + ($xs-$look(iowidth)) * $i / $nplus] set points [list [expr $onset] $y [expr $onset+$look(iowidth)] [expr $y+1]] # will update this code when proc item deals with mult.tags ! if {[llength [$c gettags $self$which$i]] != 0} { $c coords ${self}$which$i $points } { *************** *** 1195,1201 **** global look set fy $look(iopos) ! mset {x1 y1} [$self xy] io_draw/2 $self i $@ninlets [expr $y1-$fy-1] ! io_draw/2 $self o $@noutlets [expr $y1+$fy+$@ys] }
--- 1203,1210 ---- global look set fy $look(iopos) ! #mset {x1 y1} [$self xy] ! mset {x1 y1 x2 y2} [.$@canvas.c bbox ${self}BASE] io_draw/2 $self i $@ninlets [expr $y1-$fy-1] ! io_draw/2 $self o $@noutlets [expr $y2+$fy] }
*************** *** 2251,2254 **** --- 2260,2265 ---- }
+ def thing == {other} {return [expr ![string compare $self $other]]} + def numbox draw {} { global look *************** *** 2265,2274 **** set yt [expr $y1+$ys/2+1+$xs/34] set points2 [list $x1 $y1 [expr $x1+$ys/2] [expr $y1+$ys/2] $x1 $y2] ! set focused [expr ![string compare $self [canvas_focuser $@canvas]]] if {$focused} {set color4 #00ff00} {set color4 $look(objectbg)} $self item BASE polygon $points -fill [parse_color $@bcol] -outline $look(objectframe3) $self item BASE4 polygon $points2 -fill $color4 -outline $look(objectframe3) ! $self item NUMBER text $xt $yt -anchor w -text [numbox_ftoa $self] -font [list $font $@fs bold] -fill [parse_color $@fcol] ! $@canvas delete ${self}CURS if {[string length $@buf]>0} { mset {blah blah x3 blah} [$@canvas bbox ${self}NUMBER] --- 2276,2286 ---- set yt [expr $y1+$ys/2+1+$xs/34] set points2 [list $x1 $y1 [expr $x1+$ys/2] [expr $y1+$ys/2] $x1 $y2] ! set focused [$self == [$@canvas focus]] if {$focused} {set color4 #00ff00} {set color4 $look(objectbg)} $self item BASE polygon $points -fill [parse_color $@bcol] -outline $look(objectframe3) $self item BASE4 polygon $points2 -fill $color4 -outline $look(objectframe3) ! $self item NUMBER text [list $xt $yt] -anchor w -text [numbox_ftoa $self] \ ! -font [list $font $@fs bold] -fill [parse_color $@fcol] ! .$@canvas.c delete ${self}CURS if {[string length $@buf]>0} { mset {blah blah x3 blah} [$@canvas bbox ${self}NUMBER] *************** *** 2276,2282 **** } io_draw $self ! label_draw $self if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! $@canvas itemconfigure ${self}BASE -outline $frcol }
--- 2288,2294 ---- } io_draw $self ! labeled_draw $self if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)} ! .$@canvas.c itemconfigure ${self}BASE -outline $frcol }
*************** *** 2312,2316 ****
def numbox motion {x y mod} { ! set focused [expr ![string compare $self [canvas_focuser $@canvas]]] if {!$focused} {return} mset {ox oy} $@mouse --- 2324,2328 ----
def numbox motion {x y mod} { ! set focused [$self == [$@canvas focus]] if {!$focused} {return} mset {ox oy} $@mouse *************** *** 2429,2443 **** set xs $@w set ys $@h ! set orient [slider_orient $self] if {$orient} {set y1 [expr $y1-2]} {set x1 [expr $x1-2]} if {$orient} {set ys [expr $ys+5]} {set xs [expr $xs+5]} set ins [expr [string compare $@rcv empty]==0] set outs [expr [string compare $@snd empty]==0] - switch $@class {hsl {set orient 0} vsl {set orient 1}} super set color [bluify #ffffff] $self item KNOB rectangle $x1 $y1 $x1 $y1 \ -outline #000000 -fill [darker $color] ! set pos [$@canvas coords ${self}BASE] set span [expr $@max-$@min] set l [expr $orient?$@h:$@w] --- 2441,2454 ---- set xs $@w set ys $@h ! set orient [$self orient] if {$orient} {set y1 [expr $y1-2]} {set x1 [expr $x1-2]} if {$orient} {set ys [expr $ys+5]} {set xs [expr $xs+5]} set ins [expr [string compare $@rcv empty]==0] set outs [expr [string compare $@snd empty]==0] super set color [bluify #ffffff] $self item KNOB rectangle $x1 $y1 $x1 $y1 \ -outline #000000 -fill [darker $color] ! set {u1 v1 u2 v2} [$@canvas coords ${self}BASE] set span [expr $@max-$@min] set l [expr $orient?$@h:$@w] *************** *** 2445,2460 **** set @value $value if {$orient} { ! set size [expr [lindex $pos 2]-$x1] ! set y1 [expr [lindex $pos 3]-$value*($l-1)/$span-2] set y2 [expr $y1-2] ! $@canvas coords ${self}KNOB \ ! [expr $x1+2] $y1 [expr $x1+$size-2] $y2 } { ! set size [expr [lindex $pos 3]-$y1] set x1 [expr $x1+$value*($l-1)/$span] set x2 [expr $x1+2] set y2 [expr $y1+$size] ! $@canvas coords ${self}KNOB \ ! $x1 [expr $y1+2] $x2 [expr $y1+$size-2] } } --- 2456,2469 ---- set @value $value if {$orient} { ! set size [expr $u2-$x1] ! set y1 [expr $v2-$value*($l-1)/$span-2] set y2 [expr $y1-2] ! $@canvas coords ${self}KNOB [expr $x1+2] $y1 [expr $x1+$size-2] $y2 } { ! set size [expr $v2-$y1] set x1 [expr $x1+$value*($l-1)/$span] set x2 [expr $x1+2] set y2 [expr $y1+$size] ! $@canvas coords ${self}KNOB $x1 [expr $y1+2] $x2 [expr $y1+$size-2] } } *************** *** 2462,2465 **** --- 2471,2475 ---- # not used def slider draw_notches {} { + set orient [$self orient] if {$orient} { set thick [clamp [expr $xs/3] 1 5] *************** *** 2493,2497 ****
def slider motion {x y mods} { ! set focused [expr ![string compare $self [canvas_focuser $@canvas]]] if {!$focused} {return} set dx [expr $x-[lindex $@first 0]] --- 2503,2507 ----
def slider motion {x y mods} { ! set focused [$self == [$@canvas focus]] if {!$focused} {return} set dx [expr $x-[lindex $@first 0]] *************** *** 2518,2523 **** $@fs bold] set lcolor [parse_color $@lcol] ! $self item LABEL text $lx $ly -text $label -anchor w \ ! -font $lfont -fill $lcolor }
--- 2528,2532 ---- $@fs bold] set lcolor [parse_color $@lcol] ! $self item LABEL text [list $lx $ly] -text $label -anchor w -font $lfont -fill $lcolor }