Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv406
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
first commit of Canvas find and Canvas find_again
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.474
retrieving revision 1.1.2.475
diff -C2 -d -r1.1.2.474 -r1.1.2.475
*** desire.tk 18 Sep 2006 01:29:50 -0000 1.1.2.474
--- desire.tk 18 Sep 2006 13:21:30 -0000 1.1.2.475
***************
*** 1250,1253 ****
--- 1250,1254 ----
set @name ""
set @folder "???"
+ set @file ""
super {#X obj 666 666 pd} ;# bogus
$self reinit $mess
***************
*** 1404,1408 ****
#-----------------------------------------------------------------------------------#
!
def Canvas bind {eventtype selector args} {
set c [$self widget]
--- 1405,1429 ----
#-----------------------------------------------------------------------------------#
! 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} {
set c [$self widget]
***************
*** 5288,5296 ****
pack [label $f.label -text $label] -side left
balloon $f.label $name
-
eval "entry $f.entry -textvariable _($self:$name) $options"
pack $f.entry -side left
bind $f.entry <Return> "$self ok"
! switch -regexp -- $type {
integer|float|fontsize {
frame $f.b -borderwidth 0
--- 5309,5316 ----
pack [label $f.label -text $label] -side left
balloon $f.label $name
eval "entry $f.entry -textvariable _($self:$name) $options"
pack $f.entry -side left
bind $f.entry <Return> "$self ok"
! switch -regexp -- $type {
integer|float|fontsize {
frame $f.b -borderwidth 0
***************
*** 6131,6134 ****
--- 6151,6174 ----
$self add_fontbomb $f foo
}
+
+ ############ find dialog ###########
+
+ class_new FindDialog {Dialog}
+
+ def FindDialog init {canvas} {
+ super cancel find
+ set @canvas $canvas
+ set @break 0
+ set f .$self
+ $self add $f [list "string" "entry"]
+ focus .find.string.entry
+ }
+
+ def FindDialog find {} {$self ok}
+ def FindDialog ok {} {
+ $@canvas find_string= $@string
+ $@canvas search
+ super
+ }
############ other stuff #########