diff options
Diffstat (limited to 'src/client/clui/WindowInterface.cpp')
-rw-r--r-- | src/client/clui/WindowInterface.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/client/clui/WindowInterface.cpp b/src/client/clui/WindowInterface.cpp new file mode 100644 index 0000000..336d3b1 --- /dev/null +++ b/src/client/clui/WindowInterface.cpp @@ -0,0 +1,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); +}
\ No newline at end of file |