summaryrefslogtreecommitdiff
path: root/src/gui/buddywindow.cpp
diff options
context:
space:
mode:
authorMateusz Kaduk <mateusz.kaduk@gmail.com>2005-06-30 20:45:43 +0000
committerMateusz Kaduk <mateusz.kaduk@gmail.com>2005-06-30 20:45:43 +0000
commitaaff5572f054045ecd4dd94ccdc2caac71132ad4 (patch)
treeb67e8b6436807072893357b55c12e01aacdac591 /src/gui/buddywindow.cpp
parent5cd5f1dda32bdd812abbb7f4a72042575f153d4b (diff)
downloadmana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.gz
mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.bz2
mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.xz
mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.zip
Improved buddylist, added talk
Diffstat (limited to 'src/gui/buddywindow.cpp')
-rw-r--r--src/gui/buddywindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp
index 748ecb97..d2a20ffe 100644
--- a/src/gui/buddywindow.cpp
+++ b/src/gui/buddywindow.cpp
@@ -24,6 +24,9 @@
#include "buddywindow.h"
#include "scrollarea.h"
#include "button.h"
+#include "chat.h"
+
+extern ChatWindow *chatWindow;
BuddyWindow::BuddyWindow():
Window("Buddy")
@@ -35,7 +38,7 @@ BuddyWindow::BuddyWindow():
scrollArea = new ScrollArea(listbox);
scrollArea->setDimension(gcn::Rectangle(
- 2, 0, 116, 180));
+ 2, 0, 114, 176));
add(scrollArea);
talk = new Button("Talk");
@@ -68,7 +71,12 @@ BuddyWindow::~BuddyWindow()
void BuddyWindow::action(const std::string& eventId)
{
if (eventId == "Talk") {
- // TODO
+ int selected = listbox->getSelected();
+ if ( selected > -1 )
+ {
+ std::string who = getElementAt(selected);
+ chatWindow->setInputText(who +": ");
+ }
}
else if (eventId == "Remove") {
int selected = listbox->getSelected();