diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-08 06:23:54 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-08 06:23:54 -0600 |
commit | 89f59c09fec10ff163f410960f77a9391f9e1e61 (patch) | |
tree | 92041c233db743748ab7005c638c3c4374b339f9 /src/gui/chat.h | |
parent | 098b9f71c878af8862e8ef80289e806c93464513 (diff) | |
download | mana-89f59c09fec10ff163f410960f77a9391f9e1e61.tar.gz mana-89f59c09fec10ff163f410960f77a9391f9e1e61.tar.bz2 mana-89f59c09fec10ff163f410960f77a9391f9e1e61.tar.xz mana-89f59c09fec10ff163f410960f77a9391f9e1e61.zip |
Move ChatInput into the files for ChatWindow
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r-- | src/gui/chat.h | 19 |
1 files changed, 18 insertions, 1 deletions
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 <guichan/actionlistener.hpp> +#include <guichan/focuslistener.hpp> #include <guichan/keylistener.hpp> #include <guichan/widget.hpp> #include <guichan/widgetlistener.hpp> @@ -54,6 +56,21 @@ struct CHATLOG }; /** + * 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. * * \ingroup Interface @@ -192,7 +209,7 @@ class ChatWindow : public Window, Recorder *mRecorder; /** Input box for typing chat messages. */ - gcn::TextField *mChatInput; + ChatInput *mChatInput; private: bool mTmpVisible; |