home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / CLIPPER / SYSWIN / TEST_WIN.PRG < prev   
Text File  |  1992-10-21  |  3KB  |  68 lines

  1. /**************************************************************************
  2. ** TESTWIN.PRG                                                           **
  3. **      Test Program for SysWin.prg functions...                         **
  4. **                                                      Rod Cushman      **
  5. **                                                      05/15/92 10:04pm **
  6. **************************************************************************/
  7.  
  8. #include "SetCurs.ch"
  9.  
  10.   nTopRow      := 10
  11.   nLftCol      := 25
  12.   acColor := { "W/B", "B+/GB", "W/R", "W/N", "W/GR", "N/W", "W+/N" }
  13.   cChar   := "0123456789" 
  14.                             /* Color          Monochrome */
  15.   cColor  := If( IsColor(), "W/B,B/W,,,I+", "n/W,W+/n,,n/g")
  16.   clear
  17.   SetCursor( SC_NONE )
  18.  
  19.   For nRow = 1 to MaxRow()          /* Set up screen for demo background */
  20.     For nCol = 1 to MaxCol()
  21.       DevPos(nRow, nCol)
  22.       SetColor( acColor[if( (nTemp := Mod(nRow*nCol,5)) < 1, 1, nTemp)] )
  23.       DevOut(SubStr( cChar, Mod(nRow*nCol,10),1) )
  24.     Next nCol
  25.   Next nRow
  26.  
  27.   // Display Box with background saved first
  28.   SAV_SWIN2( 10, 10, 13, 70, cColor, .t. )
  29.   @ 10,22 Say "*** SAVED BOX WITH SHADED BORDER ***"  Color "I"
  30.   @ 11,15 Say "This box was drawn by the function SAV_SWIN2() with "
  31.   @ 12,15 Say "the background region and color saved on a stack.   "
  32.  
  33.   SAV_SWIN2( 16, 16, 18, 66, cColor, .f. )
  34.   @ 16,23 Say  "*** MESSAGE WINDOW - NO BORDER ***"  Color "W/R" 
  35.   @ 17,17 Say  "Press any key to restore the background screen..."
  36.   InKey(0)
  37.   // Now restore the screen behind the Message window
  38.   RST_SWIN2()
  39.   // Now restore the screen behind the SAVED BOX WITH SHADE window...
  40.   RST_SWIN2()
  41.  
  42.   // Now paint the same with Operations using CLR_WIN(), DISPWIN() and
  43.   // SaveScreen()
  44.  
  45.   // Display Box with background saved first
  46.   cOScreen1 := SaveScreen( 10, 10, 14, 70 )
  47.   cOColor1  := CLR_WIN( 10, 10, 14, 70, cColor )
  48.   @ 10,25 Say "*** BOX SAVED MECHANICALLY ***"  Color "I"
  49.   @ 11,15 Say "This box was drawn by the function CLR_WIN() with   "
  50.   @ 12,15 Say "the background region and color saved by calls to   "
  51.   @ 13,15 Say "SaveScreen() and RestScreen().                      "
  52.  
  53.   cOColor2  := SetColor()
  54.   cOScreen2 := SaveScreen( 16, 15, 18, 65 )
  55.   DispWin( 16, 15, 18, 65, "NG/N" )
  56.   @ 16,23 Say  "*** MESSAGE WINDOW ***"  Color "W/R" 
  57.   @ 17,16 Say  "Press any key to restore the background screen..."
  58.   InKey(0)
  59.   // Now restore the screen behind the Message window
  60.   SetColor( cOColor2 )
  61.   RestScreen(16,15,18,65,cOScreen2)
  62.  
  63.   // Now restore the screen behind the SAVED BOX WITH SHADE window...
  64.   SetCursor( SC_NORMAL )
  65.   SetColor( cOColor1 )
  66.   RestScreen(10,10,14,70, cOScreen1)
  67. Return
  68.