home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / SRC / yahtzee.t.Z / yahtzee.t / boxup.c < prev    next >
Text File  |  1988-07-28  |  956b  |  47 lines

  1. /* This thing turns on standout mode, draws a box, then turns
  2.  * standout mode off. Sys5.2 curses box() doesn't draw boxes in
  3.  * standout mode, and other curses box() don't allow for corner
  4.  * characters.
  5.  */
  6.  
  7. #include <curses.h>
  8.  
  9. #define SideWall '|'
  10. #define TopWall '-'
  11. #define TopLeftCorner '.'
  12. #define TopRightCorner '.'
  13. #define BottomLeftCorner '`'
  14. #define BottomRightCorner '\''
  15.  
  16. extern int BadStandout;
  17.  
  18. BoxUp(AWindow, Y, X)
  19.  
  20. WINDOW *AWindow;
  21. int Y, X;
  22.  
  23.     {
  24.     int i;
  25.  
  26.     --Y;
  27.     --X;
  28.     if (! BadStandout)
  29.         wstandout(AWindow);
  30.     mvwaddch(AWindow, 0, 0, TopLeftCorner);
  31.     mvwaddch(AWindow, 0, X, TopRightCorner);
  32.     mvwaddch(AWindow, Y, 0, BottomLeftCorner);
  33.     mvwaddch(AWindow, Y, X, BottomRightCorner);
  34.     for (i = 1; i < Y; ++i)
  35.         {
  36.         mvwaddch(AWindow, i, 0, SideWall);
  37.         mvwaddch(AWindow, i, X, SideWall);
  38.         }
  39.     for (i = 1; i < X; ++i)
  40.         {
  41.         mvwaddch(AWindow, 0, i, TopWall);
  42.         mvwaddch(AWindow, Y, i, TopWall);
  43.         }
  44.     if (! BadStandout)
  45.         wstandend(AWindow);
  46.     }
  47.