home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 171_01 / frame.c < prev    next >
Text File  |  1983-10-27  |  2KB  |  59 lines

  1. /**********************************************************
  2.  *   This function builds a nice looking frame for a      *
  3.  *   menu.  The function is passed the parameters for     *
  4.  *   the upper left corner row, upper left corner column  *
  5.  *   the height of the frame and the width.  Depending    *
  6.  *   on your particular compiler characteristics you      *
  7.  *   will have to substitute its functions for clear-     *
  8.  *   ing the screen and locating at the correct row       *
  9.  *   and column on the screen. the functions you will     *
  10.  *   need to replace with your own are scr_clr() and      *
  11.  *   scr_rowcol(x, y).                                    *
  12.  *                                                        *
  13.  *          Program By                                    *
  14.  *          Lynn Long                                     *
  15.  *          Tulsa, OK RBBS "C" Bulletin Board             *
  16.  *          918-664-8737                                  *
  17.  *********************************************************/
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. #define            ULCOR            201
  28. #define            URCOR            187
  29. #define            LLCOR            200
  30. #define            LRCOR            188
  31. #define            VBAR            186
  32. #define            HBAR            205
  33.  
  34. frame(row, col, hgt, wdth)
  35. int row, col, hgt, wdth;
  36.  
  37. {
  38.     int x, y;
  39.     
  40.  
  41.     scr_clr();                                /*  insert your code here to clear screen  */
  42.     scr_rowcol(row, col);                     /*  insert your function to locate row and col */
  43.     putchar(ULCOR);
  44.     for(x = col + 1; x <=(col + wdth -1); x++)
  45.          putchar(HBAR);
  46.         putchar(URCOR);
  47.         for(x = row + 1; x <=(row + hgt - 1); x++){
  48.         scr_rowcol(x, col);    
  49.         putchar(VBAR);
  50.         scr_rowcol(x, col+wdth);
  51.         putchar(VBAR);
  52.    }
  53.     scr_rowcol(x, col);  
  54.     putchar(LLCOR);
  55.     for(x= col + 1; x <=(col + wdth -1); x++)
  56.         putchar(HBAR);
  57.         putchar(LRCOR);    
  58.