home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLCLS.ZIP / USERFILL.PRG < prev   
Encoding:
Text File  |  1992-01-20  |  1.7 KB  |  66 lines

  1. ****************************************************************************
  2. *  USERFILL.PRG
  3. *
  4. *  User Fill pattern demo program.
  5. ****************************************************************************
  6. *
  7. * Include PGL.PRG
  8. *
  9. SET PROCEDURE TO PGL
  10. DO  PGLINIT
  11. *
  12. PUBLIC fillstyle[3], oldfill[3], userfill[3]
  13. PUBLIC j, ierr, dx, color, tmp
  14. **************************************************************************
  15. * - MAIN PROCEDURE
  16. **************************************************************************
  17. fillstyle[1]= 'FILL 1'
  18. fillstyle[2]= 'FILL 2'
  19. fillstyle[3]= 'FILL 3'
  20.  
  21. userfill[1]=CHR(255)+CHR(128)+CHR(128)+CHR(128)+CHR(255)+CHR(8)+CHR(8)+CHR(8)
  22. userfill[2]=CHR(255)+CHR(136)+CHR(136)+CHR(136)+CHR(255)+CHR(8)+CHR(8)+CHR(8)
  23. userfill[3]=CHR(255)+CHR(8)+CHR(8)+CHR(8)+CHR(255)+CHR(8)+CHR(8)+CHR(8)
  24. oldfill[1]=space(8)             
  25. oldfill[2]=space(8)             
  26. oldfill[3]=space(8)             
  27. tmp = space(8)
  28. *    
  29. *    Open A Drawing File
  30. *    
  31.      pgINIT( 'userfill.plt' , 4000, 3000, @ierr  ) 
  32.      if ierr <>  0 
  33.       ? "error opening drawing file!"
  34.       return
  35.      end if
  36.  
  37.    pgSTStyle( pgTRIPLEX )
  38.    pgSTJust( pgCENTER, pgTOP )
  39.    pgSCHARSP( 3 )
  40.    pgSTScale( 2, 1, 2, 1 )
  41.    pgSColor( 15 )
  42.  
  43.    for j = 1 to 3
  44.       dx = (j-1) * 1000 
  45.       pgSFPat( userfill[j], 1 ) 
  46.       pgRect( 100+dx, 100, 900+dx, 900, pgOFILL ) 
  47.       pgDTXY( 500+dx, 920, fillstyle[j] ) 
  48.       pgGFPat( @tmp, @color ) 
  49.       oldfill[j]=tmp
  50.     next
  51.  
  52.    for j = 1 to 3
  53.       dx = (j-1) * 1000 
  54.       pgSFPat( oldfill[j], color ) 
  55.       pgRect( 100+dx, 1100, 900+dx, 1900, pgOFILL ) 
  56.       pgDTXY( 500+dx, 1920, fillstyle[j] ) 
  57.     next
  58.  
  59. *     
  60. *    Close The Drawing File.
  61. *    
  62.      pgEND()
  63. *
  64. * - END MAIN PROCEDURE
  65. *
  66.