home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / source / wgraf102 / demo.cpp next >
C/C++ Source or Header  |  1991-01-30  |  3KB  |  81 lines

  1. #include <dos.h>
  2. #include <fstream.h>
  3. #include <conio.h>
  4. #include "graph.hpp"
  5.  
  6. int main(void)
  7. {
  8.     boxes menu_demo;
  9.     font type_face(8,15);
  10.     fontpointer=&type_face;
  11.     windows main_windows(0,0,639,479,15,1,windows::none);
  12.     main_gui.read("EGA.BIN");
  13.     main_gui.set_mode();
  14.     type_face.load_font("STANDARD.FNT");
  15.     windowpointer=&main_windows;
  16.     main_gui.fill_screen(1);
  17.     windowpointer->text("This is a test....");
  18.     menu_demo.radio_button("Button #1",100,300,200,330);
  19.     menu_demo.radio_button("Button #2",210,300,310,330);
  20.  
  21.     windows mid_windows(63,30,320,100,12,0,windows::auto_scroll_down);
  22.     windows new_windows(340,110,600,200,11,0,windows::none);
  23.     windows hit_a_key(100,250,330,270,14,0,windows::horizontal_center |
  24.         windows::vertical_center);
  25.     windowpointer=&hit_a_key;
  26.     windowpointer->reset();
  27.     windowpointer->text("Hit any key to exit!");
  28.     windowpointer=&mid_windows;
  29.     windowpointer->reset();
  30.     windowpointer->border(10,2,5);
  31.     windowpointer=&new_windows;
  32.     windowpointer->reset();
  33.     windowpointer->border(13,13,5);
  34.     new_windows.current_y=75;
  35.     while(!kbhit()) {
  36.         for(int i=0; i < 90; i++) {
  37.             if(kbhit())
  38.                 break;
  39.             windowpointer=&mid_windows;
  40.             windowpointer->scroll(-1);
  41.             switch(i) {
  42.                 case 75:
  43.                 windowpointer->text("The Warp Graphics Library!\n",0,0,0);
  44.                 break;
  45.                 case 60:
  46.                 windowpointer->text("Supports Smooth Scrolling\n",0,0,0);
  47.                 break;
  48.                 case 45:
  49.                 windowpointer->text("Overlapping Windows\n",0,0,0);
  50.                 break;
  51.                 case 30:
  52.                 windowpointer->text("and a variety of other\n",0,0,0);
  53.                 break;
  54.                 case 15:
  55.                 windowpointer->text("features.\n",0,0,0);
  56.                 break;
  57.             }
  58.             windowpointer=&new_windows;
  59.             windowpointer->scroll(1);
  60.             switch(i) {
  61.                 case 15:
  62.                 windowpointer->text("Multiple Windows Open\n");
  63.                 break;
  64.                 case 30:
  65.                 windowpointer->text("Extremely fast routines\n");
  66.                 break;
  67.                 case 45:
  68.                 windowpointer->text("All drivers written in\n");
  69.                 break;
  70.                 case 60:
  71.                 windowpointer->text("assembly language\n");
  72.                 break;
  73.                 case 75:
  74.                 windowpointer->text("and C++.\n");
  75.                 break;
  76.             }
  77.         }
  78.     }
  79.     main_gui.text_mode();
  80. }
  81.