home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1988 / 02 / screen_c / demo.c next >
Text File  |  1987-11-24  |  4KB  |  122 lines

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