diff options
author | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-06-18 13:36:54 +0000 |
---|---|---|
committer | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-06-18 13:36:54 +0000 |
commit | 6040daae3201e4a4cc55c2754c73225752fd4c5f (patch) | |
tree | 7f1c15a6bd50b6c1773077e28f736c11178c79d8 /src/gui/buddywindow.cpp | |
parent | 275b80eca0ecc71262b4ca8aeba6e7501f711d43 (diff) | |
download | mana-6040daae3201e4a4cc55c2754c73225752fd4c5f.tar.gz mana-6040daae3201e4a4cc55c2754c73225752fd4c5f.tar.bz2 mana-6040daae3201e4a4cc55c2754c73225752fd4c5f.tar.xz mana-6040daae3201e4a4cc55c2754c73225752fd4c5f.zip |
Showing buddyWindow
Diffstat (limited to 'src/gui/buddywindow.cpp')
-rw-r--r-- | src/gui/buddywindow.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp index b57b32dd..d5e9e7a0 100644 --- a/src/gui/buddywindow.cpp +++ b/src/gui/buddywindow.cpp @@ -22,28 +22,45 @@ */ #include "buddywindow.h" -#include "menu.h" BuddyWindow::BuddyWindow(): Window("Buddys") { - setContentSize(80, 200); + setContentSize(120, 200); listbox = new gcn::ListBox(); listbox->setListModel(dynamic_cast<ListModel*>(this)); scrollArea = new ScrollArea(listbox); scrollArea->setDimension(gcn::Rectangle( - 2, 0, 76, 180)); + 2, 0, 116, 180)); add(scrollArea); - addBuddy("Usiu"); // for testing + talk = new Button("Talk"); + talk->setPosition(1,180); + talk->addActionListener(this); + talk->setEventId("Talk"); + remove = new Button("Remove"); + remove->addActionListener(this); + remove->setEventId("Remove"); + remove->setPosition(talk->getWidth()+2,180); + cancel = new Button("Cancel"); + cancel->addActionListener(this); + cancel->setEventId("Cancel"); + cancel->setPosition(talk->getWidth()+remove->getWidth()+2,180); + + add(talk); + add(remove); + add(cancel); } BuddyWindow::~BuddyWindow() { delete listbox; delete scrollArea; + delete talk; + delete remove; + delete cancel; } void BuddyWindow::draw(gcn::Graphics *graphics) @@ -54,5 +71,17 @@ void BuddyWindow::draw(gcn::Graphics *graphics) void BuddyWindow::action(const std::string& eventId) { + if(eventId.compare("Cancel")) { + setVisible(false); + } + /* + else if(eventId.compare("Remove")) { + int selected = listbox->getSelected(); + std::string who = this->getElementAt(selected); + removeBuddy(who); + } else if(eventId.compare("Talk")) { + // TODO + } + */ } |