home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / STATWIN.ZIP / TEST.PRG < prev   
Encoding:
Text File  |  1993-09-01  |  3.2 KB  |  123 lines

  1. // A small test program to test STATWIN functions. Compile with /a/m/n.
  2.  
  3. PROCEDURE Main()
  4.  
  5.    LOCAL nCount, nInKeyCode, nSize := 30000, cDefault := "W/B"
  6.  
  7.    SETCOLOR ( cDefault )
  8.  
  9.    CLEAR SCREEN
  10.  
  11.    @ 24, 20 SAY "PRESS SPACE BAR TO MOVE ON TO NEXT EXAMPLE"
  12.  
  13.    @ 1, 1 SAY "This is a default window, with a percent bar length of 25,"
  14.    @ 2, 1 SAY "using four characters -> ░ ▒ ▓ █"
  15.  
  16.    StatInit ( 4, 10 )
  17.  
  18.    nInKeyCode := 0
  19.  
  20.    FOR nCount = 1 TO nSize
  21.       StatWin ( nSize, nCount )
  22.       nInKeyCode := INKEY()       //  --------------------------------------
  23.       IF nInKeyCode == 32         //  This secition not normally coded!
  24.          SETCOLOR ( cDefault )    //  Included here only to exit out of loop
  25.          EXIT                     //  before it is finished (and to keep the
  26.       ENDIF                       //  window from being erased.)
  27.    NEXT
  28.    
  29.    @ 11, 1 SAY 'This is a "large" default window, with a percent bar length of 50,'
  30.    @ 12, 1 SAY "using two characters -> ▌ █"
  31.  
  32.    StatInit ( 14, 10, .T. )  // Note: large window flag set
  33.    
  34.    nInKeyCode := 0
  35.    
  36.    FOR nCount = 1 TO nSize
  37.       StatWin ( nSize, nCount )
  38.       nInKeyCode := INKEY()
  39.       IF nInKeyCode == 32
  40.          SETCOLOR ( cDefault )
  41.          EXIT
  42.       ENDIF
  43.    NEXT
  44.    
  45.    CLEAR SCREEN
  46.  
  47.    @ 24, 20 SAY "PRESS SPACE BAR TO MOVE ON TO NEXT EXAMPLE"
  48.  
  49.    @ 1, 1 SAY 'This is a default window with the "show estimated time" flag set.'
  50.  
  51.    StatInit ( 4, 10 )
  52.  
  53.    nInKeyCode := 0
  54.  
  55.    FOR nCount = 1 TO nSize
  56.       StatWin ( nSize, nCount, , .T. )  // Note: estimate flag set
  57.       nInKeyCode := INKEY()
  58.       IF nInKeyCode == 32
  59.          SETCOLOR ( cDefault )
  60.          EXIT
  61.       ENDIF
  62.    NEXT
  63.    
  64.    @ 12, 1 SAY 'This is a "large" window with a header message and the '
  65.    @ 13, 1 SAY '"show estimated time" flag set.'
  66.  
  67.    StatInit ( 15, 10, .T. )
  68.    
  69.    nInKeyCode := 0
  70.    
  71.    FOR nCount = 1 TO nSize
  72.       StatWin ( nSize, nCount, "This space for rent -- We are this far ->", .T. )
  73.       nInKeyCode := INKEY()    // Note above: message string defined
  74.       IF nInKeyCode == 32
  75.          SETCOLOR ( cDefault )
  76.          EXIT
  77.       ENDIF
  78.    NEXT
  79.    
  80.    CLEAR SCREEN
  81.  
  82.    @ 24, 20 SAY "PRESS SPACE BAR TO MOVE ON TO NEXT EXAMPLE"
  83.  
  84.    @ 1, 1 SAY 'This is a default window with the user-defined window colors.'
  85.  
  86.    StatInit ( 4, 10 )
  87.  
  88.    nInKeyCode := 0
  89.  
  90.    FOR nCount = 1 TO nSize
  91.       StatWin ( nSize, nCount, , , "R/BG" )  
  92.       nInKeyCode := INKEY()
  93.       IF nInKeyCode == 32
  94.          SETCOLOR ( cDefault )
  95.          EXIT
  96.       ENDIF
  97.    NEXT
  98.    
  99.    @ 12, 1 SAY 'This is a "large" window with the same window colors plus user-defined'
  100.    @ 13, 1 SAY 'percent bar template and percent bar "fill" colors.'
  101.  
  102.    StatInit ( 15, 10, .T. )
  103.    
  104.    nInKeyCode := 0
  105.    
  106.    FOR nCount = 1 TO nSize
  107.       StatWin ( nSize, nCount, , , "R/BG", "W", "RB+/W" )
  108.       nInKeyCode := INKEY()    
  109.       IF nInKeyCode == 32
  110.          SETCOLOR ( cDefault )
  111.          EXIT
  112.       ENDIF
  113.    NEXT
  114.  
  115.    CLEAR SCREEN
  116.  
  117.    ? "That pretty much covers all the possible menu types.  For hints on using"
  118.    ? "StatWin, see the STATWIN.PRG header.  For more advanced hints, see the"
  119.    ? "README.TXT file."
  120.    ?
  121.    
  122. RETURN
  123.