home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 12 / mixed / demo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-18  |  4.0 KB  |  118 lines

  1. /* ------------------------------------------------------ */
  2. /*         DEMO.C zu SCREEN.C aus Pascal Int. 2/88        */
  3. /* ------------------------------------------------------ */
  4. #include <stdio.h>
  5. #include "screen.h"
  6.  
  7. #define taste printsxy(1,25,"bitte Taste drücken"); getch();
  8.  
  9. /* ------------------------------------------------------ */
  10. void fenster(xa,ya,xe,ye,rand,zeichen)
  11.   int xa,ya,xe,ye,rand;
  12.   char zeichen;
  13.   {
  14.     int i, j;
  15.  
  16.     open_window(xa,ya,xe,ye,rand); getch();
  17.     for(i = 1; i <= (xe-xa-1); i++)
  18.       for(j = 1; j <= (ye-ya-1); j++)
  19.     printxy(i,j,zeichen);
  20.   }
  21.  
  22. main()
  23. {
  24.   int i,x,y;
  25.  
  26.   cursor(0);
  27.   set_attribut(8+1);
  28.   printsxy(1,1,"Demonstration von printxy()"); taste;
  29.   for(x = 1; x <= 80; x++)
  30.     for(y = 1; y <= 25; y++);
  31.       printxy(x,y,'*');
  32.  
  33.   printsxy(1,1,"Demonstration von clrscr()"); taste;
  34.   clrscr(10,1,30,5); clrscr(50,1,70,5);
  35.   clrscr(10,20,30,25); clrscr(50,20,70,25);
  36.   taste;
  37.   clrscr(1,1,80,25);
  38.  
  39.   printsxy(1,1,"Demonstration von attribut() ---> Monochrome <---");
  40.   taste;
  41.   set_attribut(ATT_HELL | ATT_NORMAL); printsxy(5,15,"hell normal");
  42.   taste;
  43.   clrscr(1,15,80,15);
  44.   set_attribut(ATT_NORMAL); printsxy(5,15,"normal "); taste;
  45.   clrscr(1,15,80,15);
  46.   set_attribut(ATT_HELL | ATT_UNTERSTRICHEN);
  47.   printsxy(5,15,"hell unterstrichen"); taste;
  48.   clrscr(1,15,80,15);
  49.   set_attribut(ATT_INVERS); printsxy(5,15,"invers"); taste;
  50.   clrscr(1,15,80,15);
  51.   set_attribut(ATT_HELL | ATT_NORMAL | ATT_BLINK);
  52.   printsxy(5,15,"hell blink normal"); taste;
  53.   clrscr(1,15,80,15);
  54.   set_attribut(ATT_NORMAL); printsxy(5,15,"normal"); taste;
  55.   clrscr(1,1,80,25);
  56.  
  57.   printsxy(1,1,"Demonstration von attribut() ---> Color <---");
  58.   taste;
  59.   set_attribut(ATT_ROT_V | ATT_BLAU_H);
  60.   printsxy(5,15,"rot Vordergrund, blau Hintergrund");
  61.   taste;
  62.   clrscr(1,15,80,15);
  63.   set_attribut(ATT_ROT_V | ATT_BLAU_H | ATT_INT_V);
  64.   printsxy(5,15,"rot Vordergrund, blau Hintergrund, int. Vordergrund");
  65.   taste;
  66.   clrscr(1,15,80,15);
  67.   set_attribut(ATT_ROT_V | ATT_BLAU_H | ATT_INT_V | ATT_INT_H);
  68.   printsxy(5,15,"rot vordergrund, blau Hintergrund, int. Vordergrund, int Hintergrund");
  69.  
  70.   taste;
  71.   clrscr(1,15,80,15);
  72.   set_attribut(ATT_ROT_H | ATT_BLAU_V | ATT_INT_V | ATT_INT_H);
  73.   printsxy(5,15,"rot Hintergrund, blau Vordergrund, int. Vordergrund, int. Hintergrund");
  74.  
  75.   taste;
  76.   clrscr(1,15,80,15);
  77.   set_attribut(ATT_BLAU_V | ATT_ROT_V | ATT_BLAU_H);
  78.   printsxy(5,15,"rot & blau Vordergrund gemischt, blauer Hintergrund");
  79.   taste;
  80.   clrscr(1,15,80,15);
  81.   set_attribut(ATT_NORMAL); printsxy(5,15,"normal "); taste;
  82.   clrscr(1,15,80,15);
  83.  
  84.   printsxy(1,1,"Demonstration von Cursor(), set_cursor()");
  85.   taste;
  86.   printsxy(1,10,"cursor(0) : "); cursor(0); set_cursor(20,10); taste;
  87.   printsxy(1,10,"cursor(1) : "); cursor(1); set_cursor(20,10); taste;
  88.   printsxy(1,10,"cursor(2) : "); cursor(2); set_cursor(20,10); taste;
  89.   printsxy(1,10,"cursor(8) : "); cursor(8); set_cursor(20,10); taste;
  90.   clrscr(1,1,80,25);
  91.  
  92.   cursor(0);
  93.   printsxy(1,1,"Demonstration von open_window(); close_window()");
  94.   taste;
  95.   set_attribut(8+0); fenster(20,15,60,17,2,'0'); taste;
  96.   set_attribut(8+1); fenster(15,13,65,18,1,'1'); taste;
  97.   set_attribut(8+2); fenster(10,11,70,20,0,'2'); taste;
  98.   set_attribut(8+3); fenster(5,5,75,22,2,'3'); taste;
  99.   set_attribut(8+4); fenster(1,1,80,25,1,'4'); taste;
  100.   set_attribut(8+5); fenster(20,15,60,17,2,'5'); taste;
  101.   set_attribut(8+6); fenster(15,13,65,18,1,'6'); taste;
  102.   set_attribut(8+7); fenster(10,11,70,20,0,'7'); taste;
  103.   set_attribut(8+3); fenster(5,5,75,22,2,'8'); taste;
  104.   set_attribut(8+6); fenster(1,1,80,25,1,'9'); taste;
  105.   set_attribut(6); close_window(); taste;
  106.   set_attribut(5), close_window(); taste;
  107.   set_attribut(4); close_window(); taste;
  108.   set_attribut(3); close_window(); taste;
  109.   set_attribut(2); close_window(); taste;
  110.   set_attribut(1); close_window(); taste;
  111.   set_attribut(5); close_window(); taste;
  112.   set_attribut(4); close_window(); taste;
  113.   set_attribut(3); close_window(); taste;
  114.   set_attribut(2); close_window(); taste;
  115. }
  116.  
  117.  
  118.