Category : OS/2 Files
Archive   : VIOUTL.ZIP
Filename : BOX.C

 
Output of file : BOX.C contained in archive : VIOUTL.ZIP
/* ----------------------------------------------------------------------
.context box
.category VioUtil
void far box ( PBYTE cb, int x1, int y1, int x2, int y2, PUCHAR name )

Description:
Create a named bounded area on the screen.

Parameter Description
-------------------------------------------------------------------------
cb a pointer to a two byte character attribute
that defines the character to fill the
screen area with.
x1 upper left column of box
y1 upper left row of box
x2 lower right column of box
y2 lower right row of box
name a pointer to a 0 terminated character string

Returns:
nothing

Comments:

References:

See Also: ExpBox, BoxErase
.ref ExpBox, BoxErase

Development History:
Date Programmer Description of modification
06/16/1989 Paul Montgomery Initial development
-------------------------------------------------------------------- */

#define INCL_SUB
#include

int _acrtused = 0;

void far box ( PBYTE cb, int x1, int y1, int x2, int y2, PUCHAR name )

{
int I;

// draw a vertical line from the top left corner to the bottom left
// corner.
cb[0] = 0xBA;
VioScrollDn(y1, /* top row */
x1, /* left column */
y2, /* bottom row */
x1, /* right column */
y2-y1+1, /* number of lines */
cb, /* cell to write */
0); /* video handle */

// draw a horizontal line from the bottom left corner to the bottom right
// corner.
cb[0] = 0xCD;
VioScrollRt(y2, /* top row */
x1, /* left column */
y2, /* bottom row */
x2, /* right column */
x2-x1 +1, /* number of lines */
cb, /* cell to write */
0); /* video handle */


// draw a vertical line from the bottom right corner to the top right
// corner.
cb[0] = 0xBA;
VioScrollUp(y1, /* top row */
x2, /* left column */
y2, /* bottom row */
x2, /* right column */
y2-y1, /* number of lines */
cb, /* cell to write */
0); /* video handle */

// draw a horizontal line from the top right corner to the top left
// corner.
cb[0] = 0xCD;
VioScrollLf(y1, /* top row */
x1, /* left column */
y1, /* bottom row */
x2, /* right column */
x2-x1, /* number of lines */
cb, /* cell to write */
0); /* video handle */

// clear out the center of the box
cb[0] = 0x20;
VioScrollRt(y1+1, /* top row */
x1+1, /* left column */
y2-1, /* bottom row */
x2-1, /* right column */
x2-x1-1, /* number of lines */
cb, /* cell to write */
0); /* video handle */

// put a corner character on the upper left corner
cb[0] = 0xC9;
VioWrtNCell(cb, /* address of attribute */
1, /* number to write */
y1, /* row */
x1, /* column */
0); /* video handle */

// put a corner character on the upper right corner
cb[0] = 0xBB;
VioWrtNCell(cb, /* address of attribute */
1, /* number to write */
y1, /* row */
x2, /* column */
0); /* video handle */

// put a corner character on the lower left corner
cb[0] = 0xC8;
VioWrtNCell(cb, /* address of attribute */
1, /* number to write */
y2, /* row */
x1, /* column */
0); /* video handle */

// put a corner character on the lower right corner
cb[0] = 0xBC;
VioWrtNCell(cb, /* address of attribute */
1, /* number to write */
y2, /* row */
x2, /* column */
0); /* video handle */

// put the name at the top right of the box in the border
for ( I = 0; I < strlen(name) ; I++ )
{
cb[0] = name[I];
VioWrtNCell ( cb,
1, y1, x1+I+2,0);
}

cb[0] = 0x20;

}


  3 Responses to “Category : OS/2 Files
Archive   : VIOUTL.ZIP
Filename : BOX.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/