summaryrefslogtreecommitdiffstats
path: root/src/client/clui/WindowInterface.cpp
blob: 336d3b145d79b8fa50257e58dac31b04a7674421 (plain)
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(this->GetWindow());
	if(!full)
		box(this->GetWindow(), ch_line, ch_line);
}

void WindowInterface::Update()
{
	wrefresh(w);
}