Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31385
Modified Files: Tag: devel_0_39 desire.tk Log Message: stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.108 retrieving revision 1.1.2.109 diff -C2 -d -r1.1.2.108 -r1.1.2.109 *** desire.tk 6 Nov 2005 14:09:28 -0000 1.1.2.108 --- desire.tk 7 Nov 2005 01:09:44 -0000 1.1.2.109 *************** *** 816,820 **** #-----------------------------------------------------------------------------------# # check or uncheck the "edit" menu item ! def* canvas editmode= {mode} { global look .x$self.m.edit entryconfigure "Edit mode" -indicatoron $mode --- 816,821 ---- #-----------------------------------------------------------------------------------# # check or uncheck the "edit" menu item ! def canvas editmode {} {return $@editmode} ! def canvas editmode= {mode} { global look .x$self.m.edit entryconfigure "Edit mode" -indicatoron $mode *************** *** 837,841 **** wm geometry $name $geometry pack [make_button_bar $name.bbar $name] -side top -fill x -expand no ! pack [statusbar_new $self] -side bottom -fill x pack [scrollbar $name.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x pack [scrollbar $name.yscroll -command "$c yview"] -side right -fill y --- 838,843 ---- wm geometry $name $geometry pack [make_button_bar $name.bbar $name] -side top -fill x -expand no ! set @statusbar [statusbar_new $self] ! pack [$@statusbar widget] -side bottom -fill x pack [scrollbar $name.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x pack [scrollbar $name.yscroll -command "$c yview"] -side right -fill y *************** *** 882,885 **** --- 884,888 ---- def* canvas ninlets= {n} {} def* canvas noutlets= {n} {} + def canvas focus {} {return $@focus}
#-----------------------------------------------------------------------------------# *************** *** 887,891 **** def canvas bind {eventtype selector args} { set c .x$self.c ! bind $c $eventtype [concat [list $self $selector] $args ; statusbar_update $self %x %y] }
--- 890,894 ---- def canvas bind {eventtype selector args} { set c .x$self.c ! bind $c $eventtype [concat [list $self $selector] $args ; $self statusbar_draw %x %y] }
*************** *** 1506,1537 ****
#-----------------------------------------------------------------------------------# ! class_new statusbar {yadda}
! proc statusbar_new {self} { ! set f .x$self.stat frame $f -border 2 -relief ridge ! foreach {a b} {pos 15 what 32 mode 4 action 4 sel 4} { ! label $f.$a -width $b -font {courier 9} \ ! -background #cccccc -foreground black -anchor w ! } ! label $f.mode_l -text " Mode: " ! label $f.action_l -text " Action: " ! label $f.sel_l -text " Sel: " ! pack $f.pos -side left ! pack $f.what -side left -padx 8 -fill x -expand yes ! pack $f.mode_l $f.mode $f.action_l $f.action $f.sel_l $f.sel -side left ! return $f }
! def statusbar update {x y} { ! global cmdline ! set c .x$self.c ! set bar .x$self.stat ! set cx [$c canvasx $x] ! set cy [$c canvasy $y] ! $bar.pos configure -text "($cx,$cy)" set tags [$c gettags [lindex [$c find overlapping \ ! [expr $cx-2] [expr $cy-2] [expr $cx+2] [expr $cy+2]] end]] ! foreach {type id} [$self identify_target $cx $cy -1 -1 "g"] {} switch $type { object { --- 1509,1551 ----
#-----------------------------------------------------------------------------------# ! class_new statusbar {view}
! def statusbar widget {} {return .x$@canvas.stat} ! ! def statusbar addw {row a b text args} { ! set f [$self widget] ! if {$text!=""} {eval [concat [list pack [label $f.$row.${a}_l -text $text] -side left] $args]} ! label $f.$row.$a -width $b -font {courier 9} -background #cccccc -foreground black -anchor w ! pack $f.$row.$a -side left ! } ! ! def statusbar init {canvas} { ! set @canvas $canvas ! set f [$self widget] frame $f -border 2 -relief ridge ! pack [frame $f.1] -fill x -expand yes ! pack [frame $f.2] -fill x -expand yes ! $self addw 1 pos 15 "" ! $self addw 1 what 32 "" -padx 8 -fill x -expand yes ! $self addw 1 mode 4 " Mode: " ! $self addw 1 action 4 " Action: " ! $self addw 1 sel 4 " Sel: " ! $self addw 2 wfrom 12 " WireFrom: " ! $self addw 2 wto 12 " WireTo: " }
! def canvas statusbar_draw {x y} {$@statusbar draw $x $y} ! def canvas action {} {return $@action} ! def canvas wire_from {} {return $@wire_from} ! def canvas wire_to {} {return $@wire_to} ! ! def statusbar draw {x y} { ! set c .x$@canvas.c ! set f [$self widget] ! set x [$c canvasx $x] ! set y [$c canvasy $y] set tags [$c gettags [lindex [$c find overlapping \ ! [expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]] end]] ! foreach {type id} [$@canvas identify_target $x $y -1 -1 "g"] {} switch $type { object { *************** *** 1542,1552 **** default {set t "... $tags"} } ! if {[string length $@focus]} { ! set t "focus: $@focus" ! } ! $bar.what configure -text $t ! $bar.mode configure -text [if {$@editmode} {list "Edit"} {list "Run "}] ! $bar.action configure -text $@action ! $bar.sel configure -text [llength $@selection] }
--- 1556,1567 ---- default {set t "... $tags"} } ! if {[string length [$@canvas focus]]} {set t "focus: [$@canvas focus]"} ! $f.1.pos configure -text "($x,$y)" ! $f.1.what configure -text $t ! $f.1.mode configure -text [if {[$@canvas editmode]} {list "Edit"} {list "Run "}] ! $f.1.action configure -text [$@canvas action] ! $f.1.sel configure -text [llength [$@canvas selection]] ! $f.2.wfrom configure -text [$@canvas wire_from] ! $f.2.wto configure -text [$@canvas wire_to] }
*************** *** 1600,1604 **** mset {x1 y1 x2 y2} [$c bbox ${id}o${out}] $c create line [expr ($x1+$x2)/2] [expr ($y1+$y2)/2] $x $y -dash {4 4 4 4} -tags lnew ! set @click_on [list $self $out] set @action wire return --- 1615,1619 ---- mset {x1 y1 x2 y2} [$c bbox ${id}o${out}] $c create line [expr ($x1+$x2)/2] [expr ($y1+$y2)/2] $x $y -dash {4 4 4 4} -tags lnew ! set @wire_from [list $self $out] set @action wire return *************** *** 1652,1665 **** mset {from outlet_number} $@wire_from mset {to inlet_number} $@wire_to ! if {[info exists _($from:o:$outlet_number)]} { ! lappend _($from:o:$outlet_number) $wire_id ! } else { ! set _($from:o:$outlet_number) $wire_id ! } ! if {[info exists _($to:i:$inlet_number)]} { ! lappend _($to:i:$inlet_number) $wire_id ! } else { ! set _($to:i:$inlet_number) $wire_id ! } #puts "d = $d" set offset_wire [expr $offset_wire + 1] --- 1667,1672 ---- mset {from outlet_number} $@wire_from mset {to inlet_number} $@wire_to ! if {[info exists _($from:o:$outlet_number)]} {lappend _($from:o:$outlet_number) $wire_id} else {set _($from:o:$outlet_number) $wire_id} ! if {[info exists _($to:i:$inlet_number)]} {lappend _($to:i:$inlet_number) $wire_id} else {set _($to:i:$inlet_number) $wire_id} #puts "d = $d" set offset_wire [expr $offset_wire + 1] *************** *** 1828,1832 **** $@focus $event $self $key $shift } - statusbar_update $self $x $y }
--- 1835,1838 ---- *************** *** 1840,1844 **** $@focus $event $key $shift } - statusbar_update $self $x $y }
--- 1846,1849 ----