Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25399
Modified Files: Tag: desiredata desire.tk dzinc.tcl Log Message: dzinc basic drawing
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.408 retrieving revision 1.1.2.600.2.409 diff -C2 -d -r1.1.2.600.2.408 -r1.1.2.600.2.409 *** desire.tk 6 Sep 2007 16:11:58 -0000 1.1.2.600.2.408 --- desire.tk 13 Sep 2007 14:14:41 -0000 1.1.2.600.2.409 *************** *** 4230,4234 **** def SelRect draw {} { $self item RECT line [list $@x1 $@y1 $@x2 $@y1 $@x2 $@y2 $@x1 $@y2 $@x1 $@y1] \ ! -fill black -dash {3 3 3 3} -dashoffset 3 -fill [$self look rect] }
--- 4230,4234 ---- def SelRect draw {} { $self item RECT line [list $@x1 $@y1 $@x2 $@y1 $@x2 $@y2 $@x1 $@y2 $@x1 $@y1] \ ! -fill [$self look rect] -dash {3 3 3 3} -dashoffset 3 }
*************** *** 6795,6800 **** set h1 [list $x1 $y $x2 $y] set v1 [list $x $y1 $x $y2] ! $self item VHAIR1 line $v1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} ! $self item HHAIR1 line $h1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} }
--- 6795,6800 ---- set h1 [list $x1 $y $x2 $y] set v1 [list $x $y1 $x $y2] ! $self item VHAIR1 line $v1 -fill [$@canvas look crosshair] -width 1 -dash {4 4 4 4} ! $self item HHAIR1 line $h1 -fill [$@canvas look crosshair] -width 1 -dash {4 4 4 4} }
*************** *** 6876,6880 **** $self draw_lines $x1 $x2 $y1 $y2 VL $self draw_lines $y1 $y2 $x1 $x2 HL ! $c lower $self $lowest }
--- 6876,6880 ---- $self draw_lines $x1 $x2 $y1 $y2 VL $self draw_lines $y1 $y2 $x1 $x2 HL ! if {$lowest != -1} {$c lower $self $lowest} }
*************** *** 6883,6888 **** for {set i $v1} {$i < $v2} {incr i} { #if {$l%$g == 0} {set width 1;set dash [list 7 1]} {set width 1;set dash [list 1 4 1 4]} ! if {![expr $i % int($s*$g)]} {set w 1;set d [list 7 1]} {set w 1;set d [list 1 4 1 4]} ! if {![expr $i % int($s)]} { switch $tag {VL {set line [list $i $v3 $i $v4]} HL {set line [list $v3 $i $v4 $i]}} $self item ${tag}$i line $line -fill $@col -width $w -dash $d --- 6883,6888 ---- for {set i $v1} {$i < $v2} {incr i} { #if {$l%$g == 0} {set width 1;set dash [list 7 1]} {set width 1;set dash [list 1 4 1 4]} ! if {![expr {$i % int($s*$g)}]} {set w 1;set d [list 7 1]} {set w 1;set d [list 1 4 1 4]} ! if {![expr {$i % int($s)}]} { switch $tag {VL {set line [list $i $v3 $i $v4]} HL {set line [list $v3 $i $v4 $i]}} $self item ${tag}$i line $line -fill $@col -width $w -dash $d *************** *** 6894,6897 **** --- 6894,6898 ---- set c [$self widget] set all [$c find withtag foo] + if {![llength $all]} {return -1} set lowest [lindex [$c gettags [lindex $all 0]] 0] return $lowest
Index: dzinc.tcl =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/dzinc.tcl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dzinc.tcl 13 Aug 2007 07:02:17 -0000 1.1.2.1 --- dzinc.tcl 13 Sep 2007 14:14:43 -0000 1.1.2.2 *************** *** 3,7 ****
class_new Zinc {Thing} ! def Zinc init {} {} def Zinc unknown {args} { upvar 1 selector selector --- 3,9 ----
class_new Zinc {Thing} ! def Zinc init {} { ! set @group [eval old_$self add group 1] ! } def Zinc unknown {args} { upvar 1 selector selector *************** *** 12,16 ****
proc option_replace {argz} { ! set new_args {} foreach {option val} $argz { switch -- $option { --- 14,18 ----
proc option_replace {argz} { ! #set new_args {} foreach {option val} $argz { switch -- $option { *************** *** 21,33 **** lappend new_args $option $val } return $new_args } ! proc canvas {name args} { ! set result [eval [concat [list zinc $name] [option_replace $args]]] Zinc new_as $name return $result }
def Zinc canvasx {val} { return $val --- 23,69 ---- lappend new_args $option $val } + puts "new_args:::: $new_args" return $new_args } ! #.bgerrorDialog.bitmap create oval 0 0 31 31 -fill red -outline black ! #.x80e1c00.c -width 446 -height 296 -background white proc canvas {name args} { ! set result [eval [concat [list zinc $name] [option_replace $args] -highlightthickness 1]] Zinc new_as $name return $result }
+ def Zinc remove {orig mess} { + set idx [lsearch $mess $orig] + if {$idx < 0} {return $mess} + set mess [lreplace $mess $idx $idx+1] + return $mess + } + + + def Zinc replace {orig new mess} { + set idx [lsearch $mess $orig] + if {$idx < 0} {return $mess} + set mess [lreplace $mess $idx $idx $new] + return $mess + } + + def Zinc replace2 {orig new mess} { + set idx [lsearch $mess $orig] + if {$idx < 0} {return $mess} + set mess [lreplace $mess $idx $idx+1] + foreach item [lreverse $new] {set mess [linsert $mess $idx $item]} + return $mess + } + + def Zinc insert {orig new mess} { + set idx [lsearch $mess $orig] + if {$idx < 0} {return $mess} + #set mess [lreplace $mess $idx $idx+1] + foreach item [lreverse $new] {set mess [linsert $mess $idx $item]} + return $mess + } + + def Zinc canvasx {val} { return $val *************** *** 38,45 **** }
def Zinc create {args} { ! puts "create $args" }
def Zinc configure {args} { eval [concat [list old_$self configure] [option_replace $args]] --- 74,143 ---- }
+ def Zinc substitude {args} { + set args [$self replace -width -linewidth $args] + set args [$self replace -fill -linecolor $args] + set args [$self replace2 -dash [list -linestyle dotted] $args] + set args [$self replace -outline -linecolor $args] + set args [$self remove -dashoffset $args] + return $args + } + def Zinc create {args} { ! set i 0 ! foreach item $args { ! if {[regexp {^-} $item]} {break} ! incr i ! } ! switch [lindex $args 0] { ! line { ! set type curve ! set args [$self replace -width -linewidth $args] ! set args [$self replace -fill -linecolor $args] ! set args [$self replace2 -dash [list -linestyle dotted] $args] ! set args [$self remove -dashoffset $args] ! } ! oval { ! set type arc ! set args [$self replace -fill -fillcolor $args] ! set args [$self replace -outline -linecolor $args] ! } ! window { ! set type window ! } ! rectangle { ! set type rectangle ! set args [$self replace -fill -fillcolor $args] ! set args [$self replace -outline -linecolor $args] ! set args [$self replace -width -linewidth $args] ! set args [$self replace2 -dash [list -linestyle dotted] $args] ! } ! text { ! set type text ! set args [$self replace -fill -color $args] ! } ! default { ! puts "UNKNOWN ITEM.. [lindex $args 0]" ! } ! } ! if {$i == 2} { ! set mess [concat $type $@group [lrange $args 1 end]] ! } else { ! set mess [concat $type $@group [list [lrange $args 1 $i-1]] [lrange $args $i end]] ! } ! if {$type == "window" || $type == "text"} {set mess [linsert $mess 2 -position]} ! #puts "mess >> $mess" ! eval [concat [list old_$self add] $mess] }
+ def Zinc itemconfigure {args} { + set mess [$self substitude $args] + eval [concat [list old_$self itemconfig] $mess] + } + + def Zinc coords {args} { + eval [concat [list old_$self coords] [lindex $args 0] [list [lrange $args 1 end]]] + } + + def Zinc configure {args} { eval [concat [list old_$self configure] [option_replace $args]] *************** *** 51,57 ****
def Zinc gettags {args} { ! puts "+++++++++++" ! if {$args == ""} {return} ! puts "-----------" ! eval [concat [list old_$self gettags] $args] } \ No newline at end of file --- 149,157 ----
def Zinc gettags {args} { ! set result {} ;# bogus ! catch {set result [eval [concat [list old_$self gettags] $args]]} ! return $result ! } ! ! def Zinc lower {tag args} { } \ No newline at end of file