home *** CD-ROM | disk | FTP | other *** search
- { LINEPAT.PAS }
- { PGL - Turbo Pascal Test Program }
- { Line pattern test program }
-
- program linepat;
- {$R-,S-}
- uses Crt, PGL;
-
- label
- ExitPgm;
-
- type
- linestyle = string[20];
-
- const
- linepatterns : array[0..8] of linestyle = ( 'SOLID LINE',
- 'HUGE DASH LINE',
- 'LARGE DASH LINE',
- 'MEDIUM DASH LINE',
- 'SMALL DASH LINE',
- 'WIDE DOT LINE',
- 'CLOSE DOT LINE',
- 'DASH DOT LINE',
- 'CENTER LINE' );
-
- var
- ierr,j,y,maxx : integer;
-
- { **** LinePat main procedure **** }
- begin
- pgInitDrw( 'LinePat.plt', 2000, 2000, ierr );
- if ierr <> 0 then
- begin
- Writeln('Error in pgInitDrw' );
- goto ExitPgm;
- end;
-
- pgSetTextStyle( pgTRIPLEX );
- pgSetTextJustify( pgCENTER, pgBOTTOM );
- pgSetCharSpacing( 3 );
- pgSetTextScaling( 2, 1, 2, 1 );
-
- maxx := pgGetMaxX;
-
- { Compare the different line styles. }
-
- pgSetTextJustify( pgLEFT, pgBOTTOM );
- pgSetColor( 1 );
-
- y := 200;
- FOR j := 0 TO 8 DO
- BEGIN
- Writeln( linepatterns[j] );
- pgSetLineStyle( j, 10 );
- pgSetLineWeight( 50 );
- pgLine( 0, y, maxx DIV 2, y );
- pgDrawTextXY( maxx DIV 2 + 100, y, linepatterns[j] );
- y := y + 200;
- END;
-
- { Close The Drawing File. }
- pgEndDrw ;
- ExitPgm:
- end.