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
Wrap
Text File
|
1992-10-21
|
3KB
|
68 lines
/**************************************************************************
** TESTWIN.PRG **
** Test Program for SysWin.prg functions... **
** Rod Cushman **
** 05/15/92 10:04pm **
**************************************************************************/
#include "SetCurs.ch"
nTopRow := 10
nLftCol := 25
acColor := { "W/B", "B+/GB", "W/R", "W/N", "W/GR", "N/W", "W+/N" }
cChar := "0123456789"
/* Color Monochrome */
cColor := If( IsColor(), "W/B,B/W,,,I+", "n/W,W+/n,,n/g")
clear
SetCursor( SC_NONE )
For nRow = 1 to MaxRow() /* Set up screen for demo background */
For nCol = 1 to MaxCol()
DevPos(nRow, nCol)
SetColor( acColor[if( (nTemp := Mod(nRow*nCol,5)) < 1, 1, nTemp)] )
DevOut(SubStr( cChar, Mod(nRow*nCol,10),1) )
Next nCol
Next nRow
// Display Box with background saved first
SAV_SWIN2( 10, 10, 13, 70, cColor, .t. )
@ 10,22 Say "*** SAVED BOX WITH SHADED BORDER ***" Color "I"
@ 11,15 Say "This box was drawn by the function SAV_SWIN2() with "
@ 12,15 Say "the background region and color saved on a stack. "
SAV_SWIN2( 16, 16, 18, 66, cColor, .f. )
@ 16,23 Say "*** MESSAGE WINDOW - NO BORDER ***" Color "W/R"
@ 17,17 Say "Press any key to restore the background screen..."
InKey(0)
// Now restore the screen behind the Message window
RST_SWIN2()
// Now restore the screen behind the SAVED BOX WITH SHADE window...
RST_SWIN2()
// Now paint the same with Operations using CLR_WIN(), DISPWIN() and
// SaveScreen()
// Display Box with background saved first
cOScreen1 := SaveScreen( 10, 10, 14, 70 )
cOColor1 := CLR_WIN( 10, 10, 14, 70, cColor )
@ 10,25 Say "*** BOX SAVED MECHANICALLY ***" Color "I"
@ 11,15 Say "This box was drawn by the function CLR_WIN() with "
@ 12,15 Say "the background region and color saved by calls to "
@ 13,15 Say "SaveScreen() and RestScreen(). "
cOColor2 := SetColor()
cOScreen2 := SaveScreen( 16, 15, 18, 65 )
DispWin( 16, 15, 18, 65, "NG/N" )
@ 16,23 Say "*** MESSAGE WINDOW ***" Color "W/R"
@ 17,16 Say "Press any key to restore the background screen..."
InKey(0)
// Now restore the screen behind the Message window
SetColor( cOColor2 )
RestScreen(16,15,18,65,cOScreen2)
// Now restore the screen behind the SAVED BOX WITH SHADE window...
SetCursor( SC_NORMAL )
SetColor( cOColor1 )
RestScreen(10,10,14,70, cOScreen1)
Return