From fe6df269930a79ef5deea1bd3cc42104ab5b715b Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 9 Dec 2002 14:20:35 +0000 Subject: *** empty log message *** --- sandbox/contours.tcl | 12 ++++++------ sandbox/smooth.tcl | 8 ++++---- sandbox/testarc.tcl | 6 +++--- sandbox/testbezier.tcl | 4 ++-- sandbox/testbitmaps.tcl | 4 ++-- sandbox/testicon.tcl | 4 ++-- sandbox/testpoly.tcl | 20 ++++++++++++++------ sandbox/testrelief.tcl | 6 +++--- sandbox/testshape.pl | 46 ++++++++++++++++++++++++++++++++++++++++------ sandbox/testshape.tcl | 4 ++-- sandbox/testtext.tcl | 6 +++--- sandbox/testwind.tcl | 6 +++--- sandbox/zinc.tcl | 8 ++++---- 13 files changed, 88 insertions(+), 46 deletions(-) diff --git a/sandbox/contours.tcl b/sandbox/contours.tcl index 7bea39f..ce6d3ac 100644 --- a/sandbox/contours.tcl +++ b/sandbox/contours.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so package require Img set top 1 @@ -28,10 +28,10 @@ set mp [.r add curve $view "" \ -linecolor yellow -fillcolor tan -fillpattern AlphaStipple8 \ -markercolor red -tags "poly" -linewidth $lw -filled t -closed t] -.r contour $mp union $poly -.r contour $mp diff $ellipse -.r contour $mp diff $rect -.r contour $mp union $arc +.r contour $mp add $poly +.r contour $mp addhole $ellipse +.r contour $mp addhole $rect +.r contour $mp add $arc .r itemconfigure $mp -relief raised -visible t .r lower $mp diff --git a/sandbox/smooth.tcl b/sandbox/smooth.tcl index ad34d37..9260f7b 100644 --- a/sandbox/smooth.tcl +++ b/sandbox/smooth.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so package require Img set top 1 @@ -19,10 +19,10 @@ set smooth [.r smooth $points] set fit [.r fit $points 0.1] -set mp [.r add bezier $view $smooth \ +set mp [.r add curve $view $smooth \ -linecolor yellow -fillcolor tan -fillpattern AlphaStipple8 \ -tags "bezier" -linewidth $lw] -set mp2 [.r add bezier $view $fit \ +set mp2 [.r add curve $view $fit \ -linecolor yellow -fillcolor tan -fillpattern AlphaStipple8 \ -tags "bezier" -linewidth $lw] set poly [.r add curve $view $points -marker AtcSymbol9] diff --git a/sandbox/testarc.tcl b/sandbox/testarc.tcl index 09a9c88..b48b537 100644 --- a/sandbox/testarc.tcl +++ b/sandbox/testarc.tcl @@ -1,7 +1,7 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so -#package require Img +load ../tkzinc3.2.so +package require Img set top 1 diff --git a/sandbox/testbezier.tcl b/sandbox/testbezier.tcl index eddb2b9..4b1af0b 100644 --- a/sandbox/testbezier.tcl +++ b/sandbox/testbezier.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so package require Img set top 1 diff --git a/sandbox/testbitmaps.tcl b/sandbox/testbitmaps.tcl index e2e48af..930d935 100644 --- a/sandbox/testbitmaps.tcl +++ b/sandbox/testbitmaps.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so set r [zinc .r -backcolor gray -relief sunken] set top 1 diff --git a/sandbox/testicon.tcl b/sandbox/testicon.tcl index 2e177d3..6c1b8bf 100644 --- a/sandbox/testicon.tcl +++ b/sandbox/testicon.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so package require Img set top 1 diff --git a/sandbox/testpoly.tcl b/sandbox/testpoly.tcl index 09209e8..0b3edf7 100644 --- a/sandbox/testpoly.tcl +++ b/sandbox/testpoly.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so package require Img set top 1 @@ -30,7 +30,7 @@ set show {\ {round round t 0 flat Fill}\ {round round t 1 flat FillBorder}} -image create photo logo -file /usr/share/toccata/images/logo.gif +image create photo logo -file logo.gif #image create photo papier -file /usr/share/toccata/images/dgtexture-dragstrip.xpm set r [zinc .r -backcolor gray -relief sunken -render 0] @@ -57,17 +57,25 @@ set y [expr [lindex $bbox 1] + 5] # # Now clone for each variation on the polygon # +proc linecol { relief } { + if {[string compare $relief flat]} { + return yellow + } else { + return tan + } +} + set col 0 set row 0 foreach current $show { foreach {cap join filled border relief title} $current { set grp [.r clone $model] .r translate $grp [expr $col * 240] [expr $row * (-290 - (2 * $lw))] - .r itemconfigure [.r find withtag "poly" $grp] \ + .r itemconfigure [.r find withtag "$grp*poly"] \ -capstyle $cap -joinstyle $join -filled $filled \ -linewidth [expr $border ? $lw : 0] -relief $relief \ - -linecolor [expr $relief == flat ? yellow : tan] - .r itemconfigure [.r find withtag "title" $grp] -text $title + -linecolor [linecol $relief] + .r itemconfigure [.r find withtag "$grp*title"] -text $title incr col if {$col >= 4} { set col 0 diff --git a/sandbox/testrelief.tcl b/sandbox/testrelief.tcl index 782a0f1..e75cc71 100644 --- a/sandbox/testrelief.tcl +++ b/sandbox/testrelief.tcl @@ -1,11 +1,11 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.2.so +load ../tkzinc3.2.so set top 1 set lw 8 -set r [zinc .r -backcolor gray -relief sunken -lightangle 120 -render 1] +set r [zinc .r -backcolor gray -relief sunken -lightangle 120 -render 0] pack .r -expand t -fill both .r configure -width 1024 -height 800 .r scale $top 1 -1 diff --git a/sandbox/testshape.pl b/sandbox/testshape.pl index a55de42..0d225cc 100644 --- a/sandbox/testshape.pl +++ b/sandbox/testshape.pl @@ -14,6 +14,13 @@ $zinc = $mw->Zinc(-render => 1, $zinc->pack(-expand => 1, -fill => 'both'); $zinc->configure(-width => 500, -height => 500); +$zinc->gname('white:40 0 60|black 50|white 100(0 0', 'oeil'); +$zinc->gname('white:0 0 10|black:100 100/0', 'oeil2'); +$zinc->gname('white:100|black:100(-35 -25', 'boule'); +$zinc->gname('white:100|black:100(-15 -100', 'arrondi'); +$zinc->gname('white:100|black:100/45', 'cyl'); +$zinc->gname('white|black[50 0', 'path'); + # $arc = $zinc->add('arc', $top, [50, 50, 200, 100], # -visible => 0); #$zinc->itemconfigure($top, -clip => $arc); @@ -26,11 +33,38 @@ $view = $zinc->add('group', $top, -tags => "controls"); # -closed => 1, # -filled => 1); -$arc = $zinc->add('arc', $view, [90,0, 160,50], +$g1 = $zinc->add('group', $view); +$zinc->translate($g1, 100, 300); +$rect = $zinc->add('rectangle', $g1, [-40,-50, 40,50], + -filled => 1, + -fillcolor => 'path' + ); +$g2 = $zinc->add('group', $view); +$zinc->translate($g2, 200, 300); +$arc = $zinc->add('arc', $g2, [0,0, 100,100], + -filled => 1, + -linecolor => 'white', + -fillcolor => 'boule', + -startangle => 120, + -extent => 120, + -closed => 1, + -pieslice => 1, +# -fillcolor => 'tan' + ); +$arc2 = $zinc->add('arc', $view, [90,0, 160,50], + -visible => 0, + -linewidth => 0, + -filled => 1, + -fillcolor => 'brown'); +$g3 = $zinc->add('group', $view); +$zinc->translate($g3, 300, 300); +$cv3 = $zinc->add('curve', $g3, [[-50, -40], [0, 0], [-50, 40], [50, 40], [50, -40]], -visible => 0, - -linewidth => 0, -filled => 1, - -fillcolor => 'brown'); + -fillcolor => "#ffffff:100 0 28|#66848c:100 80|#7192aa:100 100/270" +# -fillcolor => 'cyl' +); + # $rect = $zinc->add('rectangle', $view, [200,230, 220,250], # -visible => 1, # -linewidth => 2, @@ -48,7 +82,7 @@ $cv2 = $zinc->add('curve', $view, [], -filled => 1); $text = $zinc->add('text', $view, -visible => 1, - -text => 'Un Texte ICI', + -text => 'Un Texte ICI°°°°°', -position => [200, 100], -color => '#008000'); $zinc->contour($cv2, 'add', [[20, 20], [20, 100, 'c'], [120, 100], [120, 20]]); @@ -58,7 +92,7 @@ $zinc->contour($cv2, 'addhole', [90, 70, 150, 70, 150, 150, 90, 150]); $zinc->contour($cv2, 'add', [200, 200, 200, 220, 220, 220, 220, 200]); $zinc->contour($cv2, 'addhole', [100, 10, 180, 10, 180, 60, 100, 60]); -$zinc->contour($cv2, 'add', $arc); +$zinc->contour($cv2, 'add', $arc2); $zinc->contour($cv2, 'add', $text); # $rect2 = $zinc->add('rectangle', $view, [40,81, 80,130], @@ -82,8 +116,8 @@ $zinc->Tk::bind('', sub {my ($x,$y,$c) = $zinc->coords($cv2, 0, 1); $zinc->Tk::bind('<1>', sub { my $ev = $zinc->XEvent(); my $it = $zinc->find('closest', $ev->x, $ev->y); - my @t = $zinc->vertexat($it, $ev->x, $ev->y); print "Closest: $it\n"; + my @t = $zinc->vertexat($it, $ev->x, $ev->y); print "VertexAt: ", join(', ', @t), "\n"; }); diff --git a/sandbox/testshape.tcl b/sandbox/testshape.tcl index b0a5b6d..2ed5327 100644 --- a/sandbox/testshape.tcl +++ b/sandbox/testshape.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load /pii/packages/common/zinc/tkzinc_debug3.2.so +load ../tkzinc3.2.so set top 1 diff --git a/sandbox/testtext.tcl b/sandbox/testtext.tcl index 9b41d4d..0d0683c 100644 --- a/sandbox/testtext.tcl +++ b/sandbox/testtext.tcl @@ -1,7 +1,7 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.2.so -#package require Img +load ../tkzinc3.2.so +package require Img set mask "/usr/X11R6/include/X11/bitmaps/fvwm.xbm" diff --git a/sandbox/testwind.tcl b/sandbox/testwind.tcl index 8ad97e0..5ff7f76 100644 --- a/sandbox/testwind.tcl +++ b/sandbox/testwind.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/wish -f +#!/usr/local/bin/wish -f -load tkzinc3.1.so +load ../tkzinc3.2.so set top 1 @@ -11,7 +11,7 @@ pack .r -expand t -fill both .r addtag controls withtag $top set ent [entry .r.entry] -set wind [.r add window $top -window $ent -position "100 100" +set wind [.r add window $top -window $ent -position "100 100"] set container [frame .r.cont -container t] set id [winfo id $container] diff --git a/sandbox/zinc.tcl b/sandbox/zinc.tcl index e959022..6f632db 100644 --- a/sandbox/zinc.tcl +++ b/sandbox/zinc.tcl @@ -1,7 +1,7 @@ -#!/usr/bin/wish8.0 -f +#!/usr/local/bin/wish -f -load tkzinc3.2.so -#package require Img +load ../tkzinc3.2.so +package require Img set top 1 @@ -96,7 +96,7 @@ set track [.r add track $view 6 -tags track -leaderanchors "|0|0"] -markercolor salmon .r itemconfigure $track -labelformat "120x40 l0l0+0+0 x80x20+0+0 x40x20+80+0 x40x20+0+20 x20x20>3>2 x60x20>1>1" .r itemconfigure $track 0 -filled 1 -backcolor gray -bordercolor gray -relief groove -.r itemconfigure $track 1 -filled 1 -backcolor tan -bordercolot tan -relief groove \ +.r itemconfigure $track 1 -filled 1 -backcolor tan -bordercolor tan -relief groove \ -font "cenapii-etiquette-m17" -text "AFR451" .r itemconfigure $track 2 -text "WPY" \ -font "cenapii-etiquette-m17" -- cgit v1.1