《C-图形界面编程.docx》由会员分享,可在线阅读,更多相关《C-图形界面编程.docx(66页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、C图形界面编程#include#include#include#include#includegraphics. h#includechar *inputc (int x,int y)(char aa10;int j, index, i;char ch2;ch 0二;chl= O;j=O;index=O;setfillstyle(SOLID_FILL, 0);bar(x+40, y, x+140, y+10);while (1)(setfillstyle(SOLID_FILL, 0); bar(145, 45,235, 60);setcolor(14);ch0=bioskey (0);if (
2、ch0=27)break;if (ch0=13)break;if (chO= b*)(setfillstyle(SOLID_FILL, 0); if (j!=0) j-=8;bar(x+40+j, y, x+40+j+8, y+10);if (index!=0)index;aaindex=NULL;continue;outtextxy(x+40+j,y,ch);aaindex=ch0;aaindex+1=NULL;index+;j+二8;if (index10)Iouttextxy(150, 50, Max 10 bit.);break;return aa;void my_delay(int
3、clicks)Iunsigned int far *clock=(unsigned int far *)0x0000046CL; unsigned int now;now=*clock;while (abs(*clock-now)xdl&mousexydl&mouseyxdl&mxyd1+k&myyd2+k)(flag=l;screen=2;if (mxxdl&mxydl+k*2&myxdl&mousexydl+k*3&mouseyxdl&mousexydl+k*4&mouseyxdl&mousexydl+k*5&mousey630&mousex24&mousey11 I(abs(my-mou
4、sey)1)break;put image(mx, my, im, XOR PUT);if (screen=lI|screen=2 |screen=3| screen=4|screen=5 |screen=6) break;my_delay(5);if (screen=l)setfillstyle(SOLID_FILL, 0);bar(0, 0, 640, 480);setcolor (15);outtextxy(12, 130, NEW ORDERS);outtextxy(25, 177, SEARCH);outtextxy(25, 187, ORDERS);outtextxy(35, yd
5、l+10+k*2, BACK);rectangle(xdl, ydl,xd2, yd2);rectangle(xdl, ydl+k, xd2, yd2+k);rectangle(xdl, ydl+k*2, xd2, yd2+k*2);rectangle(0, 0, 639,480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100, 480);rectangle(140, 140, 600, 450);setfillstyle(SOLID_FILL, 15);bar (630, 2, 640, 12);setcolor
6、(0);outtextxy (631, 3, X);flag=0;mx=mousex;my二mousey;putimage(mx, my, im, XOR PUT);/*/while (1)igetmouse(febutton, &mousex, &mousey);if (button&ll)(if(button=l&mousexxdl&mousexydl&mouseyxdl&mousexydl+k&mouseyxdl&mousexydl+k*2&mousey630&mousex2&mousey11|(abs(my-mousey)1)break;put image(mx, my, im, XO
7、R PUT);if (screen=0|screen=ll|screen=12) break;)my delay(5);)if (screen=ll)setfillstyle(SOLID_FILL, 0);bar(O, 0, 640, 480);setcolor(15);outtextxy(12, 130, OK);outtextxy(25, 177, BACK);rectangle(xdl, ydl, xd2, yd2);rectangle(xdl, ydl+k, xd2, yd2+k);rectangle (0, 0, 639, 480);line(0, 25, 639, 25);line
8、(0, 100, 639, 100);line(100, 100, 100, 480);rectangle(140, 140,600, 450);setfillstyle(SOLID_FILL, 15);bar (630, 2, 640, 12);setcolor(0);outtextxy(631, 3, X);flag=0;while (flagl!=1)(mx=mousex;my=mousey;putimage(mx, my, im, XOR_PUT);*/getmouse(ftbutton, &mousex, &mousey);if (button&l=l)if(button=l&mou
9、sexxdl&mousexydl&mouseyxdl&mousexydl+k&mousey630&mousex2&.mousey11|(abs(my-mousey)1) break;/*putimage(mx, my, im, XOR_PUT);if (screen=l111 screen=l)break;my delay(5);if (screen=12)!setfillstyle(SOLID_FILL, 0);bar(0, 0, 640, 480);setcolor(15);outtextxy(240,110,PLEASE INPUT THE INFORMATION:); outtextx
10、y(180, 190, NAME: ;outtextxy(195, 250,ID:);outtextxy(180,310,TIME:);outtextxy(12, 130, OK);outtextxy(25, 177, BACK);rectangle(xdl, ydl, xd2, yd2);rectangle(xdl, ydl+k, xd2, yd2+k);rectangle (0, 0,639,480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100,480);rectangle(140, 140,600,450)
11、;setfillstyle(SOLID_FILL, 15);bar (630, 2,640, 12);setcolor (0);outtextxy(631, 3, X);flag=0;while (flagl!=1)(mx=mousex;my=mousey;putimage(mx, my, im, XOR PUT);while (1)(getmouse(ftbutton, &mousex, ftmousey); if (button&l=l)(if(button=l&mousexxdl&mousexydl&mousey180&mousex180&mousey200) x3=180;y3=190
12、;pr=inputc (x3,y3);for (i=0;i195&mousex2404imousey240+20) x3=195;y3=250;pr=inputc (x3,y3);for (i=0;i180&mousex300&mousey300+20) x3=180;y3=310;pr=inputc(x3, y3);for (i=0;ixdl&mousexydl+k&mousey630&mousex24&mouseylI|(abs(my-mousey)l)break;)/*/putimage(mx, my, im, XOR PUT); if (screen|,screen=l) break;
13、)my_delay(5);)if (screen)(setfillstyle(SOLID_FILL, 0); bar(0, 0, 640, 480);setcolor(15);outtextxy(12, 130, BACK);rectangle(xdl, ydl, xd2, yd2);rectangle(0, 0, 639, 480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100, 480);rectangle(140, 140, 600, 450); setfillstyle(SOLID_FILL, 15); b
14、ar(630, 2, 640, 12); setcolor(0);outtextxy(631,3,X); flag=0;while (flagl!=1) (mx=mousex;my=mousey;put image (mx, my, im, XOR_PUT) ; /*/ while (1) getmouse(ftbutton, &mousex, &mousey); if (button&l=l) ( if (button=l&mousexxdl&mousexydl&mousey630&mousex2&n)ousey11|(abs(my-mousey)l) break;/*/put image
15、(mx, my, im, XOR PUT);if (screen-12)break;)my delay(5);if (screen=2)Isetfillstyle(SOLID_FILL, 0);bar (0, 0, 640, 480);setcolor(15);outtextxy(20, 130, NEW BOM);outtextxy(20, ydl+10+k, CORRECT);outtextxy(20, ydl+10+k*2, SEARClT);outtextxy(35, ydl + 10+k*3, BACK);rectangle (xdl,ydl,xd2,yd2);rectangle(x
16、dl, ydl+k, xd2, yd2+k);rectangle(xdl, ydl+k*2, xd2, yd2+k*2);rectangle(xdl, ydl+k*3, xd2, yd2+k*3);rectangle (0, 0, 639, 480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100, 480);rectangle(140, 140,600, 450);setfillstyle(SOLID_FILL, 15);bar (630, 2, 640, 12);setcolor(0);outtextxy(631
17、, 3, X);flag=0;while (flagl!=1)(mx=mousex;my=mousey;putimage(mx, my, im, XOR_PUT);*/while (1)getmouse(ftbutton, &mousex, &mousey);if (button&l=l)if(button=l&mousexxdl&mousexydl&mouseyxdl&mousexydl+k&mouseyxdl&mousexydl+k*2&mouseyxdl&mousexydl+k*3&mousey630&mousex24&mousey11|(abs(my-mousey)1)break;/*
18、/put image(mx, my, im, XOR PUT);if (screen|screen=21|screen=22|screen=23) break;my_delay(5);if (screen21)Isetfillstyle(SOLID_FILL, 0);bar (0, 0, 640, 480);setcolor(15);outtextxy (12, 130, z,0K,z);outtextxy(25, 177, BACK);rectangle (xdl, ydl, xd2, yd2);rectangle(xdl, ydl+k, xd2, yd2+k);rectangle (0,
19、0, 639, 480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100,480);rectangle(140, 140, 600, 450);rectangle(150, 150, 590, 220);outtextxy (155, 160, MATERIALS LIST:z,) ; outtextxy(400, 160, “TIME:);outtextxy(155, 180, EDITION:); outtextxy(400, 180, WRITER:);outtextxy(155, 200,DEADLINE:)
20、; outtextxy (150, 225, LEVEL);rectangle(150, 240, 590, 260);line (325,240,325,260);outtextxy (152,245, “LEVEL:;outtextxy (330,245, MATERIALS ID:); outtextxy(150, 270, MATERIALS LIST); rectangle(150, 280,590, 360);outtextxy(152, 290, MATERIALS NAME:); line(150, 300, 590,300);outtextxy(152, 310, AMOUN
21、T:); line(150, 320, 590, 320);outtextxy(152, 330,LEAD TIME:); line(150, 340,590,340);outtextxy (152, 350,LOGO:);setfillstyle(SOLID_FILL, 15);bar(630, 2, 640, 12);setcolor (0);outtextxy(631, 3, X);flag;while (flagl!=1)(mx=mousex;my=mousey;put image(mx, my, im, XOR PUT);/*/while (1)igetmouse(ftbutton,
22、 &mousex, &mousey); if (button&l=l)(if(button=l&mousex150&mousex235&mousey330&mousex235&mousey255) x3=420;y3=245;pr=inputc(x3, y3);for (i=0;i152&mousex280&mousey300)x3=240;y3=287;pr=inputc (x3,y3);for (i=0;i152&mousex300&mousey320) x3=240;y3=307;pr=inputc(x3, y3);for (i=0;i152&mousex320&mousey340) x
23、3=240;y3=327;pr=inputc(x3, y3);for (i=0;i152&mousex340&mousey360) x3=240;y3=347;pr=inputc (x3,y3);for (i=0;i155&mousex150&mousey170) x3=235;y3=160;pr=inputc(x3, y3);for (i=0;i400&mousex150&mousey170) x3=420;y3=160;pr=inputc (x3,y3);for (i=0;i155&mousex170&mousey190) x3=195;y3=180;pr=inputc(x3, y3);f
24、or (i=0;i400&mousex170&mousey190) x3=420;y3=180;pr=inputc(x3, y3);for (i=0;i155&mousex190&mousey210) x3=195;y3=200;pr=inputc(x3, y3);for (i=0;ixdl&mousexydl&mouseyxdl&mousexydl+k&mousey630&mousex2&mousey11|(abs(my-mousey)l) break;put image(mx, my, im, XOR PUT);if (screen=l111!screen=l)break;my_delay
25、(5);if (screen=3)(setfillstyle(SOLID_FILL, 0); bar(0,0,640,480);setcolor (15);outtextxy(12, 130, NEW MPS); outtextxy(25, 177, SEARCH);outtextxy(25, 187, MPS);outtextxy(35, ydl+10+k*2, BACK); rectangle(xdl, ydl,xd2,yd2);rectangle(xdl, ydl+k,xd2,yd2+k);rectangle(xdl, ydl+k*2, xd2, yd2+k*2); rectangle(
26、0, 0, 639, 480);line(0, 25, 639, 25);line(0, 100, 639, 100);line(100, 100, 100, 480);rectangle(140, 140, 600, 450); setfillstyle(SOLID_FILL, 15); bar(630, 2, 640, 12);setcolor (0);outtextxy(631, 3, X);flag;while (flagl!=1)(mx=mousex;my=mousey;put image (mx, my, im, XOR PUT) ; /*/while (1)(getmouse(&
27、button, &mousex, &mousey);if (button&l=l)(if(button=l&mousexxdl&mousexydl&mouseyxdl&mousexydl+k&mouseyxdl&mousexydl+k*2&mousey630&mousex2&mousey11 I(abs(my-mousey)1)break;/*/put image (mx, my, im, XOR_PUT);if (screen=0|screen=31|screen=32)break;my delay(5);setfillstyle(SOLID_FILL, 0);bar(0, 0, 640, 480);setcolor(15);outtextxy(10, 130, SEARCH MPS);outtextxy(25, 180, SELECT);outtextxy(35, ydl+10+k*3, BACK);outtextxy(10, ydl+10+k*2, PROGRAMMING); rectangle(xdl, ydl, xd2, y