Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29061
Modified Files: Tag: devel_0_39 desire.tk Log Message: cleaned up ClassBrowser key a bit, hope nothing got brok...
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.520 retrieving revision 1.1.2.521 diff -C2 -d -r1.1.2.520 -r1.1.2.521 *** desire.tk 19 Oct 2006 23:50:04 -0000 1.1.2.520 --- desire.tk 20 Oct 2006 00:37:01 -0000 1.1.2.521 *************** *** 5548,5555 ****
def ClassBrowser key {key {shift 0}} { - 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]] - } switch -regexp -- $key { Up|Down { --- 5548,5551 ---- *************** *** 5579,5626 **** switch $self { browser {$self fill_box [$@textbox get]} ! completion { ! $self adjust_box ! #$self fill_box [$@textbox get 1.0 1.end] ! #.$self.comp configure -width $@width ! } } } default { ! if {[focus] == $@listbox} { ! if {[regexp {^[a-zA-Z0-9~/._]{1}$} $key]} { ! switch $self { ! browser { ! .$self.butt.2 insert end $key ! $self fill_box [$@textbox get] ! } ! completion { ! $@textbox insert 1.end $key ! $textself after_key $@textbox ! #$self fill_box [$@textbox get 1.0 1.end] ! #.$self.comp configure -width $@width ! $self adjust_box ! focus $@textbox ! } ! } ! } ! } ! switch $self { ! browser { ! if {[focus] == $@listbox} {return} else {$self fill_box [$@textbox get]} ! } ! completion { ! if {[focus] == $@textbox & $key != "Tab"} { ! if {[winfo exists .$self]} { ! #$self fill_box [$@textbox get 1.0 1.end] ! #.$self.comp configure -width $@width ! $self adjust_box ! } ! #hum, no idea why i need after 1 for it to work... ! after 1 $textself after_key $@textbox ! } ! } ! } } } }
--- 5575,5611 ---- switch $self { browser {$self fill_box [$@textbox get]} ! completion {$self adjust_box} } } default { ! $self key_default $key ! } ! } ! } ! ! def Browser key_default {key} { ! if {[focus] == $@listbox} { ! if {[regexp {^[a-zA-Z0-9~/._]{1}$} $key]} { ! .$self.butt.2 insert end $key ! $self fill_box [$@textbox get] } } + if {[focus] == $@listbox} {return} else {$self fill_box [$@textbox get]} + } + + def Completion key_default {key} { + if {[focus] == $@listbox} { + if {[regexp {^[a-zA-Z0-9~/._]{1}$} $key]} { + $@textbox insert 1.end $key + $@textself after_key $@textbox + $self adjust_box + focus $@textbox + } + } + if {[focus] == $@textbox & $key != "Tab"} { + $self adjust_box + #hum, no idea why i need after 1 for it to work... + after 1 $@textself after_key $@textbox + } }