From 2685c9ed276993781f969ce16351093c29da00d7 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 3 Mar 2004 10:46:30 +0000 Subject: Adjustments for -position --- demos/curveBezier.tcl | 18 ++++++------------ demos/magicLens.tcl | 14 ++++++-------- demos/testGraphics.tcl | 3 +-- 3 files changed, 13 insertions(+), 22 deletions(-) (limited to 'demos') diff --git a/demos/curveBezier.tcl b/demos/curveBezier.tcl index a26f5b8..8531ce0 100644 --- a/demos/curveBezier.tcl +++ b/demos/curveBezier.tcl @@ -46,8 +46,7 @@ $w.zinc add text $group -position {50 20} -anchor w -color $textColor \ -text {Examples of curve items using cubic bezier control points} ## Please note: much of the items below could be computed -set t [$w.zinc add text $group -anchor w -tags bezier1 -color $textColor -width 270] -$w.zinc translate $t 25 270 +$w.zinc add text $group -anchor w -position {25 270} -tags bezier1 -color $textColor -width 270 $w.zinc add curve $group {100 200 100 100} -tags {line1 l1-2} \ -linecolor $barColor -filled 0 -linewidth 2 $w.zinc add curve $group {400 100 400 200} -tags {line1 l3-4} \ @@ -63,8 +62,7 @@ $w.zinc add arc $group {390 90 410 110} -tags {handle1 p3} -filled 1 \ $w.zinc add arc $group {390 190 410 210} -tags {handle1 p4} -filled 1 \ -fillcolor \#BBBBBB -set t [$w.zinc add text $group -anchor w -tags bezier2 -color $textColor -width 270] -$w.zinc translate $t 570 270 +$w.zinc add text $group -anchor w -position {570 270} -tags bezier2 -color $textColor -width 270 $w.zinc add curve $group {600 200 675 100} -tags {line2 l1-2} \ -linecolor $barColor -linewidth 2 $w.zinc add curve $group {975 100 900 200} -tags {line2 l3-4} \ @@ -80,8 +78,7 @@ $w.zinc add arc $group {965 90 985 110} -tags {handle2 p3} -filled 1 \ $w.zinc add arc $group {890 190 910 210} -tags {handle2 p4} -filled 1 \ -fillcolor $handleColor -set t [$w.zinc add text $group -anchor w -tags bezier3 -color $textColor -width 270] -$w.zinc translate $t 25 570 +$w.zinc add text $group -anchor w -position {25 570} -tags bezier3 -color $textColor -width 270 $w.zinc add curve $group {100 500 25 400} -tags {line3 l1-2} \ -linecolor $barColor -linewidth 2 $w.zinc add curve $group {475 400 400 500} -tags {line3 l3-4} \ @@ -97,8 +94,7 @@ $w.zinc add arc $group {465 390 485 410} -tags {handle3 p3} -filled 1 \ $w.zinc add arc $group {390 490 410 510} -tags {handle3 p4} -filled 1 \ -fillcolor $handleColor -set t [$w.zinc add text $group -anchor w -tags bezier4 -color $textColor -width 270] -$w.zinc translate $t 570 570 +$w.zinc add text $group -anchor w -position {570 570} -tags bezier4 -color $textColor -width 270 $w.zinc add curve $group {600 500 600 350} -tags {line4 l1-2} \ -linecolor $barColor -linewidth 2 $w.zinc add curve $group {900 650 900 500} -tags {line4 l3-4} \ @@ -114,8 +110,7 @@ $w.zinc add arc $group {890 640 910 660} -tags {handle4 p3} -filled 1 \ $w.zinc add arc $group {890 490 910 510} -tags {handle4 p4} -filled 1 \ -fillcolor $handleColor -set t [$w.zinc add text $group -anchor w -tags bezier5 -color $textColor -width 270] -$w.zinc translate $t 25 870 +$w.zinc add text $group -anchor w -position {25 870} -tags bezier5 -color $textColor -width 270 $w.zinc add curve $group {100 800 175 700} -tags {line5 l1-2} \ -linecolor $barColor -filled 0 -linewidth 2 $w.zinc add curve $group {325 700 400 800} -tags {line5 l3-4} \ @@ -131,8 +126,7 @@ $w.zinc add arc $group {315 690 335 710} -tags {handle5 p3} -filled 1 \ $w.zinc add arc $group {390 790 410 810} -tags {handle5 p4} -filled 1 \ -fillcolor $handleColor -set t [$w.zinc add text $group -anchor w -tags bezier6 -color $textColor -width 280] -$w.zinc translate $t 570 970 +$w.zinc add text $group -anchor w -position {570 970} -tags bezier6 -color $textColor -width 280 $w.zinc add curve $group {600 800 625 700} -tags {line6 l1-2} \ -linecolor $barColor -linewidth 2 $w.zinc add curve $group {725 700 750 800} -tags {line6 l3-4} \ diff --git a/demos/magicLens.tcl b/demos/magicLens.tcl index b44254b..251a902 100644 --- a/demos/magicLens.tcl +++ b/demos/magicLens.tcl @@ -187,8 +187,8 @@ set zinc [zinc $w.z -render 1 -width 1000 -height 900 -borderwidth 0 \ pack $w.z -fill both -expand yes set imagePath [file join $zinc_library demos images] -set texture [image create photo -file [file join $imagePath paper-grey1.gif]] -set lensTexture [image create photo -file [file join $imagePath paper-grey.gif]] +set texture [image create photo texture -file [file join $imagePath paper-grey1.gif]] +set lensTexture [image create photo lensTexture -file [file join $imagePath paper-grey.gif]] $zinc configure -tile $texture # Create the views @@ -258,10 +258,9 @@ for {set i 0} {$i < 12} {incr i} { # Text of label (% saturation + ZnColor) set txtColor "[expr ((10 - $c)*10)]%\n$color" - set t [$zinc add text $lGroup -priority 200 -position {0 0} \ - -text $txtColor -anchor center -alignment center -font $font8 -spacing 2 \ - -composescale 0] - $zinc translate $t 0 [expr ($c + 1)* 65] + $zinc add text $lGroup -priority 200 -position [list 0 [expr ($c + 1)* 65]] \ + -text $txtColor -anchor center -alignment center -font $font8 -spacing 2 \ + -composescale 0 } incr x 80 @@ -284,12 +283,11 @@ set lensZone [$zinc clone lensback -tags lenszone] $zinc chggroup $lensZone $lensView true $zinc itemconfigure $lensView -clip $lensZone -set consigne [$zinc add text 1 -position {0 0} -font $font8 -alignment left \ +set consigne [$zinc add text 1 -position {30 840} -font $font8 -alignment left \ -color \#ffffff -spacing 2 \ -text ", , and keys or Move the Magic Color Lens behind the color gradiants to see the ZnColor value of Hue/saturation"] -$zinc translate $consigne 30 840 set cClone [$zinc clone $consigne -font $font9b] $zinc chggroup $cClone $infoView diff --git a/demos/testGraphics.tcl b/demos/testGraphics.tcl index 1a9fee1..8c471ab 100644 --- a/demos/testGraphics.tcl +++ b/demos/testGraphics.tcl @@ -2037,8 +2037,7 @@ foreach {shapes tCoords} [zincGraphics::TabBoxCoords {{-315 -210} {315 210}} \ -tabheight 26 -tabwidth {92 100 82 82 82 120 80}] break # to find some images (used as textures) needed by this demo set imagePath [file join $zinc_library demos images] -set texture [image create photo -file [file join $imagePath paper.gif]] - +set texture [image create photo texture -file [file join $imagePath paper.gif]] # création des items zinc correspondants set i 0 set pageNames {Rectangle Hippodrome Polygone Polyline PathLine MultiContours TabBox} -- cgit v1.1