home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xmouse11.zip / XMDEMO.C < prev    next >
Text File  |  1992-05-07  |  2KB  |  74 lines

  1. #include "xlib.h"
  2. #include "xmouse.h"
  3. #include <dos.h>
  4.  
  5. unsigned char i, count = 1;
  6.  
  7. main()
  8. {
  9.  setmodex();
  10.  xbar(0,0,320,240,0,130);
  11.  xputpix(190,90,0,10);
  12.  xbar(100,100,200,200,0,145);
  13.  xline(40,40,150,150,0,red);
  14.  chargen(10,20,'T',0,red);
  15.  textxy(18,20,"his is a test of the xlib and xmouse",50,page0,black);
  16.  textxy(120,30,"routines.",9,black,page0);
  17.  textxy(56,40,"Watch square change color.....",50,page0,black);
  18.  
  19.  for(i = 0; i < 64; ++i)
  20.    {
  21.     chgcolor(145,i,i,i);
  22.     delay(60);
  23.    };
  24.  
  25.  textxy(10,210,"Press the left mouse button to change",50,page0,red);
  26.  textxy(100,220,"the cursor.",11,page0,red);
  27.  textxy(50,230,"Press the right button to exit.",31,page0,red);
  28.  if (!minitialize(50,150,lightgray))
  29.    {
  30.     settext();
  31.     printf("Mouse is not installed.  Terminating. \n");
  32.     exit(0);
  33.    };
  34.  mshowcursor();
  35.  
  36.  while (!mrightpressed())
  37.    {
  38.     if (mleftpressed())
  39.       {
  40.        switch (count) {
  41.                case 0 :  setcursshape(Standard);
  42.                    count++;
  43.                    break;
  44.                case 1 :  setcursshape(UpArrow);
  45.                    count++;
  46.                    break;
  47.                case 2 :  setcursshape(LeftArrow);
  48.                    count++;
  49.                    break;
  50.                case 3 :  setcursshape(CheckMark);
  51.                    count++;
  52.                    break;
  53.                case 4 :  setcursshape(PointingHand);
  54.                    count++;
  55.                    break;
  56.                case 5 :  setcursshape(DiagonalCross);
  57.                    count++;
  58.                    break;
  59.                case 6 :  setcursshape(RectangularCross);
  60.                    count++;
  61.                    break;
  62.                case 7 :  setcursshape(HourGlass);
  63.                    count = 0;
  64.                    break;
  65.               }
  66.       }
  67.    }
  68.    mhidecursor();
  69.  
  70.  
  71.  
  72.  muninitialize();
  73.  settext();
  74. }