Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26361
Modified Files: Tag: devel_0_39 desire.tk Log Message: stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.63 retrieving revision 1.1.2.64 diff -C2 -d -r1.1.2.63 -r1.1.2.64 *** desire.tk 18 Sep 2005 02:00:12 -0000 1.1.2.63 --- desire.tk 18 Sep 2005 09:23:16 -0000 1.1.2.64 *************** *** 597,619 **** set to [lindex $wire_to 0] set inlet_number [lindex $wire_to 1] - set inlet_flag 0 - set outlet_flag 1 - #puts "wire_from ==> $wire_from" #puts "wire_to ==> $wire_to" #puts "outlet_number ==> $outlet_number" ! ! if {[info exists _($from:$outlet_flag:$outlet_number)]} { ! lappend _($from:$outlet_flag:$outlet_number) $wire_id } else { ! set _($from:$outlet_flag:$outlet_number) $wire_id ! #puts "**** $from:$outlet_flag:$outlet_number ****" } ! if {[info exists _($to:$inlet_flag:$inlet_number)]} { ! lappend _($to:$inlet_flag:$inlet_number) $wire_id } else { ! set _($to:$inlet_flag:$inlet_number) $wire_id ! #puts "*** $to:$inlet_flag:$inlet_number ***" } --- 597,617 ---- set to [lindex $wire_to 0] set inlet_number [lindex $wire_to 1] #puts "wire_from ==> $wire_from" #puts "wire_to ==> $wire_to" #puts "outlet_number ==> $outlet_number" ! ! ! if {[info exists _($from:o:$outlet_number)]} { ! lappend _($from:o:$outlet_number) $wire_id } else { ! set _($from:o:$outlet_number) $wire_id ! #puts "**** $from:o:$outlet_number ****" } ! if {[info exists _($to:i:$inlet_number)]} { ! lappend _($to:i:$inlet_number) $wire_id } else { ! set _($to:$i:$inlet_number) $wire_id ! #puts "*** $to:i:$inlet_number ***" } *************** *** 737,740 **** --- 735,739 ---- global sock puts $sock [join $args " "] + flush $sock puts "<- [join $args " "]" } *************** *** 1128,1131 **** --- 1127,1133 ---- }
+ #def view connect {} { + #} + # in the future, one view may have several canvases. # this means that the following proc will have to die. *************** *** 1198,1203 ****
#-----------------------------------------------------------------------------------# ! # create a new text object ! class_new text {thing}
proc text_new {canvas self x y text font color} { --- 1200,1204 ----
#-----------------------------------------------------------------------------------# ! class_new textbox {view}
proc text_new {canvas self x y text font color} { *************** *** 1208,1213 **** }
- # change the text - proc* pdtk_text_set {canvas myname text} {} proc text_set {canvas myname text} { .x$canvas.c itemconfigure $myname -text $text --- 1209,1212 ---- *************** *** 1217,1223 **** }
! def text create {canvas font_size text} { global look font ! set @text $text $self update_size $self draw $canvas --- 1216,1226 ---- }
! def textbox edit {canvas} { global look font ! set _($canvas:obj_in_edit_old) $self ! set _($canvas:obj_in_edit) 1 ! set @selected? 1 ! .x$canvas.c delete ${self}TEXT ! set @oldtext $@text $self update_size $self draw $canvas *************** *** 1225,1231 **** text $t -height 1 -width [string length $@text] -relief flat \ -bg ${look(objectbg)} -borderwidth 0 \ ! -font [format -*-courier-medium--normal--%d-* $font_size] set _(focus) $self ! bind $t <KeyRelease> "text_key $self $canvas %W %x %y %K %A 0" set @isnew 1 set t .x$canvas.c.${self}text --- 1228,1236 ---- text $t -height 1 -width [string length $@text] -relief flat \ -bg ${look(objectbg)} -borderwidth 0 \ ! -font [format -*-courier-medium--normal--%d-* $font(size)] set _(focus) $self ! bind $t <Key> "text_key $self $canvas %W %x %y %K %A 0" ! bind $t <Control-Return> "text_key $self $canvas %W %x %y 10 %A 0" ! bind $t <Return> "$self unedit $canvas" set @isnew 1 set t .x$canvas.c.${self}text *************** *** 1233,1237 **** -window $t -anchor nw -tags "${self}text $self" $t configure -pady 0 ! $t insert 1.0 $text focus $t } --- 1238,1242 ---- -window $t -anchor nw -tags "${self}text $self" $t configure -pady 0 ! $t insert 1.0 $@text focus $t } *************** *** 1247,1257 **** }
! #-----------------------------------------------------------------------------------# ! class_new objectbox {view} ! def objectbox init {} { set @isnew 1 set @inlets 0 set @outlets 0 ! set canvas $_(focus) set @class "" set @text "" --- 1252,1262 ---- }
! #----------------------------------------------------------------------------------- ! class_new objectbox {textbox} ! def objectbox init {canvas} { set @isnew 1 set @inlets 0 set @outlets 0 ! set @canvas $canvas set @class "" set @text "" *************** *** 1270,1274 **** if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} { set object [lindex $_($canvas:selection) 0] ! $object complete $canvas } foreach obj $_($canvas:selection) { --- 1275,1279 ---- if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} { set object [lindex $_($canvas:selection) 0] ! $object unedit $canvas } foreach obj $_($canvas:selection) { *************** *** 1282,1297 **** $self update_size $self draw $canvas ! text_create $self $canvas $font(size) "" }
! def objectbox complete {canvas} { ! global font ! set @selected? 0 ! set @isnew 0 set c .x$canvas.c set t $c.${self}text ! set obj_name [$t get 1.0 1.end] ! destroy $t $c delete ${self}text $self erase $canvas $self update_size --- 1287,1308 ---- $self update_size $self draw $canvas ! $self edit $canvas }
! def objectbox unedit {canvas} { set c .x$canvas.c set t $c.${self}text ! set @text [$t get 1.0 1.end] $c delete ${self}text + #destroy $t + set l {} + foreach c [split $@text ""] {lappend l [scan $c %c]} + pd ".x$canvas text_setto !$self $l ;" + } + + def objectbox complete2 {canvas} { + global font + set @selected? 0 + set @isnew 0 $self erase $canvas $self update_size *************** *** 1321,1335 **** }
- def objectbox edit {canvas} { - global font - set _($canvas:obj_in_edit_old) $self - set _($canvas:obj_in_edit) 1 - set @isnew 0 - set @selected? 1 - set old_obj_name [.x$canvas.c itemcget ${self}TEXT -text] - .x$canvas.c delete ${self}TEXT - text_create $self $canvas $font(size) $old_obj_name - } - def objectbox click {args} { puts "$self is being clicked in run mode" --- 1332,1335 ---- *************** *** 1613,1617 **** set old_obj [lindex $@selection 0] if {$@select_by == "click"} { ! objectbox_complete $old_obj $self } set @obj_in_edit 0 --- 1613,1617 ---- set old_obj [lindex $@selection 0] if {$@select_by == "click"} { ! $old_obj unedit $self } set @obj_in_edit 0 *************** *** 1655,1661 **** puts "and some object is being edited" if {$@obj_in_edit > 0} { ! [lindex $@selection 0] complete $self set @obj_in_edit 0 ! puts "competing it!" } } --- 1655,1661 ---- puts "and some object is being edited" if {$@obj_in_edit > 0} { ! [lindex $@selection 0] unedit $self set @obj_in_edit 0 ! puts "completing it!" } } *************** *** 2056,2060 **** } # hack ! objectbox_init $x } if {![info exists fields($class)]} {set class obj} --- 2056,2060 ---- } # hack ! objectbox_init $x $_($x:canvas) } if {![info exists fields($class)]} {set class obj} *************** *** 2080,2083 **** --- 2080,2084 ---- def* view wb_activate {args} {} def* view wb_select {args} {} + def* view wb_delete {args} {}
proc item {self canvas suffix type coords args} {