[PD-cvs] pd/src desire.tk,1.1.2.600.2.97,1.1.2.600.2.98
chunlee
chunlee at users.sourceforge.net
Mon Dec 18 17:39:26 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2414
Modified Files:
Tag: desiredata
desire.tk
Log Message:
furtuer implementing find/find again
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.97
retrieving revision 1.1.2.600.2.98
diff -C2 -d -r1.1.2.600.2.97 -r1.1.2.600.2.98
*** desire.tk 18 Dec 2006 00:03:34 -0000 1.1.2.600.2.97
--- desire.tk 18 Dec 2006 16:39:22 -0000 1.1.2.600.2.98
***************
*** 1705,1726 ****
def Canvas search {} {
if {$@find_break == [llength $@children]} {set @find_break 0}
for {} {$@find_break < [llength $@children]} {incr @find_break} {
! set children [lindex $@children $@find_break]
! if {[string equal -nocase $_($children:text) $@find_string]} {
! puts "found something at $children"
! $self deselect_all
! $self selection= $children
! incr @find_break
! break
}
}
}
def Canvas find_string= {s} {set @find_string $s}
def Canvas find {} {
! set @find_break 0
FindDialog new_as find $self
}
def Canvas find_again {} {
! if {[info exists @find_string]} {$self search}
}
def Canvas bind {eventtype selector args} {
--- 1705,1743 ----
def Canvas search {} {
if {$@find_break == [llength $@children]} {set @find_break 0}
+ set i $@find_break
for {} {$@find_break < [llength $@children]} {incr @find_break} {
! incr i
! set child [lindex $@children $@find_break]
! if {[[$child class] <= TextBox]} {
! if {[string first $@find_string [$child text] 0] >= 0} {
! $self find_canvas= $self
! set c [$self widget]
! if {[winfo exists $c]} {raise $c} else {$self popup_open; $self changed}
! $self deselect_all
! $self selection= $child
! incr @find_break
! break
! } else {
! if {[$child class] == "Canvas"} {
! $self find_canvas= $child
! $child find_break= 0
! $child find_string= $@find_string
! $child search
! }
! }
}
+ if {$i == [llength $@children]} {set @find_break 0; break}
}
}
def Canvas find_string= {s} {set @find_string $s}
+ def Canvas find_break= {i} {set @find_break $i}; #$used for find again
+ def Canvas find_canvas= {canvas} {set @find_canvas $canvas}; #used for find in nested [pd]
def Canvas find {} {
! $self find_break= 0
! $self find_canvas= $self
FindDialog new_as find $self
}
def Canvas find_again {} {
! if {[info exists @find_string]} {$@find_canvas search}
}
def Canvas bind {eventtype selector args} {
***************
*** 6393,6397 ****
$self cancel
}
! def Dialog cancel {} {foreach x $@nbs {$x delete}; $self delete}
def Dialog close {} {$self delete}
def Dialog apply {} {}
--- 6410,6414 ----
$self cancel
}
! def Dialog cancel {} {if {[info exists @nbs]} {foreach x $@nbs {$x delete}}; $self delete}
def Dialog close {} {$self delete}
def Dialog apply {} {}
More information about the Pd-cvs
mailing list