home *** CD-ROM | disk | FTP | other *** search
- /*
- ┌────────────────────────────────────────────────────────────────────────────┐
- │screen.dmo │
- │Demo of some of the windowing routines in the system. │
- │ │
- │ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 │
- └────────────────────────────────────────────────────────────────────────────┘
- */
-
- #include "jaz.h"
- #include "dos.h"
- #include "stdio.h"
- #include "jzscreen.h"
- #include "gscreen.h"
- #include "conio.h"
-
- #define cmsg "This is a test of the emergency broadcast system"
-
- main()
- {
- register w;
- int count=0;
- int wrow,wcol,wstart,wend;
- THEADER *jzcreate(),*pheader;
- TWINDOW *pwindow,*jzappend(),*ptr;
-
- jzgetcur(&wrow,&wcol,&wstart,&wend); /* get cursor position and size */
- wrow -= 2; /* position back to original place */
-
- jzsetcur(0x20,0x20); /* turn of cursor */
-
- pheader = jzcreate(); /* get header node of list */
-
- ptr = jzappend(pheader,31,0,0,15,39); /* save original window contents */
-
- jzdrwbox(0,0,40,16,11); /* draw window box */
-
- window(1,1,14,38,7); /* set window dim and color */
-
- for ( w = 0 ; w < 127 ; w ++ ) /* scroll rainbow of colors */
- jzwndwrt(cmsg,g_row,g_col,w);
-
- pwindow = jzappend(pheader,31,0,0,15,39); /* save rainbow of colors */
-
- for (w = 0 ; w < 40 ; w ++) {
- jzrstwnd(ptr); /* restore what's under the window */
- ptr->col1++; /* increment column position */
- ptr->col2++;
- jzsavwnd(ptr); /* save the next position */
- jzmovwnd(pwindow,0,w+1); /* move window to nex pos */
- }
-
- for ( w = 0 ; w < 9 ; w ++) {
- jzrstwnd(ptr);
- ptr->row1++;
- ptr->row2++;
- jzsavwnd(ptr);
- jzmovwnd(pwindow,w+1,40);
- }
-
- for ( w = 40 ; w > 0 ; w --) {
- jzrstwnd(ptr);
- ptr->col1--;
- ptr->col2--;
- jzsavwnd(ptr);
- jzmovwnd(pwindow,9,w-1);
- }
-
- for ( w = 9 ; w > 0 ; w --) {
- jzrstwnd(ptr);
- ptr->row1--;
- ptr->row2--;
- jzsavwnd(ptr);
- jzmovwnd(pwindow,w-1,0);
- }
-
- jzsetcur(wstart,wend); /* restore cursor size */
- jzwrtstr("Hit <ENTER> to continue...",14,1,0x87); /* print blinking */
- getchar();
- jzrstwnd(ptr);
- jzloccur(wrow,wcol);
- }
-
-