home *** CD-ROM | disk | FTP | other *** search
- /*-< Anfang DEMO.C >--------------------------------------*
- * (c) 1990 by Manfred Birnkott & toolbox *
- * Compiler: Turbo-C ab Version 2.0 *
- *--------------------------------------------------------*/
- #include <conio.h>
- #include "screen.h"
- #include "screen.c"
- /*--------------------------------------------------------*
- * Beispiel-Programm für die Anwendung der *
- * SCREEN-Funktionen *
- *--------------------------------------------------------*/
- void main()
- {int i;
- char coord[] = {6,3,8,3,8,6,10,6,10,3,12,3,12,11,10,11,
- 10,8,8,8,8,11,6,11,6,3};
-
- textattr(ATTR(BLUE,LIGHTGRAY)); clrscr();
- cprintf("Demonstration der SCREEN-Funktionen:\r\n\r\n");
-
- cprintf("Linien vertikal und horizontal ");
- drawvline(2,5,12); drawhline(5,12,30);
- getch();
-
- cprintf("in beliebigen Stilen und Farben.");
- textlinestyle(LINESTYLE_2);
- drawvline(4,5,12); drawhline(6,12,30);
- textlinestyle(LINESTYLE_1);
- textlineattr(ATTR(RED,LIGHTGRAY);
- drawvline(6,5,12); drawhline(7,12,30);
- textlinestyle(LINESTYLE_2);
- textlineattr(ATTR(YELLOW,BLUE);
- drawvline(8,5,12); drawhline(8,12,30);
- getch();
-
- gotoxy(35,5); cprintf("Oder Rahmen ");
- textlineattr(ATTR(BLUE,LIGHTGRAY));
- drawframe(35,7,55,10);
- getch();
-
- cprintf("beliebiger Form und Farbe.");
- framelinestyle(FRAMESTYLE_2);
- textlineattr(ATTR(GREEN,LIGHTGRAY);
- drawframe(57,7,65,12);
- framelinestyle(FRAMESTYLE_4);
- textlineattr(ATTR(WHITE,BLACK);
- drawframe(67,7,78,11);
- getch();
-
- gotoxy(35,14); cprintf("Mit Window-Unterstützung ");
- window(35,16,70,25); textcolor(RED);
- for (i=0;i<27;i++) cprintf("windowframe ");
- window(40,18,60,21); textattr(ATTR(WHITE,BLUE));
- clrscr();
- framelinestyle(FRAMESTYLE_1);
- textlineattr(ATTR(YELLOW,BLUE);
- windowframe();
- for (i=0;i<20;i++) cprintf("windowframe ");
- getch();
-
- shadowmode(3); shadowattr(ATTR(DARKGRAY,BLACK));
- windowframe();
- window(1,1,80,25); textattr(ATTR(BLUE,LIGHTGRAY));
- gotoxy(60,14); cprintf("und Schattenwurf.\r");
- getch();
-
- cprintf("Aber der besondere Clou sind\r\n"
- "die drei Überlappungsmodi.");
- getch();
- textlineattr(ATTR(GREEN,LIGHTGRAY));
- textlinestyle(LINESTYLE_1);
-
- crosslinemode(0);
- drawvline(18,19,21); drawhline(19,2,18);
- drawvline(10,17,21);
- gotoxy(1,23); cprintf("Modus 0: keine Überlappung");
- getch();
-
- crosslinemode(1);
- drawvline(18,19,21); drawhline(19,2,18);
- drawvline(10,17,21);
- gotoxy(1,23); cprintf("Modus 1: Überlappung ");
- getch();
-
- crosslinemode(2);
- drawvline(18,19,21); drawhline(19,2,18);
- drawvline(10,17,21);
- gotoxy(1,23); cprintf("Modus 2: Überlappung\r\n"
- "und Glättung der Kanten");
- getch();
-
- window(35,14,80,25); clrscr();
- cprintf("Besondere Effekte erzielt man mit Modus 2:");
- window(1,1,80,25);
- getch();
-
- textlineattr(ATTR(CYAN,LIGHTGRAY));
- shadowmode(0);
- drawframe(35,16,60,23);
- gotoxy(37,17); cprintf("Rahmen");
- getch();
-
- drawhline(18,35,60);
- gotoxy(37,19); cprintf("mit Unterteilungen");
- getch();
-
- window(50,21,75,24); clrscr();
- windowframe();
- cprintf(" und überlappte Fenster.");
- getch();
-
- window(1,1,80,12); clrscr();
- cprintf("Beliebige Polygonzüge können ");
- getch();
-
- cprintf("auf vielfache Weise gezeichnet werden.");
- textlineattr(ATTR(RED,LIGHTGRAY));
- crosslinemode(0); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- crosslinemode(1); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- crosslinemode(2); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- textlinestyle(LINESTYLE_2); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- textlinestyle(LINESTYLE_3); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- textlinestyle(LINESTYLE_4); drawpolygon(13,coord);
- getch();
-
- for (i=0;i<13;i++) coord[2*i]+=10;
- textlinestyle("▓▓"); drawpolygon(13,coord);
- getch();
-
- window(1,1,80,25); clrscr(); textcolor(RED);
- gotoxy(30,12); cprintf("Ende der Demonstration.");
- getch();
- }
- /*-< Ende DEMO.C >----------------------------------------*/