summaryrefslogtreecommitdiff
path: root/src/gui/buy.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
commitf842e0b40d8382011f0bc46b1446945d99ac0425 (patch)
tree5ddbb7c146a8ece28a4260d788350b1c2cf0dbed /src/gui/buy.cpp
parentcbbcc5489e2f72a76b66ae849cbe8f1dc44246ca (diff)
downloadmana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.gz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.bz2
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.xz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.zip
Upgraded to Guichan 0.6.0 (merge from guichan-0.6.0 branch).
Diffstat (limited to 'src/gui/buy.cpp')
-rw-r--r--src/gui/buy.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index c701499c..a8a1ea7e 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -85,8 +85,8 @@ BuyDialog::BuyDialog(Network *network):
mItemEffectLabel->setDimension(gcn::Rectangle(5, 150, 240, 14));
mItemDescLabel->setDimension(gcn::Rectangle(5, 169, 240, 14));
- mShopItemList->setEventId("item");
- mSlider->setEventId("slider");
+ mShopItemList->setActionEventId("item");
+ mSlider->setActionEventId("slider");
mShopItemList->addSelectionListener(this);
mSlider->addActionListener(this);
@@ -143,11 +143,11 @@ void BuyDialog::addItem(short id, int price)
mShopItemList->adjustSize();
}
-void BuyDialog::action(const std::string& eventId, gcn::Widget* widget)
+void BuyDialog::action(const gcn::ActionEvent &event)
{
int selectedItem = mShopItemList->getSelected();
- if (eventId == "quit")
+ if (event.getId() == "quit")
{
setVisible(false);
current_npc = 0;
@@ -161,12 +161,12 @@ void BuyDialog::action(const std::string& eventId, gcn::Widget* widget)
bool updateButtonsAndLabels = false;
- if (eventId == "slider")
+ if (event.getId() == "slider")
{
mAmountItems = (int)(mSlider->getValue() * mMaxItems);
updateButtonsAndLabels = true;
}
- else if (eventId == "+")
+ else if (event.getId() == "+")
{
if (mAmountItems < mMaxItems) {
mAmountItems++;
@@ -177,7 +177,7 @@ void BuyDialog::action(const std::string& eventId, gcn::Widget* widget)
mSlider->setValue(double(mAmountItems)/double(mMaxItems));
updateButtonsAndLabels = true;
}
- else if (eventId == "-")
+ else if (event.getId() == "-")
{
if (mAmountItems > 0) {
mAmountItems--;
@@ -191,7 +191,7 @@ void BuyDialog::action(const std::string& eventId, gcn::Widget* widget)
// TODO: Actually we'd have a bug elsewhere if this check for the number
// of items to be bought ever fails, Bertram removed the assertions, is
// there a better way to ensure this fails in an _obivous_ way in C++?
- else if (eventId == "buy" && (mAmountItems > 0 &&
+ else if (event.getId() == "buy" && (mAmountItems > 0 &&
mAmountItems <= mMaxItems))
{
MessageOut outMsg(mNetwork);