home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001129a < prev    next >
Text File  |  1991-11-19  |  1KB  |  59 lines

  1. #ifndef _WINCLASSDEF
  2. #define _WINCLASSDEF
  3.  
  4. #include <stddef.h>
  5. #include <conio.h>
  6. #include "region.h"
  7.  
  8.  
  9. // The basic window class
  10. extern class win : public region
  11.         {
  12. protected:
  13.  
  14.         static win *topwin;  // Class variable holds top window
  15.         static win *lastwin; // Last window
  16.  
  17. // Cursor location when window isn't on top
  18.         int oldx;
  19.         int oldy;
  20.  
  21. // Default screen color
  22.         unsigned int color;
  23.  
  24. // Pointer to next window on stack
  25.         win *next;    // Pointer to next window
  26.         win *prev;              // Previous window
  27.  
  28.         int margin;  // Margins support borders on the windows
  29.  
  30. // Private method to register top window
  31.         void settop(void);
  32.  
  33. public:
  34. // Methods:
  35. // Constructor:
  36.         win(int x0=1,int y0=1,int x1=80,int y1=25,
  37.             unsigned int clr=7,int mar=0);
  38.  
  39. // Destructor. This is virtual to support boxwindows, etc.
  40.         virtual ~win();
  41.  
  42. // Force window to top of stack
  43.         void maketop();
  44.         };
  45.  
  46. // Windows with borders
  47. extern class boxwin : public win
  48.         {
  49. public:
  50.         boxwin(int x0=2,int y0=2,int x1=79,int y1=24,
  51.                unsigned int clr=7,int boxt=0);
  52.         };
  53.  
  54. // General purpose box drawing routine
  55. void draw_box(int type,int x0,int y0,int x1,int y1);
  56.  
  57. #endif
  58.  
  59.