From 89f59c09fec10ff163f410960f77a9391f9e1e61 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 8 Apr 2009 06:23:54 -0600 Subject: Move ChatInput into the files for ChatWindow --- src/gui/chat.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/gui/chat.h') diff --git a/src/gui/chat.h b/src/gui/chat.h index 085833eb..d28cecd4 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -22,9 +22,11 @@ #ifndef CHAT_H #define CHAT_H +#include "gui/widgets/textfield.h" #include "gui/widgets/window.h" #include +#include #include #include #include @@ -53,6 +55,21 @@ struct CHATLOG int own; }; +/** + * The chat input hides when it loses focus. It is also invisible by default. + */ +class ChatInput : public TextField, public gcn::FocusListener +{ + public: + ChatInput(); + + /** + * Called if the chat input loses focus. It will set itself to + * invisible as result. + */ + void focusLost(const gcn::Event &event); +}; + /** * The chat window. * @@ -192,7 +209,7 @@ class ChatWindow : public Window, Recorder *mRecorder; /** Input box for typing chat messages. */ - gcn::TextField *mChatInput; + ChatInput *mChatInput; private: bool mTmpVisible; -- cgit v1.2.3-70-g09d2