Thursday, October 6, 2011

Creating Dialogbox in C graphics - mouse program

#include<stdio.h>
#include<fstream.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
int gd=0,gm,y,getx,gety;
char px[2],py[2];
union REGS in,out;
initgraph(&gd,&gm,"");
setfillstyle(1,7);
bar(100,100,300,220);
setfillstyle(1,1);
bar(102,102,298,113);
setfillstyle(1,7);
bar(285,103,295,111);
settextstyle(2,0,4);
outtextxy(104,102,"Save");
setcolor(0);
outtextxy(140,130,"Save Changes to untitled?");
////
setcolor(15);
line(285,103,295,103);
line(285,103,285,111);
setcolor(0);
line(295,103,295,111);
line(286,111,295,111);
outtextxy(288,100,"x");
////
////
setcolor(15);
line(115,160+40,160,160+40);
line(115,160+40,115,175+40);
setcolor(0);
line(160,160+40,160,175+40);
line(115,175+40,160,175+40);
outtextxy(130,162+40,"Yes");
////
setcolor(15);
line(170,160+40,215,160+40);
line(170,160+40,170,175+40);
setcolor(0);
line(215,160+40,215,175+40);
line(170,175+40,215,175+40);
outtextxy(185,162+40,"No");
////
setcolor(15);
line(225,160+40,270,160+40);
line(225,160+40,225,175+40);
setcolor(0);
line(270,160+40,270,175+40);
line(225,175+40,270,175+40);
outtextxy(231,162+40,"Cancel");
////
getch();
}

No comments :

Post a Comment