Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3775
Modified Files: Tag: devel_0_39 desire.tk Log Message: added def box edit and got togle to work too
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.209 retrieving revision 1.1.2.210 diff -C2 -d -r1.1.2.209 -r1.1.2.210 *** desire.tk 19 May 2006 15:04:12 -0000 1.1.2.209 --- desire.tk 20 May 2006 18:09:50 -0000 1.1.2.210 *************** *** 2016,2020 **** #foreach {type id} [$self identify_target $cx $cy -1 -1 "blah "] {} mset {type id} [$self identify_target $x $y [expr $x-1] [expr $y-1] "unclick"] ! puts "type:$type id:$id" set @obj_in_edit $id $id edit --- 2016,2020 ---- #foreach {type id} [$self identify_target $cx $cy -1 -1 "blah "] {} mset {type id} [$self identify_target $x $y [expr $x-1] [expr $y-1] "unclick"] ! puts "type:$type id:$id class:$_($id:class)" set @obj_in_edit $id $id edit *************** *** 2153,2164 **** }
! def* Box connect_out {} { ! } ! ! def* Box connect_in {} { ! } ! ! def* Box draw {} { ! }
def Box bbox {} { --- 2153,2161 ---- }
! def* Box connect_out {} {} ! def* Box connect_in {} {} ! def* Box draw {} {} ! def* Box edit {} {} ! def* Box unedit {} {}
def Box bbox {} { *************** *** 2746,2750 **** class_new Slider {BlueBox} def Slider orient {} { ! switch $@pdclass { vsl {set orient 1} default {set orient 0} } --- 2743,2748 ---- class_new Slider {BlueBox} def Slider orient {} { ! global classinfo ! switch $@class { vsl {set orient 1} default {set orient 0} } *************** *** 2754,2758 **** --- 2752,2758 ---- def Slider init {args} { super + set @valid 0 set @clicking 0 + set @value 0 }
*************** *** 2762,2766 **** }
! def Slider draw {} { global look mset {x1 y1 x2 y2} [$self bbox] --- 2762,2766 ---- }
! def* Slider draw {} { global look mset {x1 y1 x2 y2} [$self bbox] *************** *** 2774,2779 **** super set color [bluify #ffffff] ! $self item KNOB rectangle [list $x1 $y1 $x1 $y1] \ ! -outline #000000 -fill [darker $color] set c .$@canvas.c set span [expr $@max-$@min] --- 2774,2779 ---- super set color [bluify #ffffff] ! $self item KNOB rectangle [list $x1 $y1 [expr $x1 + 10] [expr $y1 + 10]] \ ! -outline red -fill [darker $color] set c .$@canvas.c set span [expr $@max-$@min] *************** *** 2784,2789 **** set size $xs set y1 [expr $y1+$ys-$value*($l-1)/$span-2] set y2 [expr $y1-2] ! $c coords ${self}KNOB [expr $x1+2] $y1 [expr $x1+$size-2] $y2 } { set size $ys --- 2784,2791 ---- set size $xs set y1 [expr $y1+$ys-$value*($l-1)/$span-2] + puts "value=$value :: l=$l :: span=$span :: val=$@val" set y2 [expr $y1-2] ! puts "[expr $x1+2] :: $y1 :: [expr $x1+$size-2] :: $y2" ! $c coords ${self}KNOB [expr $x1+2] $y1 [expr $x1+$size-2] $y2 } { set size $ys *************** *** 2813,2817 ****
def Slider click {x y b f} { ! $@canvas focus $self set @first [list $x $y] set @ovalue $@value --- 2815,2819 ----
def Slider click {x y b f} { ! $@canvas focus= $self set @first [list $x $y] set @ovalue $@value *************** *** 2820,2828 **** }
! def Slider unclick {x y} { set @clicking 0 if {[lindex $@first 1] != $y} { ! $@canvas unfocus ! pd x$self float $@value } } --- 2822,2832 ---- }
! def Slider unclick {x y mod} { set @clicking 0 if {[lindex $@first 1] != $y} { ! $@canvas focus= $@canvas ! $self draw ! puts "------- value is $@value -------------" ! pd .$self float $@value } } *************** *** 2833,2842 **** set dx [expr $x-[lindex $@first 0]] set dy [expr $y-[lindex $@first 1]] ! set orient [slider_orient $self] set span [expr $@max-$@min] set l [expr $orient?$@h:$@w] set d [expr ($orient?-$dy:$dx)*$span/($l+0.0)] set @value [expr $@ovalue+$d*$@rate] ! pd x$self float $@value }
--- 2837,2846 ---- set dx [expr $x-[lindex $@first 0]] set dy [expr $y-[lindex $@first 1]] ! set orient [$self orient] set span [expr $@max-$@min] set l [expr $orient?$@h:$@w] set d [expr ($orient?-$dy:$dx)*$span/($l+0.0)] set @value [expr $@ovalue+$d*$@rate] ! pd .$self float $@value }
*************** *** 2910,2913 **** --- 2914,2918 ---- def Toggle init {args} { super + set @valid 0 set @on 0 set @w 15 *************** *** 2942,2951 ****
def* Toggle click {x y b f} { ! pd x$self bang if {!$@on} {set @on 1} {set @on 0} puts "Toggle state:$@on" $self draw }
class_new Vu {View}
--- 2947,2963 ----
def* Toggle click {x y b f} { ! pd .$self bang if {!$@on} {set @on 1} {set @on 0} puts "Toggle state:$@on" + $@canvas focus= $self $self draw }
+ def* Toggle unclick {x y b} { + global look + set @clicking 0 + $@canvas focus= $@canvas + } + class_new Vu {View}