diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-02 21:26:57 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-02 21:26:57 +0000 |
commit | 19e15c87a1fc74f71fd6f9a743201a24ac582997 (patch) | |
tree | a615525476ef6bad8a2af4d8b90c8aea935f9109 /src/gui | |
parent | 29f07d2f98b82674708f1185f26ed3c482992b04 (diff) | |
download | Mana-19e15c87a1fc74f71fd6f9a743201a24ac582997.tar.gz Mana-19e15c87a1fc74f71fd6f9a743201a24ac582997.tar.bz2 Mana-19e15c87a1fc74f71fd6f9a743201a24ac582997.tar.xz Mana-19e15c87a1fc74f71fd6f9a743201a24ac582997.zip |
Merged trunk changes from revision 2716 to 2756 into the 0.1.0 branch.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buy.cpp | 11 | ||||
-rw-r--r-- | src/gui/buysell.cpp | 2 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 1 | ||||
-rw-r--r-- | src/gui/trade.cpp | 10 |
4 files changed, 15 insertions, 9 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 41bdd67e..73f696b7 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -49,7 +49,7 @@ BuyDialog::BuyDialog(): mScrollArea = new ScrollArea(mItemList); mSlider = new Slider(1.0); mQuantityLabel = new gcn::Label("0"); - mMoneyLabel = new gcn::Label("Price: 0 GP"); + mMoneyLabel = new gcn::Label("Price : 0 GP / 0 GP"); mIncreaseButton = new Button("+", "+", this); mDecreaseButton = new Button("-", "-", this); mBuyButton = new Button("Buy", "buy", this); @@ -113,6 +113,8 @@ BuyDialog::~BuyDialog() void BuyDialog::setMoney(int amount) { mMoney = amount; + mMoneyLabel->setCaption("Price : 0 GP / " + toString(mMoney) + " GP"); + mMoneyLabel->adjustSize(); } void BuyDialog::reset() @@ -128,7 +130,7 @@ void BuyDialog::reset() mDecreaseButton->setEnabled(false); mQuantityLabel->setCaption("0"); mQuantityLabel->adjustSize(); - mMoneyLabel->setCaption("Price: 0"); + mMoneyLabel->setCaption("Price : 0 GP / " + toString(mMoney) + " GP"); mMoneyLabel->adjustSize(); mItemDescLabel->setCaption(""); mItemEffectLabel->setCaption(""); @@ -158,7 +160,7 @@ void BuyDialog::action(const std::string &eventId, gcn::Widget *widget) mSlider->setValue(0); mQuantityLabel->setCaption("0"); mQuantityLabel->adjustSize(); - mMoneyLabel->setCaption("Price : 0 GP"); + mMoneyLabel->setCaption("Price : 0 GP / " + toString(mMoney) + " GP"); mMoneyLabel->adjustSize(); // Disable buttons for buying and decreasing @@ -259,7 +261,8 @@ void BuyDialog::action(const std::string &eventId, gcn::Widget *widget) mQuantityLabel->adjustSize(); int price = mAmountItems * mShopItems->at(selectedItem).price; - mMoneyLabel->setCaption("Price : " + toString(price) + " GP"); + mMoneyLabel->setCaption("Price : " + toString(price) + " GP / " + + toString(mMoney) + " GP" ); mMoneyLabel->adjustSize(); } } diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp index ac0dcc84..4bbbb2ff 100644 --- a/src/gui/buysell.cpp +++ b/src/gui/buysell.cpp @@ -48,6 +48,8 @@ BuySellDialog::BuySellDialog(): setContentSize(x, 2 * y + buyButton->getHeight()); setLocationRelativeTo(getParent()); + + requestFocus(); } void BuySellDialog::action(const std::string &eventId, gcn::Widget *widget) diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index ea0fd8c0..452b7c16 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -49,6 +49,7 @@ InventoryWindow::InventoryWindow(): setResizable(true); setMinWidth(240); setMinHeight(172); + // If you adjust these defaults, don't forget to adjust the trade window's. setDefaultSize(115, 25, 322, 172); mUseButton = new Button("Use", "use", this); diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 630881ea..2ac56ae5 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -47,7 +47,8 @@ TradeWindow::TradeWindow(): mMyInventory(new Inventory()), mPartnerInventory(new Inventory()) { - setContentSize(322, 150); + setWindowName("Trade"); + setDefaultSize(115, 197, 322, 150); mAddButton = new Button("Add", "add", this); mOkButton = new Button("Ok", "ok", this); @@ -100,12 +101,12 @@ TradeWindow::TradeWindow(): mMoneyLabel->setPosition(8 + 60 + 50 + 6, getHeight() - 20); mMoneyLabel2->setPosition(8, getHeight() - 20); - mCancelButton->setPosition(getWidth() - 48, getHeight() - 49); - mTradeButton->setPosition(mCancelButton->getX() - 40 + mCancelButton->setPosition(getWidth() - 54, getHeight() - 49); + mTradeButton->setPosition(mCancelButton->getX() - 41 , getHeight() - 49); mOkButton->setPosition(mTradeButton->getX() - 24, getHeight() - 49); - mAddButton->setPosition(mOkButton->getX() - 32, + mAddButton->setPosition(mOkButton->getX() - 31, getHeight() - 49); mMyItemContainer->setSize(getWidth() - 24 - 12 - 1, @@ -121,7 +122,6 @@ TradeWindow::TradeWindow(): mItemDescriptionLabel->setPosition(8, mItemNameLabel->getY() + mItemNameLabel->getHeight() + 4); - setContentSize(getWidth(), getHeight()); } TradeWindow::~TradeWindow() |