home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- * Test program for SCRNPOP, SCRNPUSH, SCRNWRIT, SCRNLOAD, SCRNCLR
- * FILE = T_SCRNS.PRG
- *****************************************************************
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- # include "box.ch"
- # include "dl_keys.ch"
- # include "inkey.ch"
-
- SETCOLOR('w+/b')
- CLEAR
- SET CURSOR OFF
-
- * Enable high intensity background colors
- SETBLINK(.F.)
-
- * Stuff a space in keyboard to start the loop
- KEYBOARD CHR(K_SPACE)
- DO WHILE INKEY(0) != K_ESC
-
- * Fill screen with bright white on red background character
- CLEAR
- BACKCHAR(,,,,,'w+/r')
- @ 24, 33 SAY ' Press a key '
-
- * Display and shadow four boxed areas. High intensity
- * foregrounds and backgrounds are used differently
- * with each box to demonstrate possibilities.
-
- old_color = SETCOLOR('W+/R*')
- @ 1, 10, 10, 70 box B_SINGLE + CHR(2)
- SHADOW(1, 10, 10, 70, 239)
- SCRNPUSH(1, 10, 10, 70)
- SETCOLOR(old_color)
- INKEY(0)
- CLRSHADOW()
-
- @ 5, 20, 21, 40 box B_SINGLE + CHR(3)
- SHADOW(5, 20, 21, 40, 96)
- SCRNPUSH(5, 20, 21, 40)
- INKEY(0)
- CLRSHADOW()
-
- SETCOLOR('W+/BG')
- @ 3, 45, 20, 65 box B_SINGLE + CHR(4)
- SHADOW(3, 45, 20, 65, 240)
- SETCOLOR(old_color)
- SCRNPUSH(3, 45, 20, 65)
- INKEY(0)
- CLRSHADOW()
-
- SETCOLOR('W+*/B')
- @ 13, 10, 18, 75 box B_SINGLE + CHR(5)
- SHADOW(13, 10, 18, 75)
- SETCOLOR(old_color)
- SCRNPUSH(13, 10, 18, 75)
- INKEY(0)
- CLRSHADOW()
-
- * Write the current screens array to a file
- SCRNWRIT('screens1')
- * And clear the screens stack
- SCRNCLR()
-
- CLEAR SCREEN
- @ 24, 18 SAY ' Press any key to restore the screens from disk'
- INKEY(0)
-
- * Display and push another screen without pausing
-
- SETCOLOR('N*/BG')
- @ 15, 2, 17, 46 box B_SINGLE + ' '
- @ 16, 4 SAY 'This screen was saved in a different file'
-
- * Put new screen on stack, write to screens2, and clear stack
- SCRNPUSH(15, 2, 17, 46)
- SETCOLOR(old_color)
- CLEAR SCREEN
- SCRNWRIT('screens2')
- SCRNCLR()
-
-
- * Load all screens on stack with latest in position 1
- SCRNLOAD('screens2')
- SCRNLOAD('screens1')
-
- * Restore screens in reverse order (except last one)
- BACKCHAR(,,,,,'w+/r')
- @ 24, 33 SAY ' Press a key '
- WHILE SCRNPOP() != 0
- INKEY(0)
- ENDDO
-
- @ 24, 18 SAY ' Press any key to begin again or Esc to exit '
-
- ENDDO
-
- SET CURSOR ON
- CLEAR
- RETURN
-
-
-