Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20191
Modified Files: Tag: devel_0_39 desire.tk Log Message: huh
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.65 retrieving revision 1.1.2.66 diff -C2 -d -r1.1.2.65 -r1.1.2.66 *** desire.tk 18 Sep 2005 09:58:49 -0000 1.1.2.65 --- desire.tk 18 Sep 2005 12:04:33 -0000 1.1.2.66 *************** *** 1155,1163 **** set c .x$canvas.c $c itemconfigure ${self}BASE -outline $frcol ! if {$@isnew} { $c itemconfigure ${self}BASE -dash {8 8 8 8} } { $c itemconfigure ${self}BASE -dash {} } }
--- 1155,1165 ---- set c .x$canvas.c $c itemconfigure ${self}BASE -outline $frcol ! if {$@valid} { $c itemconfigure ${self}BASE -dash {8 8 8 8} } { $c itemconfigure ${self}BASE -dash {} } + #super $canvas + textbox_draw $self $canvas }
*************** *** 1203,1214 ****
def textbox draw {canvas} { foreach {x1 y1} [$self xy $canvas] {} ! item $self $canvas TEXT create text $x1 $y1 \ ! -font [format -*-courier-medium--normal--%d-* $font] \ ! -text $text -fill $color -anchor nw }
def* textbox edit {canvas} { global look font set _($canvas:obj_in_edit_old) $self set _($canvas:obj_in_edit) 1 --- 1205,1219 ----
def textbox draw {canvas} { + global font look foreach {x1 y1} [$self xy $canvas] {} ! puts "x1=$x1 y1=$y1" ! item $self $canvas TEXT text [list $x1 $y1] \ ! -font [format -*-courier-medium--normal--%d-* $font(size)] \ ! -text $@text -fill $look(objectfg) -anchor nw }
def* textbox edit {canvas} { global look font + set @edit 1 set _($canvas:obj_in_edit_old) $self set _($canvas:obj_in_edit) 1 *************** *** 1226,1230 **** 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 .x$canvas.c create window [expr $@cx+1] [expr $@cy+1] \ --- 1231,1234 ---- *************** *** 1247,1281 **** #----------------------------------------------------------------------------------- class_new objectbox {textbox} ! def objectbox init {canvas} { global font look ! set @isnew 1 set @inlets 0 set @outlets 0 ! set @canvas $canvas set @class "" ! set @text "" set @edit 0 ! $self add $canvas ! if {[info exists _($canvas:selection)]} { ! if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} { ! set object [lindex $_($canvas:selection) 0] ! $object unedit $canvas ! } ! foreach obj $_($canvas:selection) { ! .x$canvas.c itemconfigure ${obj}BASE -outline $look(objectframe3) ! } ! set _($canvas:selection) {} ! } ! set _($canvas:obj_in_edit) 1 ! set _($canvas:selection) {} ! set _($canvas:selection) [linsert $_($canvas:selection) 0 $self] ! $self update_size ! $self draw $canvas ! if {[string length $@text]==0} {$self edit $canvas} }
def* objectbox update_size {} { global font ! set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]+1]+$@isnew)] set @ys [expr $font(pady)+$font(height)] } --- 1251,1282 ---- #----------------------------------------------------------------------------------- class_new objectbox {textbox} ! def objectbox init {args} { global font look ! set @valid 0 set @inlets 0 set @outlets 0 ! #set @canvas "deadbeef" set @class "" ! set @text $args set @edit 0 ! #if {[info exists _($canvas:selection)]} { ! # if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} { ! # set object [lindex $_($canvas:selection) 0] ! # $object unedit $canvas ! # } ! # foreach obj $_($canvas:selection) { ! # .x$canvas.c itemconfigure ${obj}BASE -outline $look(objectframe3) ! # } ! # set _($canvas:selection) {} ! #} ! #set _($canvas:obj_in_edit) 1 ! #set _($canvas:selection) {} ! #set _($canvas:selection) [linsert $_($canvas:selection) 0 $self] ! #puts "new objectbox has text '$@text'" }
def* objectbox update_size {} { global font ! set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]+1]-$@valid)] set @ys [expr $font(pady)+$font(height)] } *************** *** 1288,1292 **** 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]} --- 1289,1293 ---- set @text [$t get 1.0 1.end] $c delete ${self}text ! after 1 "destroy $t" set l {} foreach c [split $@text ""] {lappend l [scan $c %c]} *************** *** 1297,1301 **** global font set @selected? 0 - set @isnew 0 $self erase $canvas $self update_size --- 1298,1301 ---- *************** *** 2037,2051 ****
proc update_object {x d} { ! global _ ! global fields set d [string trimright $d "\n"] set d [string trimright $d ";"] set i 1 set class [lindex $d $i] ! switch -- $class { ! obj { set i 4 ! set class [lindex $d $i] ! set _($x:text) $d }} if {![info exists _($x:_class)]} { --- 2037,2049 ----
proc update_object {x d} { ! global _ fields set d [string trimright $d "\n"] set d [string trimright $d ";"] set i 1 set class [lindex $d $i] ! switch -- $class { obj { set i 4 ! set class [lindex $d 4] ! # puts "_($x:text)=$_($x:text)" }} if {![info exists _($x:_class)]} { *************** *** 2056,2060 **** } # hack ! objectbox_init $x $_($x:canvas) } if {![info exists fields($class)]} {set class obj} --- 2054,2064 ---- } # hack ! set c $_($x:canvas) ! $x init ! set _($x:text) [lindex $d $i end] ! set _($x:valid) 0 ! $x update_size ! $x draw $c ! if {[string length $@text]==0} {$x edit $canvas} } if {![info exists fields($class)]} {set class obj}