diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-07 15:23:07 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-07 15:23:07 +0000 |
commit | 92950d2f309550e21b33d851ef9bbf7906ce5e50 (patch) | |
tree | 18a6d2539c6e004e52cbebb1e61d8f8f0344f9a0 /src/gui/buy.cpp | |
parent | 3f3ba5f3e18b0a5093e7275aee574ecd6f293ec6 (diff) | |
download | mana-92950d2f309550e21b33d851ef9bbf7906ce5e50.tar.gz mana-92950d2f309550e21b33d851ef9bbf7906ce5e50.tar.bz2 mana-92950d2f309550e21b33d851ef9bbf7906ce5e50.tar.xz mana-92950d2f309550e21b33d851ef9bbf7906ce5e50.zip |
Upgraded to Guichan 0.8.0 (merge from guichan-0.8 branch, except for
gcn::TabbedArea usage)
Diffstat (limited to 'src/gui/buy.cpp')
-rw-r--r-- | src/gui/buy.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 3516129b..17e5dba7 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -90,7 +90,6 @@ BuyDialog::BuyDialog(Network *network): add(mItemDescLabel); add(mItemEffectLabel); - addWindowListener(this); loadWindowState(); setLocationRelativeTo(getParent()); } @@ -184,9 +183,8 @@ void BuyDialog::action(const gcn::ActionEvent &event) } } -void BuyDialog::selectionChanged(const SelectionEvent &event) +void BuyDialog::valueChanged(const gcn::SelectionEvent &event) { - // Reset amount of items and update labels mAmountItems = 1; mSlider->setValue(1); @@ -195,11 +193,13 @@ void BuyDialog::selectionChanged(const SelectionEvent &event) mSlider->gcn::Slider::setScale(1, mMaxItems); } -void BuyDialog::windowResized(const WindowEvent &event) +void BuyDialog::widgetResized(const gcn::Event &event) { - gcn::Rectangle area = getChildrenArea(); - int width = area.width; - int height = area.height; + Window::widgetResized(event); + + const gcn::Rectangle &area = getChildrenArea(); + const int width = area.width; + const int height = area.height; mDecreaseButton->setPosition(8, height - 8 - mDecreaseButton->getHeight()); mIncreaseButton->setPosition( @@ -241,7 +241,7 @@ void BuyDialog::windowResized(const WindowEvent &event) void BuyDialog::updateButtonsAndLabels() { - int selectedItem = mShopItemList->getSelected(); + const int selectedItem = mShopItemList->getSelected(); int price = 0; if (selectedItem > -1) |