aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos/Tk/demos/zinc_lib/items.pl
diff options
context:
space:
mode:
authormertz2002-04-12 14:29:21 +0000
committermertz2002-04-12 14:29:21 +0000
commitb05097e9938fe2f6ade661127f739dc4fc773f11 (patch)
treeda833d328f44cce8f5c6f7f6938b6a75e98b2436 /Perl/demos/Tk/demos/zinc_lib/items.pl
parent3a42a2ae160d6b14f8c58087546c07a9cc16fd9d (diff)
downloadtkzinc-b05097e9938fe2f6ade661127f739dc4fc773f11.zip
tkzinc-b05097e9938fe2f6ade661127f739dc4fc773f11.tar.gz
tkzinc-b05097e9938fe2f6ade661127f739dc4fc773f11.tar.bz2
tkzinc-b05097e9938fe2f6ade661127f739dc4fc773f11.tar.xz
ajout du reticule dans items
exemples de labelformat + explicites
Diffstat (limited to 'Perl/demos/Tk/demos/zinc_lib/items.pl')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/items.pl56
1 files changed, 37 insertions, 19 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/items.pl b/Perl/demos/Tk/demos/zinc_lib/items.pl
index a6cd5ff..f9a7d8e 100644
--- a/Perl/demos/Tk/demos/zinc_lib/items.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/items.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
# $Id$
# these simple samples have been developped by C. Mertz mertz@cena.fr
@@ -17,12 +17,12 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
)->pack;
$zinc->add('rectangle', 1, [10,10, 100, 50], -fillcolor => "green", -filled => 1,
- -linewidth => 3);
+ -linewidth => 10, -relief => "roundridge", -linecolor => "darkgreen");
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "A filled rectangle with a border of 3 pixels.",
+ -text => "A filled rectangle with a \"roundridge\" relief border of 10 pixels.",
-anchor => 'nw',
-position => [120, 20]);
@@ -31,7 +31,7 @@ my $labelformat = "x82x60+0+0 x60a0^0^0 x32a0^0>1 a0a0>2>1 x32a0>3>1 a0a0^0>2";
my $x=20;
my $y=120;
-my $track=$zinc->add('track', 1, 6, # 6 is the number of field in the flightlabel
+my $track=$zinc->add('track', 1, 6, # 6 is the number of fields in the flightlabel
-labelformat => $labelformat,
-position => [$x, $y],
-speedvector => [40, -10],
@@ -43,10 +43,10 @@ foreach my $i (0..5) { $zinc->coords("$track",[$x+$i*10,$y-$i*2]); }
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "A flight track for a radar display.\n".
- "(A waypoint is very similar, but has no speed neither past positions)",
+ -text => "A flight track for a radar display. (A waypoint looks similar,\n".
+ "but has no speedvector neither past positions)",
-anchor => 'nw',
- -position => [120, 120],
+ -position => [200, 80],
);
$zinc->itemconfigure($track, 0,
@@ -79,23 +79,26 @@ $zinc->itemconfigure($track, 5,
-$zinc->add('arc', 1, [90, 210, 390, 310], -fillcolor => "gray20",
+$zinc->add('arc', 1, [150, 140, 450, 240], -fillcolor => "gray20",
-filled => 0, -linewidth => 1,
-startangle => 45, -extent => 270);
-$zinc->add('arc', 1, [200, 220, 280, 300], -fillcolor => "gray20",
+$zinc->add('arc', 1, [260, 150, 340, 230], -fillcolor => "gray20",
-filled => 0, -linewidth => 1,
-startangle => 45, -extent => 270,
-pieslice => 1, -closed => 1,
+ -linestyle => 'mixed', -linewidth => 3,
);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "Two arcs, starting at 45° with an extent of 270°.",
-anchor => 'nw',
- -position => [250, 250]);
+ -position => [320, 180]);
+
$zinc->add('curve', 1, [10, 324, 24, 300, 45, 432, 247, 356, 128, 401],
- -filled => 0,
+ -filled => 0, -relief => 'roundgroove',
+ # -linewidth => 10, ## BUG with zinc 3.2.3g
);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -104,14 +107,14 @@ $zinc->add('text', 1,
-position => [50, 350]);
# Bug: this bezier does not display with openGL (zinc-perl v3.2.3e)
-$zinc->add('bezier', 1, [310, 324, 324, 300, 345, 432, 547, 356, 428, 401, 534, 407],
+$zinc->add('bezier', 1, [210, 270, 264, 250, 285, 382, 487, 306, 368, 350, 474, 357],
-filled => 0,
);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "An open bezier.",
-anchor => 'nw',
- -position => [450, 320]);
+ -position => [350, 280]);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -136,15 +139,14 @@ foreach my $fieldId (1..5) {
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "3 tabulars of 2 fields,\nattached together",
+ -text => "3 tabulars of 2 fields,\nattached together.",
-anchor => 'nw',
- -position => [310, 480],
+ -position => [510, 380],
);
-#my $labelformat2 = "80x24 a7a1+0+0 f3f1+0+10";
my $labelformat2 = "x72x40 x72a0^0^0 x34a0^0>1";
-my $tabular1 = $zinc->add('tabular', 1, 6, -position => [490,420],
+my $tabular1 = $zinc->add('tabular', 1, 6, -position => [570,250],
-labelformat => $labelformat2,
);
my $tabular2 = $zinc->add('tabular', 1, 6, -connecteditem => $tabular1,
@@ -166,11 +168,27 @@ foreach my $tab ($tabular1, $tabular2, $tabular3) {
$count++;
}
+
+$zinc->add('reticle', 1, -position => [530,550],
+ -firstradius => 20, -numcircles => 6,
+ -period => 2, -stepsize => 20,
+ -brightlinestyle => 'dashed', -brightlinecolor => 'darkred',
+ );
+
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "a reticle of 6 circles.",
+ -anchor => 'nw',
+ -position => [530, 540]);
+
+
+
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "Items not yet demonstrated are map, reticle, group...",
+ -text => "maps, triangles and groups items\nare not demonstrated here.",
-anchor => 'nw',
- -position => [50, 570]);
+ -position => [10, 550]);
+
MainLoop;