aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormertz2003-03-24 15:00:07 +0000
committermertz2003-03-24 15:00:07 +0000
commit0b183e91ae36b98f805211b34f099962af875458 (patch)
tree9aea98404103535d78e876c3c731c5bd0ec7783c
parentba28c4b7fc7f45834c8131982d49f4872f7940e7 (diff)
downloadtkzinc-0b183e91ae36b98f805211b34f099962af875458.zip
tkzinc-0b183e91ae36b98f805211b34f099962af875458.tar.gz
tkzinc-0b183e91ae36b98f805211b34f099962af875458.tar.bz2
tkzinc-0b183e91ae36b98f805211b34f099962af875458.tar.xz
passage au nouveau format de gradient (>> 3.2.6h)
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/Zetris.pl10
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-circular.pl18
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-x.pl13
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-y.pl10
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/counter.pl12
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl15
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl3
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/triangles.pl3
8 files changed, 43 insertions, 41 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/Zetris.pl b/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
index 4c9c5e6..bd0ce94 100644
--- a/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
@@ -249,7 +249,7 @@ $tetris->add('rectangle',
[0, 0,$step_x*($width-2) ,$step_y*($height-1)] ,
-filled => 1,
-linewidth => 0,
- -fillcolor => "black:40|gray80:60/90",
+ -fillcolor => "=axial 90 |black;40|gray80;60",
-visible => 1);
my $group = $tetris->add('group', 1, );
@@ -551,7 +551,7 @@ sub rectangle
'arc',$shadow_group,[$xx+10,$yy+10,$xx+$boxsize_x+10,$yy+$boxsize_y+10],
-visible=>1,
-filled=>1,
- -fillcolor => "black:100 0|black:80 20|black:0 100[50 50", # color gradiant
+ -fillcolor => "=path 50 50 |black;100 0|black;80 20|black;0 100", # color gradiant
-linewidth => 0,
-linecolor => 'yellow',
-tags => ["ombre$x-$y"]);
@@ -563,9 +563,9 @@ sub rectangle
'arc',$topgroup,[$xx,$yy,$xx+$boxsize_x,$yy+$boxsize_y],
-visible=>1,
-filled=>1,
- -fillcolor => "white:90|$color:90(-20 -20" ,
+ -fillcolor => "=radial -20 -20 |white;90|$color;90" ,
-linewidth => 1,
- -linecolor => "$color:80",
+ -linecolor => "$color;80",
-tags => ["$x-$y"]);
}
}
@@ -669,7 +669,7 @@ sub delete_line
('rectangle',1,
[$xx, $yy, $xx+$boxsize_x, $yy+$boxsize_y],
-filled => 1,
- -fillcolor => 'orange:50',
+ -fillcolor => 'orange;50',
-tags => ['delline'],
);
}
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
index 0b19921..73c8d4a 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
@@ -16,7 +16,7 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
die "no openGL rendering on this X server" unless $zinc->cget(-render);
-$zinc->add('rectangle', 1, [10, 10, 80, 80], -fillcolor => "red|blue(50 50", -filled => 1);
+$zinc->add('rectangle', 1, [10, 10, 80, 80], -fillcolor => "=radial 50 50 |red |blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -24,7 +24,7 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [120, 20]);
-$zinc->add('arc', 1, [10, 110, 90, 190], -fillcolor => "red:40|blue:40(0 25", -filled => 1);
+$zinc->add('arc', 1, [10, 110, 90, 190], -fillcolor => "=radial 0 25 |red;40|blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -32,7 +32,7 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [120, 120]);
-$zinc->add('arc', 1, [10, 210, 90, 290], -fillcolor => "red:40|green:40 50|blue:40(0 0", -filled => 1);
+$zinc->add('arc', 1, [10, 210, 90, 290], -fillcolor => "=radial 0 0 |red;40|green;40 50|blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -49,16 +49,16 @@ $zinc->add('text', 1,
$zinc->add('rectangle', 1, [10, 340, 690, 590], -fillcolor => "white", -filled => 1);
-$zinc->add('rectangle', 1, [20, 365, 220, 565], -fillcolor => "red:40|green:40 50|blue:40(0 0", -filled => 1);
+$zinc->add('rectangle', 1, [20, 365, 220, 565], -fillcolor => "=radial 0 0 |red;40|green;40 50|blue;40", -filled => 1);
-$zinc->add('arc', 1, [150, 365, 350, 565], -fillcolor => "yellow:40|black:40 50|cyan:40(0 0", -filled => 1);
+$zinc->add('arc', 1, [150, 365, 350, 565], -fillcolor => "=radial 0 0 |yellow;40|black;40 50|cyan;40", -filled => 1);
-$zinc->add('arc', 1, [280, 365, 480, 565], -fillcolor => "black:100|black:100 20|white:40(0 0", -filled => 1, -linewidth => 0);
+$zinc->add('arc', 1, [280, 365, 480, 565], -fillcolor => "=radial 0 0 |black;100|black;100 20|white;40", -filled => 1, -linewidth => 0);
-$zinc->add('arc', 1, [480, 365, 580, 500], -fillcolor => "black:100|white:40(-10 16", -filled => 1);
+$zinc->add('arc', 1, [480, 365, 580, 500], -fillcolor => "=radial -10 16 |black;100|white;40", -filled => 1);
-$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "black:70|white:20(-40 -40", -filled => 1);
-$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "black:70|white:20(40 40", -filled => 1);
+$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=radial -40 -40 |black;70|white;20", -filled => 1);
+$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=radial 40 40 |black;70|white;20", -filled => 1);
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-x.pl b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
index e3a1ea1..679f19e 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-x.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
@@ -15,7 +15,7 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
die "no openGL rendering on this X server" unless $zinc->cget(-render);
-$zinc->add('rectangle', 1, [10,10, 690, 100], -fillcolor => "red|blue", -filled => 1);
+$zinc->add('rectangle', 1, [10,10, 690, 100], -fillcolor => "red | blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -24,7 +24,7 @@ $zinc->add('text', 1,
-position => [20, 20]);
-$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "red:40|blue:40", -filled => 1);
+$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "=axial 0 |red;40|blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -32,7 +32,10 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [20, 120]);
-$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "red:40|green:40 50|blue:40", -filled => 1);
+# we are using here the X explicit notation for rgb color
+# we could also have used CIE encoding. If interested,
+# please read the X man pages
+$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "=axial 0 | rgb:ffff/0/0;40 | rgb:0/ffff/0;40 50 | rgb:0/0/ffff;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -48,9 +51,9 @@ $zinc->add('text', 1,
-position => [20, 320]);
$zinc->add('rectangle', 1, [10, 340, 690, 590], -fillcolor => "white", -filled => 1);
-$zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "red:40|green:40 50|blue:40", -filled => 1);
+$zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "red;40|green;40 50|blue;40", -filled => 1);
-$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "yellow:40|black:40 50|cyan:40", -filled => 1);
+$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "=axial 0 |yellow;40|black;40 50|cyan;40", -filled => 1);
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-y.pl b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
index bc00d0a..b119d0a 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-y.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
@@ -17,7 +17,7 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
die "no openGL rendering on this X server" unless $zinc->cget(-render);
-$zinc->add('rectangle', 1, [10, 10, 690, 100], -fillcolor => "red|blue/90", -filled => 1);
+$zinc->add('rectangle', 1, [10, 10, 690, 100], -fillcolor => "=axial 90 |red |blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -26,7 +26,7 @@ $zinc->add('text', 1,
-position => [20, 20]);
-$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "red:40|blue:40/90", -filled => 1);
+$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "=axial 90|red;40 |blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -34,7 +34,7 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [20, 120]);
-$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "red:40|green:40 50|blue:40/90", -filled => 1);
+$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "=axial 90 |red;40|green;40 50|blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -50,9 +50,9 @@ $zinc->add('text', 1,
-position => [20, 320]);
$zinc->add('rectangle', 1, [10, 340, 690, 590], -fillcolor => "white", -filled => 1);
-$zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "red:40|green:40 50|blue:40/90", -filled => 1);
+$zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "=axial 90 |red;40|green;40 50|blue;40", -filled => 1);
-$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "yellow:40|black:40 50|cyan:40/90", -filled => 1);
+$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "=axial 90 |yellow;40|black;40 50|cyan;40", -filled => 1);
diff --git a/Perl/demos/Tk/demos/zinc_lib/counter.pl b/Perl/demos/Tk/demos/zinc_lib/counter.pl
index 5df227b..7c03047 100644
--- a/Perl/demos/Tk/demos/zinc_lib/counter.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/counter.pl
@@ -29,17 +29,17 @@ my $zinc = $mw->Zinc(-width => 700, -height => 400,
my $r = $zinc->add('rectangle', 1,
[0,0,700,700],
-filled => 1, -linewidth => 0,
- -fillcolor => "red:40|green:40 50|blue:40/90"
+ -fillcolor => "=axial 90 |red;40|green;40 50|blue;40"
);
# The explanation displayed when running this demo
$zinc->add('text', 1,
-position=> [10,10],
- -text => 'This toy-appli shows a simple counter. It is made thanks to clipping
-and contours : this is the only way to do this.
-You can drag the counter. Observe that the colour of the backgound of the
-counter is the same as the one of the window (use of clips)',
- -font => "9x15",
+ -text => 'This toy-appli shows a simple counter. It is made thanks
+to clipping and contours : this is the only way to do this.
+You can drag the counter. Observe that the color of the background
+of the counter is the same as the one of the window (use of clips)',
+ -font => "10x20",
);
###################################################
diff --git a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
index b93ff40..3ba0e79 100644
--- a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
@@ -79,12 +79,13 @@ my @ratio2fontset = ([1.2, 'normal'],
my $mwidth = 700;
my $mheight = 500;
-my %stripstyle = (-gradset => {'idnt' => '#ffffff 0|#ffeedd 30|#e9d1ca 90|#e9a89a/90',
- 'back' => '#c1daff|#8aaaff/0',
- 'shad' => '#000000:50 0|#000000:50 92|#000000:0 100[200 -100',
- 'btn_outside' => '#ffeedd|#8a9acc/0',
- 'btn_inside' => '#ffeedd|#8a9acc/180',
- 'ch1' => '#8aaaff|#5B76ED/0',
+my %stripstyle = (-gradset => {'idnt' => '=axial 90 |#ffffff 0|#ffeedd 30|#e9d1ca 90|#e9a89a',
+ 'back' => '=axial 0 |#c1daff|#8aaaff',
+ ## the following shadow gradient is sub-optimal
+ 'shad' => '=path -40 -40 |#000000;50 0|#000000;50 92|#000000;0 100',
+ 'btn_outside' => '=axial 0 |#ffeedd|#8a9acc',
+ 'btn_inside' => '=axial 180 |#ffeedd|#8a9acc',
+ 'ch1' => '=axial 0 |#8aaaff|#5B76ED',
},
-fontset => {'normal' => {'callsign' => $fnb15,
@@ -405,7 +406,7 @@ sub createStrip {
my %gradiants = %{$style->{'-gradset'}};
my ($name, $gradiant);
while (($name, $gradiant) = each(%gradiants)) {
- # création des gradiants nommés
+ # création des gradients nommés
$zinc->gname($gradiant, $name) unless $zinc->gname($gradiant);
# the previous test is usefull only
# when this script is executed many time in the same process
diff --git a/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl b/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
index 639ccd2..a898a7d 100644
--- a/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
@@ -83,7 +83,6 @@ sub modifyAlpha {
$xrate = 1 if $xrate > 1;
my $alpha = $xrate * 100;
- print "Alpha=$alpha\n";
$zinc->itemconfigure($group, -alpha => $alpha);
}
@@ -97,7 +96,7 @@ sub modifyGradient {
$yrate = 1 if $yrate > 1;
my $gradientpercent = sprintf ("%d", $yrate * 100);
- $zinc->itemconfigure ('letters', -fillcolor => "#ffffff:100 0 28|#66848c:100 $gradientpercent|#7192aa:100 100/270");
+ $zinc->itemconfigure ('letters', -fillcolor => "=axial 270|#ffffff 0 28|#66848c $gradientpercent|#7192aa");
}
diff --git a/Perl/demos/Tk/demos/zinc_lib/triangles.pl b/Perl/demos/Tk/demos/zinc_lib/triangles.pl
index 7114c7e..2f6350f 100644
--- a/Perl/demos/Tk/demos/zinc_lib/triangles.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/triangles.pl
@@ -44,8 +44,7 @@ $zinc->add('text', 1,
my $tr2 = $zinc->clone($tr1);
$zinc->translate($tr2,300,0);
$zinc->itemconfigure($tr2,
-# -colors => ['#00ed00','#ffff00:50','#006aed:50','#e00000:50'], # this lines bugs zincGL 3.2.3b
- -colors => ['white:50', 'yellow:50', 'magenta:50', 'blue:50', 'cyan:50', 'green:50', 'red:50', 'yellow:50'],
+ -colors => ['white;50', 'yellow;50', 'magenta;50', 'blue;50', 'cyan;50', 'green;50', 'red;50', 'yellow;50'],
);