40 lines
1006 B
C++
40 lines
1006 B
C++
#ifndef __TWINDOW__H
|
|
#define __TWINDOW__H
|
|
#include "keycode.h"
|
|
#include "boolean.h"
|
|
#include <iostream.h>
|
|
typedef unsigned char DColor;
|
|
class TWindow
|
|
{
|
|
public:
|
|
TWindow();
|
|
TWindow(unsigned left,unsigned top,unsigned right ,unsigned bottom, DColor bg, DColor fg);
|
|
~TWindow();
|
|
boolean isVisible() {return theState;}
|
|
void hide();
|
|
void display();
|
|
void move(unsigned nX, unsigned nY);
|
|
void TWindow::moveAbs(unsigned x, unsigned y);
|
|
void setText(char* txt);
|
|
void editText();
|
|
char* getText(){return text;};
|
|
void setColor(unsigned char col){background=col;};
|
|
TWindow& operator=(TWindow& t);
|
|
boolean operator==(TWindow& t);
|
|
boolean operator<(TWindow& t);
|
|
boolean operator>(TWindow& t);
|
|
private:
|
|
char* text;
|
|
DColor background, foreground;
|
|
boolean theState;
|
|
unsigned Left,Top, Right,Bottom;
|
|
void draw();
|
|
void erase();
|
|
void drawBorder();
|
|
void showText();
|
|
};
|
|
ostream& operator<<(ostream& o, TWindow& t);
|
|
istream& operator>>(istream&i, TWindow& t);
|
|
#endif
|
|
|