1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "WindowInterface.hpp"
WindowInterface::WindowInterface(int num_y, int num_x, int by,
int bx, char ch)
: ny(num_y), nx(num_x), beg_y(by), beg_x(bx), ch_line(ch)
{
w = newwin(ny, nx, beg_y, beg_x);
box(w, ch_line, ch_line);
Update();
}
WindowInterface::~WindowInterface()
{
Clear(true);
Update();
delwin(w);
}
void WindowInterface::SetCursor(int y, int x)
{
wmove(w, y, x);
}
void WindowInterface::Clear(bool full)
{
werase(GetWindow());
if(!full)
box(GetWindow(), ch_line, ch_line);
}
void WindowInterface::Update()
{
wrefresh(w);
}
|