home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
winccdem.zip
/
DEMO2.C
< prev
next >
Wrap
Text File
|
1987-08-15
|
3KB
|
76 lines
/*
************************************************************************
* FILE NAME...... DEMO2.C *
* DESCRIPTION.... WINCC demo *
* *
* Copyright (c) 1987 by Doug J. Lieu *
* All rights reserved. *
************************************************************************
This program is a different approach of using WINCC library.
*/
#include "stdio.h"
#include "win_hd.h"
void
main()
{
int i, j, large_w[4], small_w[4], msg_w, left;
winitial(); /* initialize the window environment */
cls(); /* clear screen */
for (i = 0; i < 4; i++) { /* open first 4 large windows: the cylinder */
left = i * 12 + 18;
large_w[i] = wfopen( 9, 17, left, left + 7, BLU_CYN, BDR_DLN, BLU_CYN, NULL, NULL);
wmode(CTRL_ON);
}
for (i = 0; i < 4; i++) { /* open 4 small windows: the piston */
left = i * 12 + 19;
j = (i % 2) * 2;
small_w[i] = wfopen(9 + j, 15 + j, left, left + 5, RED_BLK, BDR_SLN, BLU_CYN, NULL, NULL);
wmode(CTRL_ON);
wset_ctype(CSR_BLANK);
}
msg_w = message(NULL, " Press Ctrl-C to stop ", STAY);
while (1) {
if (get_kstat() == CTRL_C) /* if interrupted */
break;
for (i = 0; i < 2; i++) { /* move the piston */
wactive(small_w[0]);
wshift(DOWN);
wactive(small_w[2]);
wshift(DOWN);
wactive(small_w[1]);
wshift(UP);
wactive(small_w[3]);
wshift(UP);
}
for (i = 0; i < 2; i++) {
wactive(small_w[0]);
wshift(UP);
wactive(small_w[2]);
wshift(UP);
wactive(small_w[1]);
wshift(DOWN);
wactive(small_w[3]);
wshift(DOWN);
}
}
wclose(msg_w);
for (i = 0; i < 4; i++) {
wclose(small_w[i]);
wclose(large_w[i]);
}
wset_ctype(CSR_NORMAL); /* set cursor to normal type */
exit(0);
}