C*****************************************************************************
C  FILLPAT.FOR
C
C  This sample program demonstrates predefined fill patters.
C****************************************************************************
      include   "pgl.for"
      integer*2 j, ierr, dx
      character*20 fillstyle(12)

      fillstyle(1) = "EMPTY FILL"
      fillstyle(2) = "SOLID FILL" 
      fillstyle(3) = "LINE FILL" 
      fillstyle(4) = "LTSLASH FILL" 
      fillstyle(5) = "SLASH FILL" 
      fillstyle(6) = "BKSLASH FILL" 
      fillstyle(7) = "LTBKSLASH FILL" 
      fillstyle(8) = "HATCH FILL" 
      fillstyle(9) = "XHATCH FILL" 
      fillstyle(10) = "INTERLEAVE FILL" 
      fillstyle(11) = "WIDEDOT FILL" 
      fillstyle(12) = "CLOSEDOT FILL" 

C	
C	Open A Drawing File.
C	
	call pgInitDrw( "FILLPAT.PLT"//CHAR(0), 4000, 3000, ierr) 
      if( ierr .ne. 0)then
         print *, 'Error opening drawing file!'
         stop
      endif

      call pgSetTextStyle( pgTRIPLEX ) 
      call pgSetTextJustify( pgCENTER, pgTOP ) 
      call pgSetCharSpacing( 3 )
      call pgSetTextScaling( 2,1,2,1 ) 
      call pgSetColor( 15 )

      do j=1,4
         dx = (j-1) * 1000 
         call pgSetFillStyle( (j-1), 1 ) 
         call pgRectangle( 100+dx, 100, 900+dx, 900, pgOFILL ) 
         call pgDrawTextXY( 500+dx, 920, fillstyle(j) ) 
      enddo

      do j=5,8
         dx = (j-5) * 1000 
         call pgSetFillStyle( j-1, 1 ) 
         call pgRectangle( 100+dx, 1100, 900+dx, 1900, pgOFILL ) 
         call pgDrawTextXY( 500+dx, 1920, fillstyle(j) ) 
      enddo

      do j=9,12
         dx = (j-9) * 1000 
         call pgSetFillStyle( j-1, 1 ) 
         call pgRectangle( 100+dx, 2100, 900+dx, 2900, pgOFILL ) 
         call pgDrawTextXY( 500+dx, 2920, fillstyle(j) ) 
      enddo

C
C      Close The Drawing File.
C	
      call pgEndDrw() 
C
      END
