summaryrefslogtreecommitdiff
path: root/src/gui/item_amount.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-09 02:02:57 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-09 02:02:57 +0000
commit81cf85e9ec1d37dc6e8dd9883f42bb50dace9135 (patch)
tree585415bbb85c48fc8fb83cd5f54e1cfe8e988ee7 /src/gui/item_amount.cpp
parent78ab0ec914d3c5a97f162905afb3dede53f8b9ed (diff)
downloadmana-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.gz
mana-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.bz2
mana-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.xz
mana-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.zip
Made the Button ctor accept eventId and action listener.
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r--src/gui/item_amount.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index 2ac46283..8c66144b 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -39,21 +39,17 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
mItemAmountTextBox = new IntTextBox(1);
// New buttons
- Button *minusButton = new Button("-");
- Button *plusButton = new Button("+");
+ Button *minusButton = new Button("-", "Minus", this);
+ Button *plusButton = new Button("+", "Plus", this);
+ Button *okButton = new Button("Okay", "Drop", this);
+ Button *cancelButton = new Button("Cancel", "Cancel", this);
mItemAmountSlide = new Slider(1.0);
- Button *okButton = new Button("Okay");
- Button *cancelButton = new Button("Cancel");
mItemAmountTextBox->setRange(1, mItem->getQuantity());
mItemAmountSlide->setDimension(gcn::Rectangle(5, 120, 180, 10));
// Set button events Id
- minusButton->setEventId("Minus");
- plusButton->setEventId("Plus");
mItemAmountSlide->setEventId("Slide");
- okButton->setEventId("Drop");
- cancelButton->setEventId("Cancel");
// Set position
mItemAmountTextBox->setPosition(35, 10);
@@ -72,11 +68,7 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
add(okButton);
add(cancelButton);
- plusButton->addActionListener(this);
- minusButton->addActionListener(this);
mItemAmountSlide->addActionListener(this);
- okButton->addActionListener(this);
- cancelButton->addActionListener(this);
resetAmount();