diff options
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r-- | src/gui/item_amount.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp index 48b0e601..03b22fa9 100644 --- a/src/gui/item_amount.cpp +++ b/src/gui/item_amount.cpp @@ -20,7 +20,7 @@ */ #include "button.h" -#include "inttextbox.h" +#include "inttextfield.h" #include "item_amount.h" #include "slider.h" #include "trade.h" @@ -39,11 +39,11 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): const int maxRange = mItem->getQuantity(); // Integer field - mItemAmountTextBox = new IntTextBox(1); - mItemAmountTextBox->setRange(1, maxRange); - mItemAmountTextBox->setWidth(30); - mItemAmountTextBox->setActionEventId("Dummy"); - mItemAmountTextBox->addActionListener(this); + mItemAmountTextField = new IntTextField(1); + mItemAmountTextField->setRange(1, maxRange); + mItemAmountTextField->setWidth(30); + mItemAmountTextField->setActionEventId("Dummy"); + mItemAmountTextField->addActionListener(this); // Slider mItemAmountSlide = new Slider(1.0, maxRange); @@ -61,7 +61,7 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): // Set positions place(0, 0, minusButton); - place(1, 0, mItemAmountTextBox).setPadding(2); + place(1, 0, mItemAmountTextField).setPadding(2); place(2, 0, plusButton); place(0, 1, mItemAmountSlide, 6); place(4, 2, okButton); @@ -89,12 +89,12 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): void ItemAmountWindow::resetAmount() { - mItemAmountTextBox->setInt(1); + mItemAmountTextField->setValue(1); } void ItemAmountWindow::action(const gcn::ActionEvent &event) { - int amount = mItemAmountTextBox->getInt(); + int amount = mItemAmountTextField->getValue(); if (event.getId() == "Cancel") { @@ -114,14 +114,14 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event) } else if (event.getId() == "Drop") { - player_node->dropItem(mItem, mItemAmountTextBox->getInt()); + player_node->dropItem(mItem, mItemAmountTextField->getValue()); scheduleDelete(); } else if (event.getId() == "AddTrade") { - tradeWindow->tradeItem(mItem, mItemAmountTextBox->getInt()); + tradeWindow->tradeItem(mItem, mItemAmountTextField->getValue()); scheduleDelete(); } - mItemAmountTextBox->setInt(amount); + mItemAmountTextField->setValue(amount); mItemAmountSlide->setValue(amount); } |