home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_11
/
1011054a
< prev
next >
Wrap
Text File
|
1992-09-08
|
1KB
|
80 lines
**************************************************
// WINDOW.H (Listing 9)
// Window class header -- Williams
#ifndef _WINCLASSDEF
#define _WINCLASSDEF
#include <stddef.h>
#include <conio.h>
#include "region.h"
// The basic window class
extern class win : public region
{
protected:
// Class variable holds top window
static win *topwin;
// Last window
static win *lastwin;
// Cursor location when window isn't on top
int oldx;
int oldy;
// Default screen color
unsigned int color;
// Pointer to next window on stack
win *next; // Pointer to next window
win *prev; // Previous window
// Margins support borders on the windows
int margin;
// Private method to register top window
void settop(void);
public:
// Methods:
// Constructor:
win(int x0=1,int y0=1,int x1=80,int y1=25,
unsigned int clr=7,int mar=0);
// Destructor. This is virtual to support
// boxwindows, etc.
virtual ~win();
// Force window to top of stack
void maketop(void);
// Set color
void setcolor(int n)
{
color=n;
}
// Fetch top window
static win *top_window(void)
{
return topwin;
}
};
// Windows with borders
extern class boxwin : public win
{
public:
boxwin(int x0=2,int y0=2,int x1=79,int y1=24,
unsigned int clr=7,int boxt=0);
};
// General purpose box drawing routine
void draw_box(int type,int x0,int y0,int x1,int y1);
#endif