summaryrefslogtreecommitdiff
path: root/src/gui/shopwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
commitb7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2 (patch)
treeee27a5a1ace7e5dbc588466dc623013e4d5cea99 /src/gui/shopwindow.cpp
parent7d3059516fc25134d0d29b497e546f2846162399 (diff)
downloadmv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.gz
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.bz2
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.xz
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.zip
Improve constructors in some classes.
Diffstat (limited to 'src/gui/shopwindow.cpp')
-rw-r--r--src/gui/shopwindow.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index 9ebe7a2a5..95ee92f9f 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -73,6 +73,29 @@ ShopWindow::DialogList ShopWindow::instances;
ShopWindow::ShopWindow():
Window(_("Personal Shop"), false, nullptr, "shop.xml"),
+ ActionListener(),
+ SelectionListener(),
+ mCloseButton(new Button(_("Close"), "close", this)),
+ mBuyShopItems(new ShopItems),
+ mSellShopItems(new ShopItems),
+ mBuyShopItemList(new ShopListBox(mBuyShopItems, mBuyShopItems)),
+ mSellShopItemList(new ShopListBox(mSellShopItems, mSellShopItems)),
+ mBuyScrollArea(new ScrollArea(mBuyShopItemList,
+ getOptionBool("showbuybackground"), "shop_buy_background.xml")),
+ mSellScrollArea(new ScrollArea(mSellShopItemList,
+ getOptionBool("showsellbackground"), "shop_sell_background.xml")),
+ mBuyLabel(new Label(_("Buy items"))),
+ mSellLabel(new Label(_("Sell items"))),
+ mBuyAddButton(new Button(_("Add"), "add buy", this)),
+ mBuyDeleteButton(new Button(_("Delete"), "delete buy", this)),
+ mBuyAnnounceButton(new Button(_("Announce"), "announce buy", this)),
+ mBuyAuctionButton(nullptr),
+ mSellAddButton(new Button(_("Add"), "add sell", this)),
+ mSellDeleteButton(new Button(_("Delete"), "delete sell", this)),
+ mSellAnnounceButton(new Button(_("Announce"), "announce sell", this)),
+ mSellAuctionButton(nullptr),
+ mAnnounceLinks(new CheckBox(_("Show links in announce"), false,
+ this, "link announce")),
mSelectedItem(-1),
mAnnonceTime(0),
mLastRequestTimeList(0),
@@ -91,43 +114,24 @@ ShopWindow::ShopWindow():
setMinHeight(230);
setDefaultSize(380, 300, ImageRect::CENTER);
- mBuyShopItems = new ShopItems;
- mSellShopItems = new ShopItems;
mAnnounceCounter[BUY] = 0;
mAnnounceCounter[SELL] = 0;
loadList();
- mBuyShopItemList = new ShopListBox(mBuyShopItems, mBuyShopItems);
- mSellShopItemList = new ShopListBox(mSellShopItems, mSellShopItems);
mBuyShopItemList->setPriceCheck(false);
mSellShopItemList->setPriceCheck(false);
- mBuyScrollArea = new ScrollArea(mBuyShopItemList,
- getOptionBool("showbuybackground"), "shop_buy_background.xml");
mBuyScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- mSellScrollArea = new ScrollArea(mSellShopItemList,
- getOptionBool("showsellbackground"), "shop_sell_background.xml");
mSellScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- mCloseButton = new Button(_("Close"), "close", this);
mBuyShopItemList->addSelectionListener(this);
mSellShopItemList->addSelectionListener(this);
- mBuyLabel = new Label(_("Buy items"));
- mSellLabel = new Label(_("Sell items"));
-
- mBuyAddButton = new Button(_("Add"), "add buy", this);
- mBuyDeleteButton = new Button(_("Delete"), "delete buy", this);
- mBuyAnnounceButton = new Button(_("Announce"), "announce buy", this);
- mSellAddButton = new Button(_("Add"), "add sell", this);
- mSellDeleteButton = new Button(_("Delete"), "delete sell", this);
- mSellAnnounceButton = new Button(_("Announce"), "announce sell", this);
- mAnnounceLinks = new CheckBox(_("Show links in announce"), false,
- this, "link announce");
+
ContainerPlacer placer;
placer = getPlacer(0, 0);