diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-01 18:18:24 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-01 18:18:24 +0000 |
commit | 84a403f0a0590ebc11f66955e864c12886da5815 (patch) | |
tree | 628d49ac79ea159ba0109eb8817cfd9144dbab13 /src/gui/chat.cpp | |
parent | e02192d7d1a34088d66072a60cf3ed57d638a695 (diff) | |
download | mana-client-84a403f0a0590ebc11f66955e864c12886da5815.tar.gz mana-client-84a403f0a0590ebc11f66955e864c12886da5815.tar.bz2 mana-client-84a403f0a0590ebc11f66955e864c12886da5815.tar.xz mana-client-84a403f0a0590ebc11f66955e864c12886da5815.zip |
Chat input now hides when not focussed, and doesn't allow player be controlled
by keyboard when it is.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 380d9d13..40a44b13 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -24,6 +24,7 @@ #include "chat.h" #include "textfield.h" #include "textbox.h" +#include "chatinput.h" #include "../graphics.h" #include "../main.h" #include <iostream> @@ -37,7 +38,7 @@ ChatWindow::ChatWindow(const char *logfile, int item_num): setContentSize(600, 100); textOutput = new TextBox(); - chatInput = new TextField(); + chatInput = new ChatInput(); textOutput->setEditable(false); scrollArea = new ScrollArea(textOutput); scrollArea->setDimension(gcn::Rectangle( @@ -228,13 +229,16 @@ void ChatWindow::action(const std::string& eventId) chatInput->setText(""); } + // Remove focus and hide input gui->focusNone(); + chatInput->setVisible(false); } } -void ChatWindow::requestFocus() +void ChatWindow::requestChatFocus() { // Give focus to the chat input + chatInput->setVisible(true); chatInput->requestFocus(); } |