TIMEBAR.CPP
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*----------------------------GRAPH----------------------------------*/
  2. /*     NAME:UNREAL TIME BAR          */
  3. /*----------------------------GRAPH----------------------------------*/
  4. #include<graphics.h>
  5. #include<conio.h>
  6. #include<dos.h>
  7. void DrawWin(int wx,int wy,int ww,int wh) //draw main frame of program
  8. {
  9. setcolor(WHITE);
  10. moveto(wx+ww,wy);
  11. lineto(wx,wy);
  12. lineto(wx,wy+wh);
  13. moveto(wx+ww-1,wy+1);
  14. lineto(wx+1,wy+1);
  15. lineto(wx+1,wy+wh-1);
  16. setcolor(DARKGRAY);
  17. moveto(wx+1,wy+wh);
  18. lineto(wx+ww,wy);
  19. moveto(wx+2,wy+wh-1);
  20. lineto(wx+ww-1,wy+wh-1);
  21. lineto(wx+ww-1,wy+1);
  22. setfillstyle(SOLID_FILL,LIGHTGRAY);
  23. bar(wx+2,wy+2,wx+ww-2,wy+wh-2);
  24. setcolor(DARKGRAY);
  25. moveto(wx+ww-10,wy+60);
  26. lineto(wx+10,wy+60);
  27. lineto(wx+10,wy+wh-20);
  28. setcolor(WHITE);
  29. lineto(wx+ww-10,wy+wh-20);
  30. lineto(wx+ww-10,wy+60);
  31. }
  32. void main()
  33. {
  34.   int driver=DETECT,mode;
  35.   int NUM,X1=110,Y1=160,X2=120,Y2=180;
  36.   int X3=110,Y3=360,X4=123,Y4=380;
  37.   registerbgidriver(EGAVGA_driver);
  38.   initgraph(&driver,&mode,"");
  39.   DrawWin(100,100,300,100);
  40.   DrawWin(100,300,300,100);
  41.   setcolor(YELLOW);
  42.   outtextxy(120,120,"This is a suppositional time bar");
  43.   outtextxy(120,320,"This is a suppositional time bar");
  44.   setfillstyle(1,BLUE);
  45.   for(NUM=0;NUM<22;NUM++)
  46.   {
  47. bar(X1,Y1,X2,Y2);
  48. bar(X3,Y3,X4,Y4);
  49. delay(100);
  50. X1+=13;
  51. X2+=13;
  52. X3+=13;
  53. X4+=13;
  54.   }
  55.   getch();
  56.   closegraph();
  57. }