[PD-cvs] pd/src desire.tk,1.1.2.600.2.120,1.1.2.600.2.121
Mathieu Bouchard
matju at users.sourceforge.net
Wed Dec 20 01:50:34 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2639
Modified Files:
Tag: desiredata
desire.tk
Log Message:
pre5 ?
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.120
retrieving revision 1.1.2.600.2.121
diff -C2 -d -r1.1.2.600.2.120 -r1.1.2.600.2.121
*** desire.tk 19 Dec 2006 21:59:13 -0000 1.1.2.600.2.120
--- desire.tk 20 Dec 2006 00:50:30 -0000 1.1.2.600.2.121
***************
*** 426,429 ****
--- 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} {
***************
*** 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} {
--- 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} {
***************
*** 1871,1874 ****
--- 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]}
***************
*** 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 {
--- 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 {
***************
*** 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}
--- 1942,1945 ----
***************
*** 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}}
--- 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}}
***************
*** 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]
--- 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]
***************
*** 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
--- 2242,2245 ----
***************
*** 2265,2268 ****
--- 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"}}}
***************
*** 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
}
--- 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
+ # }
}
***************
*** 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]
--- 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]
More information about the Pd-cvs
mailing list