Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15878
Modified Files: Tag: desiredata desire.tk Log Message: more on FindBar
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.139 retrieving revision 1.1.2.600.2.140 diff -C2 -d -r1.1.2.600.2.139 -r1.1.2.600.2.140 *** desire.tk 26 Dec 2006 18:50:18 -0000 1.1.2.600.2.139 --- desire.tk 26 Dec 2006 22:55:35 -0000 1.1.2.600.2.140 *************** *** 1785,1789 **** if {[winfo exists .$self.yscroll]} {set w .$self.yscroll} else {set w .$self.c} if {[winfo exists .$self.find]} { ! focus .$self.find.text } else { set @findbar [FindBar new $self] --- 1785,1789 ---- if {[winfo exists .$self.yscroll]} {set w .$self.yscroll} else {set w .$self.c} if {[winfo exists .$self.find]} { ! focus .$self.find.find } else { set @findbar [FindBar new $self] *************** *** 2879,2903 **** def FindBar widget {} {return .$@canvas.find}
! def FindBar addw {type label args} { set f [$self widget] if {$label!=""} { ! eval [concat [list pack [label $f.${type}_l -text $label -font {helvetica -10} -pady 0] -side left]] } switch $type { text { ! text $f.$type -height 1 -width 10 -relief flat -bg white -borderwidth 0 \ -highlightthickness 0 ! pack $f.$type -side left ! bind $f.$type <Escape> "$self remove" } checkbutton { ! checkbutton $f.$type ! pack $f.$type -side left } button { ! button $f.$type -border 1 -command "$self remove" -image icon_close -width 9 -height 9 ! pack $f.$type -side left } } }
--- 2879,2904 ---- def FindBar widget {} {return .$@canvas.find}
! def FindBar addw {type name label} { set f [$self widget] if {$label!=""} { ! eval [concat [list pack [label $f.${label}_l -text ${label}: -font {helvetica -10} -pady 0] -side left]] } switch $type { text { ! entry $f.$name -width 10 -relief flat -bg white -borderwidth 0 \ -highlightthickness 0 ! bind $f.$name <Escape> "$self remove" ! bind $f.$name <Return> "$self find" } checkbutton { ! checkbutton $f.$name } button { ! button $f.$name -border 1 -command "$self remove" -image icon_close -width 9 -height 9 ! if {$name == "close"} {bind $f.$name <Return> "$self remove"} } } + pack $f.$name -side left + bind $f.$name <Tab> "$self traversal %K %W forward" }
*************** *** 2911,2951 **** super set @canvas $canvas set f [$self widget] frame $f -border 1 -relief ridge ! $self addw text "Find:" "" ! $self addw checkbutton "Recursive:" "" ! $self addw button "Close" "" ! focus $f.text }
! def FindBar draw {x y} { ! if {$x == "??"} {return} ! set c [$@canvas widget] ! set f [$self widget] ! set zoom [$@canvas zoom] ! set x [expr [$c canvasx $x]/$zoom] ! set y [expr [$c canvasy $y]/$zoom] ! set tags [$c gettags [lindex [$c find overlapping \ ! [expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]] end]] ! set target [$@canvas identify_target $x $y -1] ! mset {type id detail} $target ! set t $target ! switch -- $type { ! object { ! if {[info exists _($id:pdclass)]} {set class $_($id:pdclass)} {set class unknown} ! append t " [$class]" ! } ! } ! set action [$@canvas action] ! if {[regexp ^o $action]} {set action [$action class]} ! if {[string length [$@canvas focus]]} {set t "focus: [$@canvas focus]"} ! $f.px configure -text [format "%4d" [expr round($x)]] ! $f.py configure -text [format "%4d" [expr round($y)]] ! $f.what configure -text $t ! $f.action configure -text $action ! $f.sel configure -text [llength [$@canvas selection]] ! $f.focus configure -text [$@canvas focus] }
def Canvas index {child} { --- 2912,2937 ---- super set @canvas $canvas + set @break 0 set f [$self widget] frame $f -border 1 -relief ridge ! $self addw button "close" "" ! $self addw text "find" "find" ! $self addw checkbutton "recursive" "recursive" ! focus $f.find }
! def FindBar find {} { ! set f [$self widget] ! set @string [$f.find get] ! $@canvas find_string= $@string ! $@canvas search ! focus .$@canvas.c }
+ def FindBar traversal {k w direction} { + set f [$self widget] + if {$w == "$f.recursive"} {set next $f.close} else {set next [tk_focusNext $w]} + focus $next + }
def Canvas index {child} { *************** *** 6613,6617 ****
def Dialog traversal {k w direction} { - #puts "$k $w $direction" switch $direction { forward {focus [tk_focusNext $w]} --- 6599,6602 ----