Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15268
Modified Files: Tag: devel_0_39 desire.tk Log Message: more on auto completion
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.202 retrieving revision 1.1.2.203 diff -C2 -d -r1.1.2.202 -r1.1.2.203 *** desire.tk 7 May 2006 23:56:54 -0000 1.1.2.202 --- desire.tk 9 May 2006 15:53:46 -0000 1.1.2.203 *************** *** 1340,1343 **** --- 1340,1344 ---- mset {x1 y1} [$self xy] puts "x1=$x1 y1=$y1" + puts "text === $@text" # puts "!!!!edit = $@edit!!!!" if {$@edit} { *************** *** 3372,3376 **** listbox $f -width 20 -height 10 -relief raised -bg red ! .$@name.c create window [expr $@x+2] [expr $@y+2] \ -window $f -anchor nw -tags "$self" #-window $f -anchor nw -tags "${canvas}Completebox $canvas" --- 3373,3377 ---- listbox $f -width 20 -height 10 -relief raised -bg red ! .$@name.c create window [expr $@x+20] [expr $@y+20] \ -window $f -anchor nw -tags "$self" #-window $f -anchor nw -tags "${canvas}Completebox $canvas" *************** *** 3378,3381 **** --- 3379,3383 ---- bind $f <Button-1> "after 1 "$self focus_switch Up $@textbox $f "" bind $f <KeyPress> "after 1 "$self focus_switch %K $@textbox $f "" + bind $f <Return> "after 1 "$self complete"" bind $@textbox <KeyPress> "after 1 "$self focus_switch %K $@textbox $f "" *************** *** 3384,3396 **** }
def* ClassBrowser focus_switch {key focus1 focus2} { #focus2 = listbox :: focus1 = whatever if {$key != "Down" & $key != "Up"} { if {$@focus == $focus2} { ! if {[regexp {^[a-zA-Z]{1}$} $key]} {.$self.butt.2 insert end $key} } focus $focus1 set @focus $focus1 ! $self fill_box [$focus1 get] $focus2 } else { focus $focus2 --- 3386,3420 ---- }
+ def ClassBrowser complete {} { + puts "complete me!!!!" + + } + def* ClassBrowser focus_switch {key focus1 focus2} { #focus2 = listbox :: focus1 = whatever + if {[regexp {x([0-9a-z]{6,8})text$} $@textbox textself]} { + set cut [string first "text" $textself] + set textself [string range $textself 0 [expr $cut -1]] + } if {$key != "Down" & $key != "Up"} { if {$@focus == $focus2} { ! if {[regexp {^[a-zA-Z]{1}$} $key]} { ! switch $self { ! classbrowser {.$self.butt.2 insert end $key} ! completion { ! puts "textbox ::: $@textbox" ! $focus1 insert 1.end $key ! $textself after_key $@textbox ! } ! } ! ! } } focus $focus1 set @focus $focus1 ! #$self fill_box [$focus1 get] $focus2 ! puts "focus :: $@focus || name :: $self" ! if {$@focus == $focus1 & $self == "completion"} {$textself after_key $@textbox} ! } else { focus $focus2