diff options
author | Joursoir <chat@joursoir.net> | 2020-12-10 16:02:46 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-12-10 16:02:46 +0000 |
commit | 05750c44046f320109055aa5954ef0bbd977705f (patch) | |
tree | a39094e5eead788c48c9b4df0db379f4f45be26c /src/client/clui/WindowInterface.cpp | |
parent | 4131de177e36b19b20b8bbdb7bd43b18b6e22690 (diff) | |
download | want-chat-05750c44046f320109055aa5954ef0bbd977705f.tar.gz want-chat-05750c44046f320109055aa5954ef0bbd977705f.tar.bz2 want-chat-05750c44046f320109055aa5954ef0bbd977705f.zip |
refactor clui: delete class ChatRoom, create own class for chat, players, tips (new), input
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 |