Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8937
Modified Files: Tag: desiredata desire.tk Log Message: removed @obj_in_edit and fixed some other small bugs due to relying on dead objects not being really dead.
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.80 retrieving revision 1.1.2.600.2.81 diff -C2 -d -r1.1.2.600.2.80 -r1.1.2.600.2.81 *** desire.tk 14 Dec 2006 02:19:07 -0000 1.1.2.600.2.80 --- desire.tk 14 Dec 2006 04:39:52 -0000 1.1.2.600.2.81 *************** *** 1022,1026 **** def Menuable altkey {x y key iso shift} { set key [if {$shift} {string toupper $key} {string tolower $key}] ! set key "Alt+$key set cmd [$self getkey $key] if {[string length $cmd]} {$self eval% "%W $cmd"} else {post "unknown key $key"} --- 1022,1026 ---- def Menuable altkey {x y key iso shift} { set key [if {$shift} {string toupper $key} {string tolower $key}] ! set key "Alt+$key" set cmd [$self getkey $key] if {[string length $cmd]} {$self eval% "%W $cmd"} else {post "unknown key $key"} *************** *** 1093,1100 **** return $::look($::look_cache($@_class:$k):$k) } - #def View look {k} { - # if {[catch {set r $::look_cache($@_class:$k)}]} {set r [$self look_cache $k]} - # return $::look($r:$k) - #}
def View init {} { --- 1093,1096 ---- *************** *** 1168,1176 **** def View draw {} {}
! def View delete {} { ! # if {[$self class] == "Canvas"} { ! # } else {$self erase} ! $self erase ! } def View erase {} {$self item_delete} def View selected? {} {return $@selected?} --- 1164,1168 ---- def View draw {} {}
! def View delete {} {$self erase; super} def View erase {} {$self item_delete} def View selected? {} {return $@selected?} *************** *** 1464,1468 **** set @bbox {0 0 100 100} set @children {} - set @obj_in_edit {} set @dehighlight {} set @wires {} --- 1456,1459 ---- *************** *** 2070,2076 **** }
- def Canvas obj_in_edit {} {return @obj_in_edit} - def Canvas obj_in_edit= {v} {set @obj_in_edit $v} - def TextBox edit {} { if {$@edit} {return} --- 2061,2064 ---- *************** *** 2086,2095 **** # stores which line is the longest if multiple line set @longline 1 - $@canvas obj_in_edit= $self set @selected? 1 $c delete ${self}TEXT $self update_size set font_str [$self look font] ! set new_size [format %.0f [expr [lindex $font_str 1]*$_($@canvas:zoom)]] set font_str [lreplace $font_str 1 1 $new_size] set l {};set nl 1;set newline {-1};set i 0;set width 0 --- 2074,2082 ---- # stores which line is the longest if multiple line set @longline 1 set @selected? 1 $c delete ${self}TEXT $self update_size set font_str [$self look font] ! set new_size [format %.0f [expr [lindex $font_str 1]*[$@canvas zoom]]] set font_str [lreplace $font_str 1 1 $new_size] set l {};set nl 1;set newline {-1};set i 0;set width 0 *************** *** 2101,2104 **** --- 2088,2092 ---- if {[string length $line] > $width} {set width [string length $line]} } + # in the future, this could have -bg [$self look bgedit] text $t -height $nl -width $width -relief flat -bg [$self look bg] -borderwidth 0 \ -highlightthickness 0 -font $font_str -fg [$self look fg] -insertbackground [$self look fg] *************** *** 2107,2110 **** --- 2095,2099 ---- bind $t <Return> "$self unedit" bind $t <Escape> "$self unedit 0" + bind $t <FocusOut> "$self unedit" mset {cx cy} [$self xy] $self item text window [l+ $@textoffset [$self xy]] \ *************** *** 2281,2284 **** --- 2270,2274 ---- set l {} foreach char [split $@text ""] {lappend l [scan $char %c]} + $@canvas selection-= [list $self] netsend [list .$@canvas text_setto $self $l] [list $@canvas new_object_callback] if {[$@canvas action] == "insert"} { *************** *** 2305,2309 **** def TextBox unedit {{accept 1}} { if {!$@edit} {return} - #if {!$accept} {$@canvas del [$@canvas children_idx $self]} set @edit 0; $self changed edit set c [$@canvas widget] --- 2295,2298 ---- *************** *** 2448,2452 **** $x delete } - set @obj_in_edit {} # don't use $self selection= here, otherwise it might call changed on deleted stuff.. set @selection {} --- 2437,2440 ---- *************** *** 2505,2509 **** Right { $self quadrant -1 -1; return } } ! super $key $iso $shift }
--- 2493,2497 ---- Right { $self quadrant -1 -1; return } } ! super $x $y $key $iso $shift }
*************** *** 2690,2693 **** --- 2678,2686 ---- set stack [$c find overlapping [expr $cx-2] [expr $cy-2] [expr $cx+2] [expr $cy+2]]
+ # reversing the stack is necessary for some things + # not reversing the stack is also necessary for some other things + # we have to figure out something. + set stack [lreverse $stack] + foreach tag $stack { set tags [$c gettags $tag] *************** *** 3238,3242 **** if {$f&8} {if {$id == ""} {set id $self}; $self right_click $id $x $y; return} if {!$@editmode} {$self run_click $id $x $y $f $target; return} - #if {[llength $@obj_in_edit]} {$@obj_in_edit unedit; set @obj_in_edit {}} set in_selection [expr [lsearch $@selection $id]>=0] switch $type { --- 3231,3234 ---- *************** *** 3272,3276 **** 0 { if {[lsearch $@selection $id] < 0 || [llength $@selection] == 0} { - if {[llength $@obj_in_edit]} {$@obj_in_edit unedit; set @obj_in_edit {}} $self deselect_all $self selection+= $id --- 3264,3267 ---- *************** *** 3322,3326 **** $self click_deselect_io } - if {[llength $@obj_in_edit]} {$@obj_in_edit unedit; set @obj_in_edit {}} switch $@action { edit {} --- 3313,3316 ---- *************** *** 3349,3353 **** if {$@editmode} { switch $@action { ! edit {set @obj_in_edit $id; $id edit; set @action none; $id changed action} move {$self unclick_move} none {} --- 3339,3343 ---- if {$@editmode} { switch $@action { ! edit {$id edit; set @action none; $id changed action} move {$self unclick_move} none {}