Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10209
Modified Files: Tag: desiredata desire.tk Log Message: changing pd to netsend and other small fixes
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.36 retrieving revision 1.1.2.600.2.37 diff -C2 -d -r1.1.2.600.2.36 -r1.1.2.600.2.37 *** desire.tk 7 Dec 2006 19:34:20 -0000 1.1.2.600.2.36 --- desire.tk 7 Dec 2006 21:16:32 -0000 1.1.2.600.2.37 *************** *** 1115,1119 ****
set item { - global font set canvas [$self get_canvas] if {$canvas == ""} {return} --- 1115,1118 ---- *************** *** 1255,1263 ****
def View draw_maybe {} { ! # if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; return} ! if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; puts " here is another draw"} if {[$self class] == "Canvas" && $@canvas == ""} {return} if {$@inside_box} { ! if {[$@canvas mapped]} {if {![$@canvas abs]} {$self draw; puts " here is the draw"}} } else { # for drawing opened gop --- 1254,1261 ----
def View draw_maybe {} { ! if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; return} if {[$self class] == "Canvas" && $@canvas == ""} {return} if {$@inside_box} { ! if {[$@canvas mapped]} {if {![$@canvas abs]} {$self draw}} } else { # for drawing opened gop *************** *** 1667,1671 **** def Canvas find {} { set @find_break 0 ! FindDialog new_as find $self } def Canvas find_again {} { --- 1665,1669 ---- def Canvas find {} { set @find_break 0 ! FindDialog new_as find $self } def Canvas find_again {} { *************** *** 4417,4421 **** def MessageBox click {x y f target} { $self bang 1 ! pd .$self bang after 150 $self bang 0 } --- 4415,4419 ---- def MessageBox click {x y f target} { $self bang 1 ! netsend [list .$self bang] after 150 $self bang 0 } *************** *** 4904,4911 ****
def FloatAtom motion {x y f target} { ! set canvas [$self get_canvas] ! set focused [$self == [$canvas focus]] ! if {!$focused} {return} ! if {!$@clicking} {return} mset {ox oy} $@mouse set @val [expr $@val-$@rate*($y-$oy)] --- 4902,4906 ----
def FloatAtom motion {x y f target} { ! if {!$@clicking || ![$self == [[$self get_canvas] focus]]} {return} mset {ox oy} $@mouse set @val [expr $@val-$@rate*($y-$oy)] *************** *** 5007,5019 ****
def NumBox motion {x y f target} { ! set focused [$self == [$@canvas focus]] ! if {!$focused || !$@clicking} {return} mset {ox oy} $@mouse ! set @val [expr $@val-$@rate*($y-$oy)] set @old_val $@val set @text $@val set @mouse [list $x $y] ! pd .$self float $@val ! pd .$self bang }
--- 5002,5012 ----
def NumBox motion {x y f target} { ! if {!$@clicking || ![$self == [[$self get_canvas] focus]]} {return} mset {ox oy} $@mouse ! set @val [expr {$@val-$@rate*($y-$oy)}] set @old_val $@val set @text $@val set @mouse [list $x $y] ! netsend [list .$self float $@val] }
*************** *** 5085,5093 **** def Radio orient {} { switch $@class { ! hradio {set orient 0} hdl {set orient 0} ! vradio {set orient 1} vdl {set orient 1} ! default {set orient 0} } - return $orient }
--- 5078,5085 ---- def Radio orient {} { switch $@class { ! hradio {return 0} hdl {return 0} ! vradio {return 1} vdl {return 1} ! default {return 0} } }
*************** *** 5124,5132 **** $@canvas focus= $self mset {x1 y1} [$self xy] - set x [expr $x-$x1] - set y [expr $y-$y1] set orient [$self orient] ! set i [expr ($orient?$y:$x)/$@w] ! pd .$self fout $i }
--- 5116,5122 ---- $@canvas focus= $self mset {x1 y1} [$self xy] set orient [$self orient] ! set i [expr {($orient?$y-$y1:$x-$x1)/$@w}] ! netsend [list .$self fout $i] }
*************** *** 5134,5147 ****
class_new Slider {BlueBox} ! def Slider orient {} { ! switch $@class { ! vsl {set orient 1} default {set orient 0} ! } ! return $orient ! }
def Slider init {mess} { super $mess - set @clicking 0 set @value 0 } --- 5124,5131 ----
class_new Slider {BlueBox} ! def Slider orient {} {switch $@class {vsl {return 1} default {return 0}}}
def Slider init {mess} { super $mess set @value 0 } *************** *** 5210,5224 **** set @click_at [list $x $y] set @ovalue $@value - set @clicking 1 set @rate [expr $f&1 ? 0.01 : 1.00] }
def Slider unclick {x y f target} { ! set @clicking 0 ! if {[lindex $@click_at 1] != $y} { ! $@canvas focus= "" ! $self draw ! pd .$self float $@value ! } }
--- 5194,5204 ---- set @click_at [list $x $y] set @ovalue $@value set @rate [expr $f&1 ? 0.01 : 1.00] }
def Slider unclick {x y f target} { ! ### keep focus if only clicked. do we want that feature? ! # if {[distance $@click_at [list $x $y]] == 0} {return} ! $@canvas focus= "" }
*************** *** 5227,5238 **** if {!$focused} {return} mset {clx cly} $@click_at - set dx [expr $x-$clx] - set dy [expr $y-$cly] 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 [min $@max [max $@min [expr $@ovalue+$d*$@rate]]] ! pd .$self float $@value }
--- 5207,5216 ---- if {!$focused} {return} mset {clx cly} $@click_at set orient [$self orient] set span [expr $@max-$@min] ! set l [expr {$orient?$@h:$@w}] ! set d [expr {($orient?$cly-$y:$x-$clx)*$span/($l+0.0)}] set @value [min $@max [max $@min [expr $@ovalue+$d*$@rate]]] ! netsend [list .$self float $@value] }
*************** *** 5288,5306 **** } } ! ! ! def Bang unclick {x y f target} {$@canvas focus= ""} ! ! def Bang click {x y f target} { ! $@canvas focus= $self ! pd .$self bang ! } ! ! def Bang bang {count} { ! set @count $count ! set @flash 1 ! #[$@canvas widget] itemconfigure ${self}BUT -fill [color_* [$self look bg] [parse_color $@fcol]] ! #after 100 [list [$@canvas widget] itemconfigure ${self}BUT -fill [color_* [$self look bg] [parse_color $@bcol]]] ! }
class_new Toggle {BlueBox} --- 5266,5272 ---- } } ! def Bang unclick {x y f target} {} ! def Bang click {x y f target} {netsend [list .$self bang]} ! def Bang bang {count} {set @count $count; set @flash 1}
class_new Toggle {BlueBox} *************** *** 5328,5342 **** }
def Toggle click {x y f target} { - 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 f target} { ! set @clicking 0 ! $@canvas focus= "" }
--- 5294,5302 ---- }
+ def Toggle unclick {x y f target} {} def Toggle click {x y f target} { if {!$@on} {set @on 1} {set @on 0} ! netsend [list .$self float $@on] ! $self changed }