Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21168
Modified Files: Tag: desiredata desire.tk Log Message: reverting to revision 120
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.122 retrieving revision 1.1.2.600.2.123 diff -C2 -d -r1.1.2.600.2.122 -r1.1.2.600.2.123 *** desire.tk 20 Dec 2006 01:24:35 -0000 1.1.2.600.2.122 --- desire.tk 20 Dec 2006 01:39:13 -0000 1.1.2.600.2.123 *************** *** 426,430 **** foreach tkclass {Menu Button Checkbutton Radiobutton Entry Text Spinbox Scrollbar Canvas} { option add *$tkclass*borderWidth 1 - option add *$tkclass*activeBorderWidth 1 } foreach tkclass {CheckButton RadioButton} { --- 426,429 ---- *************** *** 758,763 **** -variable $y -anchor w -command $z] -side left } ! button .controls.clear -text [say console_clear] -command {.log.1 delete 0.0 end} -padx 2 -pady 0 ! button .controls.dio -text [say io_errors] -command {netsend [list pd audiostatus]} -padx 2 -pady 0 pack .controls.clear .controls.dio -side right if {$::debug} { --- 757,762 ---- -variable $y -anchor w -command $z] -side left } ! button .controls.clear -text [say console_clear] -command {.log.1 delete 0.0 end} -padx 2 -pady 2 ! button .controls.dio -text [say io_errors] -command {netsend [list pd audiostatus]} -padx 2 -pady 2 pack .controls.clear .controls.dio -side right if {$::debug} { *************** *** 1872,1897 **** }
- def Canvas new_object_insert {canvas obj} { - # if {[lsearch $@children $obj] < 0} { - # set future($self) [list $self new_object_insert $self $obj]; return - # } - set wire [$self selection_wire] - mset {obj1 outlet obj2 inlet} [$wire report] - $self disconnect [$wire connects] - set obj1_idx [$self children_idx $obj1] - set obj2_idx [$self children_idx $obj2] - set obj3_idx [$self children_idx $obj] - $self connect [list $obj1_idx $outlet $obj3_idx 0] - $self connect [list $obj3_idx 0 $obj2_idx $inlet] - $self action= none - # if {[$@canvas action] == "chain_obj"} { - # set obj1_idx [$@canvas children_idx [lindex [$@canvas selection] 0]] - # set obj2_idx [$@canvas children_idx $self] - # $@canvas connect [list $obj1_idx 0 $obj2_idx 0] - # $@canvas deselect_all - # $@canvas action= none - # after 100 $@canvas selection2= $obj2_idx - # } - }
def Canvas insertxy {} {return [list $@insert_x $@insert_y]} --- 1871,1874 ---- *************** *** 1932,1940 **** }
def Canvas chain_object {} { if {[llength $@selection] == 1} { mset {x1 y1 x2 y2} [$@selection bbox] # this should use callback... ! netsend [list .$self obj $x1 [expr $y2 + 10]] set @action chain_obj } else { --- 1909,1930 ---- }
+ def Canvas new_object_insert_wire {obj} { + set wire [$self selection_wire] + $wire selected?= 0 + mset {obj1 outlet obj2 inlet} [$wire report] + $self disconnect [$wire connects] + set obj1_idx [$self children_idx $obj1] + set obj2_idx [$self children_idx $obj2] + set obj3_idx [$self children_idx $obj] + $self connect [list $obj1_idx $outlet $obj3_idx 0] + $self connect [list $obj3_idx 0 $obj2_idx $inlet] + $self action= none + } + def Canvas chain_object {} { if {[llength $@selection] == 1} { mset {x1 y1 x2 y2} [$@selection bbox] # this should use callback... ! netsend [list .$self obj $x1 [expr $y2 + 10]] [list $self new_object_edit] set @action chain_obj } else { *************** *** 1942,1945 **** --- 1932,1943 ---- } } + def Canvas new_object_chain_wire {obj} { + set obj1_idx [$self children_idx [lindex [$self selection] 0]] + $self deselect_all + set obj2_idx [$self children_idx $obj] + $self connect [list $obj1_idx 0 $obj2_idx 0] + $self action= none + $self selection= $obj + }
def Canvas Object {} {$self new_object obj} *************** *** 2124,2128 ****
def TextBox draw_edit {} { ! set c [[$self get_canvas] widget] if {[lsearch [$@canvas selection] $self] < 0} {$@canvas selection+= $self} set t $c.${self}text --- 2122,2126 ----
def TextBox draw_edit {} { ! set c [$@canvas widget] if {[lsearch [$@canvas selection] $self] < 0} {$@canvas selection+= $self} set t $c.${self}text *************** *** 2164,2168 ****
def TextBox resize {key} { ! set c [[$self get_canvas] widget] set t $c.${self}text $self long_line --- 2162,2166 ----
def TextBox resize {key} { ! set c [$@canvas widget] set t $c.${self}text $self long_line *************** *** 2201,2205 **** #checks which line should be used as the width of the objectbox def TextBox long_line {} { ! set c [[$self get_canvas] widget] set t $c.${self}text set lines [lindex [$t configure -height] 4] --- 2199,2203 ---- #checks which line should be used as the width of the objectbox def TextBox long_line {} { ! set c [$@canvas widget] set t $c.${self}text set lines [lindex [$t configure -height] 4] *************** *** 2213,2221 **** def TextBox text {} {return $@text}
- # with multiline support - #proc font_metrics_xy {} { - #} - def TextBox update_size {} { if {([$self class] == "FloatBox" || [$self class] == "NumBox") && $@w} {return} if {[info exists @gop]} {if {$@gop} {set @xs $@pixwidth; set @ys $@pixheight; return}} --- 2211,2216 ---- def TextBox text {} {return $@text}
def TextBox update_size {} { + # if {([$self class] == "FloatBox" || [$self class] == "NumBox") && $@w} {return} if {[info exists @gop]} {if {$@gop} {set @xs $@pixwidth; set @ys $@pixheight; return}} *************** *** 2225,2230 **** if {$@canvas == ""} {puts "update_size: this textbox has no canvas, try again later"; return} set n [string length $@text] ! set c [[$self get_canvas] widget] ! if {![winfo exists $c]} {return} ;# hack for update_size called too early. set t $c.${self}text set width [font measure [$self look font] W] --- 2220,2224 ---- if {$@canvas == ""} {puts "update_size: this textbox has no canvas, try again later"; return} set n [string length $@text] ! set c [$@canvas widget] set t $c.${self}text set width [font measure [$self look font] W] *************** *** 2242,2245 **** --- 2236,2240 ---- } catch { + set text [$c.${self}text get $@longline.0 $@longline.end] set textwidth [expr {[font measure [$self look font] $text]+20}];#+20 hack *************** *** 2270,2278 **** foreach o $@selection {$o selected?= 1} } - def Canvas selection2= {idx} { - foreach o $@selection {$o selected?= 0} - set @selection [lindex $@children $idx] - foreach o $@selection {$o selected?= 1} - } def Canvas selection+= {objs} { foreach o $objs {switch $_($o:_class) {Wire {error "selection error"}}} --- 2265,2268 ---- *************** *** 2333,2361 **** $@canvas selection-= [list $self] switch [$@canvas action] { ! insert {set goto [list $@canvas new_object_insert $@canvas]} ! chain_obj {set goto [list $@canvas new_object_insert]} default {set goto [list $@canvas new_object_callback]} } netsend [list .$@canvas text_setto $self $l] $goto - # netsend [list .$@canvas text_setto $self $l] [list $@canvas new_object_callback] - # if {[$@canvas action] == "insert"} { - # set wire [$@canvas selection_wire] - # mset {obj1 outlet obj2 inlet} [$wire report] - # $@canvas disconnect [$wire connects] - # set obj1_idx [$@canvas children_idx $obj1] - # set obj2_idx [$@canvas children_idx $obj2] - # set obj3_idx [$@canvas children_idx $self] - # $@canvas connect [list $obj1_idx $outlet $obj3_idx 0] - # $@canvas connect [list $obj3_idx 0 $obj2_idx $inlet] - # $@canvas action= none - # } - # if {[$@canvas action] == "chain_obj"} { - # set obj1_idx [$@canvas children_idx [lindex [$@canvas selection] 0]] - # set obj2_idx [$@canvas children_idx $self] - # $@canvas connect [list $obj1_idx 0 $obj2_idx 0] - # $@canvas deselect_all - # $@canvas action= none - # after 100 $@canvas selection2= $obj2_idx - # } }
--- 2323,2331 ---- $@canvas selection-= [list $self] switch [$@canvas action] { ! insert {set goto [list $@canvas new_object_insert_wire]} ! chain_obj {set goto [list $@canvas new_object_chain_wire]} default {set goto [list $@canvas new_object_callback]} } netsend [list .$@canvas text_setto $self $l] $goto }
*************** *** 2363,2367 **** if {!$@edit} {return} set @edit 0; $self changed edit ! set c [[$self get_canvas] widget] set t $c.${self}text if {$accept} {$self setto [$t get 1.0 "end - 1 chars"]} --- 2333,2337 ---- if {!$@edit} {return} set @edit 0; $self changed edit ! set c [$@canvas widget] set t $c.${self}text if {$accept} {$self setto [$t get 1.0 "end - 1 chars"]} *************** *** 2651,2655 **** if {$type == "wire"} { mset {obj1 outlet obj2 inlet} [$id report] ! $self disconnect [$wire connects] set obj1_idx [$self children_idx $obj1] set obj2_idx [$self children_idx $obj2] --- 2621,2625 ---- if {$type == "wire"} { mset {obj1 outlet obj2 inlet} [$id report] ! $self disconnect [$id connects] set obj1_idx [$self children_idx $obj1] set obj2_idx [$self children_idx $obj2]