B
bintom
Hi,
I found a function "mousecall( )" on the web which draws a navigable
mouse on the screen. But I want the mouse to respond to clicks on
buttons that I have on the screen. How do I make the mouse read the co-
ordinates where it has been clicked? Thanks in anticipation.
Bintom
#include <graphics.h>
#include <dos.h>
#include <conio.h>
union REGS in, out;
void mousecall( )
{ in.x.ax = 1;
int86(51, &in, &out);
}
int main( )
{ int driver = DETECT, mode;
initgraph(&driver, &mode, "C:\\TC\\BGI");
mousecall();
settextstyle(2, 0, 5);
setfillstyle(1, 1);
bar3d(200, 200, 300, 240, 0, 0);
outtextxy(220, 210, "Button 1");
setfillstyle(1, 2);
bar3d(400, 200, 500, 240, 0, 0);
outtextxy(420, 210, "Button 2");
getch( );
closegraph( );
}
I found a function "mousecall( )" on the web which draws a navigable
mouse on the screen. But I want the mouse to respond to clicks on
buttons that I have on the screen. How do I make the mouse read the co-
ordinates where it has been clicked? Thanks in anticipation.
Bintom
#include <graphics.h>
#include <dos.h>
#include <conio.h>
union REGS in, out;
void mousecall( )
{ in.x.ax = 1;
int86(51, &in, &out);
}
int main( )
{ int driver = DETECT, mode;
initgraph(&driver, &mode, "C:\\TC\\BGI");
mousecall();
settextstyle(2, 0, 5);
setfillstyle(1, 1);
bar3d(200, 200, 300, 240, 0, 0);
outtextxy(220, 210, "Button 1");
setfillstyle(1, 2);
bar3d(400, 200, 500, 240, 0, 0);
outtextxy(420, 210, "Button 2");
getch( );
closegraph( );
}