Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25371
Modified Files: Tag: desiredata desire.tk TODO Log Message: some fix/improvements on the Find widget
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.156 retrieving revision 1.1.2.600.2.157 diff -C2 -d -r1.1.2.600.2.156 -r1.1.2.600.2.157 *** desire.tk 8 Jan 2007 11:48:30 -0000 1.1.2.600.2.156 --- desire.tk 9 Jan 2007 11:56:46 -0000 1.1.2.600.2.157 *************** *** 1752,1756 **** #-----------------------------------------------------------------------------------# def Canvas find {} { ! if {[info exists ::_(findmodel:_class)]} {focus .$self.find.find} else { FindModel new_as findmodel $self FindView new $self --- 1752,1759 ---- #-----------------------------------------------------------------------------------# def Canvas find {} { ! if {[info exists ::_(findmodel:_class)]} { ! focus .$self.find.find ! findmodel reinit ! } else { FindModel new_as findmodel $self FindView new $self *************** *** 1759,1763 **** } def Canvas find_again {} { ! if {[info exists ::_(findmodel:_class)]} {findmodel search_recursive} }
--- 1762,1766 ---- } def Canvas find_again {} { ! if {[info exists ::_(findmodel:_class)]} {findmodel remove_info;findmodel search_recursive} }
*************** *** 2881,2884 **** --- 2884,2888 ---- set @views {} set @recursive 1 + set @info "" }
*************** *** 2888,2893 **** set @result "" set @results {} } - def FindModel delete {} {foreach view $@views {destroy [$view widget]}; super}
--- 2892,2903 ---- set @result "" set @results {} + $self remove_info + } + def FindModel remove_info {} { + foreach view $@views { + set f [$view widget] + destroy $f.info_l; destroy $f.info + } } def FindModel delete {} {foreach view $@views {destroy [$view widget]}; super}
*************** *** 2906,2911 ****
def FindModel search_recursive {} { ! if {![llength $@next_canvases]} {$self reinit; $self search_recursive; return} ! if {[llength $@results]} {$self result= [lindex $@results 0]; set @results [lreplace $@results 0 0];return} while {$@last_canvas < [llength $@next_canvases]} { set canvas [lindex $@next_canvases $@last_canvas] --- 2916,2921 ----
def FindModel search_recursive {} { ! if {![llength $@next_canvases]} {$self end; return} ! if {[llength $@results]} {$self result= [lindex $@results 0]; set @results [lreplace $@results 0 0];return} while {$@last_canvas < [llength $@next_canvases]} { set canvas [lindex $@next_canvases $@last_canvas] *************** *** 2924,2929 **** set old_canvases $@next_canvases set @next_canvases {} ! foreach canvas $old_canvases { ! foreach x [$canvas get_childcanvas] {lappend @next_canvases $x} } set @last_canvas 0 --- 2934,2941 ---- set old_canvases $@next_canvases set @next_canvases {} ! if {$@recursive} { ! foreach canvas $old_canvases {foreach x [$canvas get_childcanvas] {lappend @next_canvases $x}} ! } else { ! set @next_canvases {} } set @last_canvas 0 *************** *** 2931,2934 **** --- 2943,2955 ---- }
+ def FindModel end {} { + $self reinit + $@orig_canvas deselect_all + set @info " "$@find_string" not found" + foreach view $@views { + $view addw label "info" "info" + } + } + def FindModel cache_results {canvas} { set @results {} *************** *** 2939,2942 **** --- 2960,2964 ---- } if {[llength $@results]} {return 1} else {return 0} + }
*************** *** 2978,2981 **** --- 3000,3004 ---- if {$name == "close"} {bind $f.$name <Return> "findmodel delete"} } + label {label $f.$name -textvariable _(findmodel:info) -font {helvetica -10} -pady 0} } pack $f.$name -side left *************** *** 5169,5173 **** $self changed } ! def AtomBox setto {text} { if { [string is double $text]} { --- 5192,5196 ---- $self changed } ! def AtomBox setto {text} { if { [string is double $text]} {
Index: TODO =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/TODO,v retrieving revision 1.1.2.28.2.28 retrieving revision 1.1.2.28.2.29 diff -C2 -d -r1.1.2.28.2.28 -r1.1.2.28.2.29 *** TODO 8 Jan 2007 11:48:33 -0000 1.1.2.28.2.28 --- TODO 9 Jan 2007 11:56:47 -0000 1.1.2.28.2.29 *************** *** 27,30 **** --- 27,32 ---- [ ] graphical array rendering optimization [x] firefox style find bar + Breadth-first search + [x] add "info" display if no result returned + [x] fix infinite loop if no result returned [x] fix client editor key not showing up [x] the original wire don't delete after object insertion *************** *** 50,59 **** [ ] creating a graph causes crash. [ ] fix NumBox's width and height (or remove those settings) ! [ ] Implement (or fix) Find, Find Again in class Client ! [ ] with ability to search substrings [ ] with ability to search across canvases ! (a) all canvases ! (b) all subcanvases ! (c) only the current one [ ] with regexps [ ] with replace --- 52,61 ---- [ ] creating a graph causes crash. [ ] fix NumBox's width and height (or remove those settings) ! [x] Implement (or fix) Find, Find Again in class Client ! [x] with ability to search substrings [ ] with ability to search across canvases ! [ ] all canvases ! [x] all subcanvases ! [x] only the current one [ ] with regexps [ ] with replace