-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAIN.CPP
More file actions
48 lines (46 loc) · 865 Bytes
/
MAIN.CPP
File metadata and controls
48 lines (46 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//#include<iostream>
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<string.h>
#include"mouse.cpp"
#include"textbox.h"
int main()
{
int gd=4,gm=0;
char a;
int i,j=0,k=0;
textBox mainBox;
initgraph(&gd,&gm,"C:\\turboc3\\bgi");
setbkcolor(BLUE);
setcolor(GREEN);
//showmouse()
mainBox.drawBox(0,10,getmaxx(),getmaxy()-10);
//The infinite loop
mainBox.setTextMode(2);
mainBox.setbgColor(WHITE);
mainBox.setTextColor(GREEN);
showmouse();
for(i=0;i<=500;)
{
mainBox.blinkCur();
mouse(&click,&msX,&msY);
//printf("X=%d\tY=%d\tClick=%d\n",msX,msY,click);
//delay(100);
if(click!=0)
{
mainBox.mouseHandle();
}
if(kbhit()!=0)
{
a=getch();
i++;
if(*key_state==4&&a==4)
mainBox.setTextMode(i%2);
else
mainBox.writeText(a);
}
}
getch();
return 0;
}