home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLPS.ZIP / LINEPAT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-01-20  |  1.5 KB  |  65 lines

  1. { LINEPAT.PAS }
  2. { PGL - Turbo Pascal Test Program }
  3. { Line pattern test program }
  4.  
  5. program linepat;
  6. {$R-,S-}
  7. uses Crt, PGL;
  8.  
  9. label
  10. ExitPgm;
  11.  
  12. type
  13.   linestyle = string[20];
  14.  
  15. const
  16.   linepatterns : array[0..8] of linestyle = ( 'SOLID LINE',
  17.                           'HUGE DASH LINE',
  18.                           'LARGE DASH LINE',
  19.                           'MEDIUM DASH LINE',
  20.                           'SMALL DASH LINE',
  21.                           'WIDE DOT LINE',
  22.                           'CLOSE DOT LINE',
  23.                           'DASH DOT LINE',
  24.                           'CENTER LINE'     );
  25.  
  26. var
  27.   ierr,j,y,maxx  : integer;
  28.  
  29. { ****   LinePat main procedure   ****  }
  30. begin
  31.   pgInitDrw( 'LinePat.plt', 2000, 2000, ierr );
  32.   if  ierr <> 0 then
  33.     begin
  34.        Writeln('Error in pgInitDrw' ); 
  35.        goto ExitPgm;
  36.     end;
  37.  
  38.    pgSetTextStyle( pgTRIPLEX );
  39.    pgSetTextJustify( pgCENTER, pgBOTTOM );
  40.    pgSetCharSpacing( 3 );
  41.    pgSetTextScaling( 2, 1, 2, 1 );
  42.  
  43.    maxx := pgGetMaxX;
  44.  
  45.   {  Compare the different line styles.  }
  46.  
  47.    pgSetTextJustify( pgLEFT, pgBOTTOM );
  48.    pgSetColor( 1 );
  49.  
  50.    y := 200;
  51.    FOR j := 0 TO 8 DO
  52.      BEGIN
  53.        Writeln( linepatterns[j] );
  54.        pgSetLineStyle( j, 10 );
  55.        pgSetLineWeight( 50 );
  56.        pgLine( 0, y, maxx DIV 2, y );
  57.        pgDrawTextXY( maxx DIV 2 + 100, y, linepatterns[j] );
  58.        y := y + 200;
  59.      END;
  60.  
  61.    { Close The Drawing File. }
  62.    pgEndDrw ;
  63. ExitPgm:
  64. end.
  65.