summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index f188b90e..a6e5df83 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -53,7 +53,7 @@ ChatWindow::ChatWindow(Network *network):
loadWindowState();
mChatInput = new ChatInput();
- mChatInput->setEventId("chatinput");
+ mChatInput->setActionEventId("chatinput");
mChatInput->addActionListener(this);
mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP);
@@ -180,9 +180,9 @@ ChatWindow::chatLog(CHATSKILL act)
}
void
-ChatWindow::action(const std::string& eventId, gcn::Widget* widget)
+ChatWindow::action(const gcn::ActionEvent &event)
{
- if (eventId == "chatinput")
+ if (event.getId() == "chatinput")
{
std::string message = mChatInput->getText();
@@ -366,9 +366,10 @@ ChatWindow::const_msg(CHATSKILL act)
}
void
-ChatWindow::keyPress(const gcn::Key &key)
+ChatWindow::keyPressed(gcn::KeyEvent &event)
{
- if (key.getValue() == key.DOWN && mCurHist != mHistory.end())
+ if (event.getKey().getValue() == gcn::Key::DOWN &&
+ mCurHist != mHistory.end())
{
// Move forward through the history
HistoryIterator prevHist = mCurHist++;
@@ -380,8 +381,8 @@ ChatWindow::keyPress(const gcn::Key &key)
mCurHist = prevHist;
}
}
- else if (key.getValue() == key.UP && mCurHist != mHistory.begin() &&
- mHistory.size() > 0)
+ else if (event.getKey().getValue() == gcn::Key::UP &&
+ mCurHist != mHistory.begin() && mHistory.size() > 0)
{
// Move backward through the history
mCurHist--;