From b54c2e3875bdf007b1b216e946a34c36b2d57224 Mon Sep 17 00:00:00 2001 From: mertz Date: Tue, 24 Jun 2003 15:12:32 +0000 Subject: Some slight cleaning of Graphics in function names, export etc.... --- Perl/demos/Tk/demos/zinc_lib/testGraphics.pl | 32 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'Perl/demos/Tk') diff --git a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl index c79ace0..55a5516 100644 --- a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl +++ b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl @@ -11,7 +11,7 @@ use Tk; use Tk::Zinc; -use Graphics; +use Zinc::Graphics; use Getopt::Long; use strict 'vars'; @@ -23,9 +23,11 @@ my ($dx, $dy); my $tabanchor = 'n'; my $tabalign = 'left'; -my $font_9b = '-cenapii-bleriot mini-bold-r-normal--9-90-75-75-p-75-iso8859-15'; +my $font_9b = '8x13bold'; +# the original font is not standard, even if it is fully free: +# my $font_9b = '-cenapii-bleriot mini-bold-r-normal--9-90-75-75-p-75-iso8859-15'; -my %gradset = (# gradiants zinc +my %gradset = (# gradients zinc 'boitonglet' => '=axial 0|#ff7777|#ffff99', 'roundrect1' => '=axial 270|#a7ffa7;70 0|#ffffff;90 5|#00bd00;80 8|#b7ffb7;50 80|#ffffff;70 91|#00ac00;70 95|#006700;60 100', 'roundrect2' => '=axial 270|#00bd00;80 |#d7ffd7;60', @@ -1329,8 +1331,8 @@ my $zinc = $mw->Zinc(-render => 1, $zinc->pack(-fill => 'both', -expand => 1); -# initialise les gradiants nommés -&setGradiants($zinc, \%gradset); +# initialise les gradients nommés +&setGradients($zinc, \%gradset); # initialise les images de fontes while (my ($anchor, $table) = each(%tabtable)) { @@ -1356,7 +1358,7 @@ $zinc->add('text', 1, ); # Création des pages d'exemples -my ($shapes, $tcoords) = &TabBoxCoords([[-315, -210],[315, 210]], +my ($shapes, $tcoords) = &tabBoxCoords([[-315, -210],[315, 210]], -numpages => 7, -overlap => 2, -radius => 8, @@ -1514,11 +1516,15 @@ sub selectDivider { if ($divname eq 'div2') { my $fontname = $tabtable{$tabanchor}->{'-names'}->[$numpage]; - my $fontimage = $tabtable{$tabanchor}->{'-images'}->[$numpage]; - $zinc->itemconfigure("($divname && fontname)", -text => $fontname); + my $firstLetter = substr($fontname,0,1); + my $lcFirstLetter = lc($firstLetter); +# my $fontimage = $tabtable{$tabanchor}->{'-images'}->[$numpage]; + $zinc->itemconfigure("($divname && fontname)", + -text => $fontname. + ("\n".($firstLetter x 20)."\n". ($lcFirstLetter x 20))x4); $zinc->raise("($divname && fontname)"); - $zinc->itemconfigure("($divname && fontimage)", -image => $fontimage); - $zinc->raise("($divname && fontimage)"); +# $zinc->itemconfigure("($divname && fontimage)", -image => $fontimage); +# $zinc->raise("($divname && fontimage)"); } } @@ -1555,7 +1561,7 @@ sub clickSelector { -overlap => 3, ); - my ($shapes, $tcoords) = &TabBoxCoords([[-240, -140], [240, 120]], %tabparams); + my ($shapes, $tcoords) = &tabBoxCoords([[-240, -140], [240, 120]], %tabparams); for (my $index = 7; $index >= 0; $index--) { my $divgroup = $zinc->group("(div2 && $index && intercalaire)"); @@ -1647,7 +1653,7 @@ sub buildTabBox { my $coords = delete $style->{'-coords'}; my $table = $tabtable{$style->{'-anchor'}}; my $titles = $style->{'-tabtitles'}; - my ($shapes, $tcoords, $invert) = &TabBoxCoords($coords, %{$style}); + my ($shapes, $tcoords, $invert) = &tabBoxCoords($coords, %{$style}); my $k = ($invert) ? scalar @{$shapes} : -1; foreach my $shape (reverse @{$shapes}) { $k += ($invert) ? -1 : +1; @@ -1682,7 +1688,7 @@ sub buildTabBox { -text => $table->{'-names'}->[0], -font => $font_9b, -alignment => 'left', - -anchor => 'w', + -anchor => 'nw', -color => '#000000', -priority => 500, -tags => [$tags[0], 'fontname'], -- cgit v1.1