home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
box.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
2KB
|
99 lines
/*--------------------------------------*/
/* */
/* BOX(X,X,X,X,X) */
/* */
/* Functionality: */
/* Draws a box in text mode. */
/* Arguments: */
/* 0: Type of box. 0 is a single */
/* line border, and 1 is double */
/* lined. Any other number */
/* erases a box already drawn. */
/* 1: Horizontal coordinate of */
/* upper left-hand corner. */
/* 2: Vertical coordinate of upper */
/* left-hand corner. */
/* 3: Horizontal coordinate of */
/* upper right-hand corner. */
/* 4: Vertical coordinate of upper */
/* right-hand corner. */
/* Functions used: */
/* CURS_OUT(),OUT(),SCR_CURS() */
/* Returns: Nothing */
/* Author: John Callicotte */
/* Date created/modified: 09/01/88 */
/* */
/*--------------------------------------*/
void box(type,x1,y1,x2,y2)
int type,x1,x2,y1,y2;
{
int d,j;
scr_curs(x1,y1); /* Set the cursor on the upper */
/* left-hand corner. */
if (!type){ /* Display the appropriate corner */
out(218,1);
d=196;
}
else{
if (type==1){
out(201,1);
d=205;
}
else{
out(32,1);
d=32;
}
}
out(d,y2-y1); /* Display the top of the box */
if (!type)
d=191;
else{
if (type==1)
d=187;
else
d=32;
}
out(d,1); /* Display the upper right-hand */
/* corner. */
if (!type)
d=179;
else{
if (type==1)
d=186;
else
d=32;
}
for (j=x1+1;j<x2;j++){ /* Display both vertical sides */
curs_out(j,y1,d,1);
curs_out(j,y2+1,d,1);
}
if (!type)
d=192;
else{
if (type==1)
d=200;
else
d=32;
}
curs_out(x2,y1,d,1); /* Display lower left-hand corner */
if (!type)
d=196;
else{
if (type==1)
d=205;
else
d=32;
}
out(d,y2-y1); /* Display bottom of box */
if (!type)
d=217;
else{
if (type==1)
d=188;
else
d=32;
}
out(d,1); /* Display lower right-hand corner */
}