diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-12 14:55:10 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-12 14:55:10 +0000 |
commit | b417df720584c101f3799874a0c836a543a8d0a8 (patch) | |
tree | fb7105ed662f13753a6ab8d3efb047bad04f2316 /src/client/chat.h | |
parent | 18383a5fc596bf9546f14d7393ee66c57720b116 (diff) |
user interface updates, work-in-progress
Diffstat (limited to 'src/client/chat.h')
-rw-r--r-- | src/client/chat.h | 46 |
1 files changed, 27 insertions, 19 deletions
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 <sstream> #include <deque> -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<std::string> 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__ |