From b417df720584c101f3799874a0c836a543a8d0a8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 12 Oct 2008 14:55:10 +0000 Subject: user interface updates, work-in-progress --- src/client/chat.h | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'src/client/chat.h') diff --git a/src/client/chat.h b/src/client/chat.h index fdf4c70..0bef2b4 100644 --- a/src/client/chat.h +++ b/src/client/chat.h @@ -7,35 +7,43 @@ #ifndef __INCLUDED_CLIENT_CHAT_H__ #define __INCLUDED_CLIENT_CHAT_H__ -#include "sys/consoleinterface.h" - #include #include -namespace client { +#include "ui/input.h" +#include "ui/label.h" +#include "ui/window.h" -/// the client chatbox -namespace chat { +namespace client { -/// initialize chatbox functions -void init(); +class Chat : public ui::Widget +{ +public: + Chat(ui::Widget *parent = 0); + ~Chat(); -/// shut down chatbox functions -void shutdown(); + virtual void show(); + void toggle(); -/// draw the chatbox -void draw(); +protected: + virtual void event_draw(); + virtual void resize(); + + virtual bool on_keypress(const int key, const unsigned int modifier); + -/// toggle the chatbox -void toggle(); +private: + ui::Label *chat_label; + ui::Input *chat_input; + + typedef std::deque History; + + History history; + History::reverse_iterator history_pos; +}; -/// handle keyboard input -void keypressed(unsigned int key); -/// true of the console is visible -bool visible(); -} +} // namespace client -} #endif // __INCLUDED_CLIENT_CHAT_H__ -- cgit v1.2.3