home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / w / wgt3_ex.zip / WGT30.C < prev    next >
C/C++ Source or Header  |  1992-09-17  |  943b  |  51 lines

  1. #include <wgt.h>
  2. #include <conio.h>
  3.  
  4. // WordUp Graphics Toolkit demo program 30
  5. // Mouse routines work in normal text modes too!
  6.  
  7. int i;
  8.  
  9. void main(void)
  10. {
  11. textmode(C80);
  12. clrscr();
  13. textbackground(BLUE);
  14. textcolor(WHITE);
  15. for (i=1; i<26; i++)
  16.  {
  17.  gotoxy(1,i);
  18.  cputs("                                                                                ");
  19.  }
  20.  
  21.  i=minit();
  22.  mon();
  23. do {
  24.   mread();
  25.     gotoxy(1,1);
  26.     cprintf("Mouse coordinates: %i,%i     Button: %i     ",mx/4,my/8,but);
  27.   } while (!kbhit());
  28. moff();
  29. getch();
  30.  
  31. textmode(C4350);
  32. clrscr();
  33. textbackground(BLUE);
  34. textcolor(WHITE);
  35. for (i=1; i<51; i++)
  36.  {
  37.  gotoxy(1,i);
  38.  cputs("                                                                                ");
  39.  }
  40.  
  41.  i=minit();
  42.  mon();
  43. do {
  44.   mread();
  45.     gotoxy(1,1);
  46.     cprintf("Mouse coordinates: %i,%i     Button: %i     ",mx/4,my/8,but);
  47.   } while (!kbhit());
  48. moff();
  49. getch();
  50. }
  51.