home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * sc_box.c - screen boxing routines.
- *
- * Purpose: This file contains the functions to draw text boxes
- * on the screen.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985,1989 Sterling Castle Software
- *
- *******/
-
- #include "blackstr.h"
- #include "sc_head.h"
-
-
- /********
- *
- * sc_vline(col,r1,r2) - display vertical line at col from r1 to r2
- *
- **/
-
- void sc_vline(int col, int r1, int r2)
- {
- int i;
-
- for(i=r1; i<=r2; ++i) {
- sc_setcur(col,i);
- sc_putc(VL_CHAR);
- }
- }
-
-
- /********
- *
- * sc_hline(row,c1,c2) - display horizontal line at row from c1 to c2
- *
- **/
-
- void sc_hline(int row, int c1, int c2)
- {
- int i;
-
- for (i=c1; i<=c2; ++i) {
- sc_setcur(i,row);
- sc_putc(HL_CHAR);
- }
- }
-
-
- /********
- *
- * sc_box(x1,y1,x2,y2) - display a box
- *
- **/
-
- void sc_box(int x1, int y1, int x2, int y2)
- {
- sc_setcur(x1,y1); /* Draw corners, then lines of box */
- sc_putc(LT_CHAR);
- sc_hline(y1,x1+1,x2-1);
- sc_setcur(x2,y1);
- sc_putc(RT_CHAR);
- sc_vline(x2,y1+1,y2-1);
- sc_setcur(x1,y2);
- sc_putc(LB_CHAR);
- sc_hline(y2,x1+1,x2-1);
- sc_setcur(x2,y2);
- sc_putc(RB_CHAR);
- sc_vline(x1,y1+1,y2-1); /* in a clockwise manner */
- }
-