-
Notifications
You must be signed in to change notification settings - Fork 0
/
BOX.H
63 lines (58 loc) · 1.05 KB
/
BOX.H
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include<stdio.h>
#include<iostream.h>
#include<string.h>
#include<dos.h>
class Box
{
int x,y,x1,y1;
char *title;
public : Box(int a,int b,int c,int d,char *n)
{
x=a; y=b; x1=c; y1=d;
title = new char[strlen(n)+1];
strcpy(title,n);
}
void DrawBox();
void Line1();
};
void Box :: Line1()
{
int i;
gotoxy(x+1,y+4);
for(i=x+1;i<x1;i++)
putch(205);
gotoxy(x+1,y+2);
textcolor(BLACK);
textbackground(3);
cprintf("******************* %s *******************",title);
textcolor(WHITE);
gotoxy(x+5,y+8);
}
void Box :: DrawBox()
{
int i;
textcolor(WHITE);
textbackground(BLUE);
gotoxy(x,y);
putch(201);
gotoxy(x1,y);
putch(187);
gotoxy(x,y1);
putch(200);
gotoxy(x1,y1);
putch(188);
for(i=x+1;i<x1;i++)
{
gotoxy(i,y);
putch(205);
gotoxy(i,y1);
putch(205);
}
for(i=y+1;i<y1;i++)
{
gotoxy(x,i);
putch(186);
gotoxy(x1,i);
putch(186);
}
}