home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLBS.ZIP / FILLPAT.BAS < prev    next >
Encoding:
BASIC Source File  |  1992-01-20  |  1.9 KB  |  66 lines

  1. '****************************************************************************
  2. '  FILLPAT.BAS
  3. '
  4. '  This sample program demonstrates the predefined fill patterns.
  5. '****************************************************************************
  6. '$INCLUDE: 'PGL.BAS'
  7.  
  8.    dfile$="FILLPAT.PLT"
  9.    DIM fillstyle(11) AS STRING*25
  10.  
  11.        fillstyle(0) = "EMPTY FILL" 
  12.        fillstyle(1) = "SOLID FILL" 
  13.        fillstyle(2) = "LINE FILL" 
  14.        fillstyle(3) = "LTSLASH FILL" 
  15.        fillstyle(4) = "SLASH FILL" 
  16.        fillstyle(5) = "BKSLASH FILL" 
  17.        fillstyle(6) = "LTBKSLASH FILL" 
  18.        fillstyle(7) = "HATCH FILL" 
  19.        fillstyle(8) = "XHATCH FILL" 
  20.        fillstyle(9) = "INTERLEAVE FILL" 
  21.        fillstyle(10) = "WIDEDOT FILL" 
  22.        fillstyle(11) = "CLOSEDOT FILL"
  23.  
  24. ' ****   FillPat main procedure   ****  
  25. '    
  26. '    Open A Drawing File.
  27. '    
  28.    call pgInitDrw( dfile$, 4000, 3000, ierr% ) 
  29.    if ierr% <> 0 then
  30.       print "Error Opening Drawing File: " + dfile$ + " !"
  31.       goto exitpgm
  32.    endif
  33.    
  34.    call pgSetTextStyle( pgTRIPLEX ) 
  35.    call pgSetTextJustify( pgCENTER, pgTOP ) 
  36.    call pgSetCharSpacing( 3 ) 
  37.    call pgSetTextScaling( 2, 1, 2, 1 ) 
  38.    call pgSetColor( 15 ) 
  39.  
  40.    FOR j% = 0 TO 3
  41.       dx% = j% * 1000 
  42.       call pgSetFillStyle( j%, 1 ) 
  43.       call pgRectangle( 100+dx%, 100, 900+dx%, 900, pgOFILL ) 
  44.       call pgDrawTextXY( 500+dx%, 920, fillstyle$(j%) ) 
  45.    NEXT
  46.  
  47.    FOR j% = 4 TO 7
  48.       dx% = (j%-4) * 1000 
  49.       call pgSetFillStyle( j%, 1 ) 
  50.       call pgRectangle( 100+dx%, 1100, 900+dx%, 1900, pgOFILL ) 
  51.       call pgDrawTextXY( 500+dx%, 1920, fillstyle$(j%) ) 
  52.    NEXT
  53.  
  54.    FOR j% = 8 TO 11
  55.       dx% = (j%-8) * 1000 
  56.       call pgSetFillStyle( j%, 1 ) 
  57.       call pgRectangle( 100+dx%, 2100, 900+dx%, 2900, pgOFILL ) 
  58.       call pgDrawTextXY( 500+dx%, 2920, fillstyle$(j%) ) 
  59.    NEXT
  60.  
  61. ' Close The Drawing File. 
  62.    call pgEndDrw 
  63.  
  64. exitpgm:
  65. end
  66.