home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1988
/
02
/
screen_c
/
demo.c
next >
Wrap
Text File
|
1987-11-24
|
4KB
|
122 lines
/*----------------------------------------------------------------------*/
/* DEMO.C */
/* Demonstration des Window-Bildschirm-Managment von SCREEN.C */
#include <stdio.h>
#include <conio.h>
#include "screen.h"
#define taste printsxy(1,25,"bitte Taste drücken"); getch();
void fenster(int,int,int,int,int,char);
void fenster(xa,ya,xe,ye,rand,zeichen)
int xa,ya,xe,ye,rand;
char zeichen;
{
int i,j;
open_window(xa,ya,xe,ye,rand); getch();
for(i = 1; i <= (xe-xa-1); i++)
for(j = 1; j <= (ye-ya-1); j++)
printxy(i,j,zeichen);
}
main()
{
int x,y;
cursor(0);
printsxy(1,1,"Demonstration von printxy()"); taste;
for(x = 1; x <= 80; x++)
for (y = 1; y <= 25; y++)
printxy(x,y,'*');
printsxy(1,1,"Demonstration von clrscr()"); taste;
clrscr(10,1,30,5); clrscr(50,1,70,5);
clrscr(10,20,30,25); clrscr(50,20,70,25);
taste;
clrscr(1,1,80,25);
printsxy(1,1,"Demonstration von attribut() ---> Monochrom <---");
taste;
set_attribut(ATT_HELL | ATT_NORMAL); printsxy(5,15,"hell normal");
taste;
clrscr(1,15,80,15);
set_attribut(ATT_NORMAL); printsxy(5,15,"normal "); taste;
clrscr(1,15,80,15);
set_attribut(ATT_HELL | ATT_UNTERSTRICHEN);
printsxy(5,15,"hell unterstrichen"); taste;
clrscr(1,15,80,15);
set_attribut(ATT_INVERS); printsxy(5,15,"invers"); taste;
clrscr(1,15,80,15);
set_attribut(ATT_HELL | ATT_NORMAL | ATT_BLINK);
printsxy(5,15,"hell blink normal"); taste;
clrscr(1,15,80,15);
set_attribut(ATT_NORMAL); printsxy(5,15,"normal"); taste;
clrscr(1,1,80,25);
printsxy(1,1,"Demonstration von attribut() ---> Color <---");
taste;
set_attribut(ATT_ROT_V | ATT_BLAU_H);
printsxy(5,15,"rot Vordergrund, blau Hintergrund");
taste;
clrscr(1,15,80,15);
set_attribut(ATT_ROT_V | ATT_BLAU_H | ATT_INT_V);
printsxy(5,15,"rot Vordergrund, blau Hintergrund, int. Vordergrund");
taste;
clrscr(1,15,80,15);
set_attribut(ATT_ROT_V | ATT_BLAU_H | ATT_INT_V | ATT_INT_H);
printsxy(5,15,
"rot Vordergrund, blau Hintergrund, int. Vordergrund, int. Hintergrund"
);
taste;
clrscr(1,15,80,15);
set_attribut(ATT_ROT_H | ATT_BLAU_V | ATT_INT_V | ATT_INT_H);
printsxy(5,15,
"rot Hintergrund, blau Vordergrund, int. Vordergrund, int. Hintergrund"
);
taste;
clrscr(1,15,80,15);
set_attribut(ATT_BLAU_V | ATT_ROT_V | ATT_BLAU_H);
printsxy(5,15,"rot & blau Vordergrund gemischt, blauer Hintergrund");
taste;
clrscr(1,15,80,15);
set_attribut(ATT_NORMAL); printsxy(5,15,"normal "); taste;
clrscr(1,15,80,15);
printsxy(1,1,"Demonstration von cursor(), set_cursor()");
taste;
printsxy(1,10,"cursor(0) : "); cursor(0); set_cursor(20,10); taste;
printsxy(1,10,"cursor(1) : "); cursor(1); set_cursor(20,10); taste;
printsxy(1,10,"cursor(2) : "); cursor(2); set_cursor(20,10); taste;
printsxy(1,10,"cursor(8) : "); cursor(8); set_cursor(20,10); taste;
clrscr(1,1,80,25);
cursor(0);
printsxy(1,1,"Demonstration von open_window();close_window()");
taste;
set_attribut(8+0); fenster(20,15,60,17,2,'0'); taste;
set_attribut(8+1); fenster(15,13,65,18,1,'1'); taste;
set_attribut(8+2); fenster(10,11,70,20,0,'2'); taste;
set_attribut(8+3); fenster(5,5,75,22,2,'3'); taste;
set_attribut(8+4); fenster(1,1,80,25,1,'4'); taste;
set_attribut(8+5); fenster(20,15,60,17,2,'5'); taste;
set_attribut(8+6); fenster(15,13,65,18,1,'6'); taste;
set_attribut(8+7); fenster(10,11,70,20,0,'7'); taste;
set_attribut(8+3); fenster(5,5,75,22,2,'8'); taste;
set_attribut(8+6); fenster(1,1,80,25,1,'9'); taste;
set_attribut(6); close_window(); taste;
set_attribut(5); close_window(); taste;
set_attribut(4); close_window(); taste;
set_attribut(3); close_window(); taste;
set_attribut(2); close_window(); taste;
set_attribut(1); close_window(); taste;
set_attribut(5); close_window(); taste;
set_attribut(4); close_window(); taste;
set_attribut(3); close_window(); taste;
set_attribut(2); close_window(); taste;
}