Mana
Loading...
Searching...
No Matches
shoplistbox.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "gui/widgets/listbox.h"
25
26class ShopItems;
27class ItemPopup;
28
36class ShopListBox : public ListBox
37{
38 public:
39 ShopListBox(gcn::ListModel *listModel);
40
44 ShopListBox(gcn::ListModel *listModel, ShopItems *shopListModel);
45
46 ~ShopListBox() override;
47
51 void draw(gcn::Graphics *graphics) override;
52
56 unsigned int getRowHeight() const override { return mRowHeight; }
57
61 void setPlayersMoney(int money);
62
66 void adjustSize();
67
72 void setPriceCheck(bool check);
73
77 void mouseMoved(gcn::MouseEvent &event) override;
78
82 void mouseExited(gcn::MouseEvent &event) override;
83
84 private:
85 int mPlayerMoney = 0;
86
92
94
95 unsigned int mRowHeight;
98};
A popup that displays information about an item.
Definition itempopup.h:39
A list box, meant to be used inside a scroll area.
Definition listbox.h:36
This class handles the list of items available in a shop.
Definition shopitems.h:41
A list box, meant to be used inside a scroll area.
Definition shoplistbox.h:37
bool mPriceCheck
Definition shoplistbox.h:97
ItemPopup * mItemPopup
Definition shoplistbox.h:93
void draw(gcn::Graphics *graphics) override
Draws the list box.
void setPriceCheck(bool check)
Set on/off the disabling of too expensive items.
unsigned int getRowHeight() const override
Returns the height of a row.
Definition shoplistbox.h:56
void setPlayersMoney(int money)
gives information about the current player's money
void mouseMoved(gcn::MouseEvent &event) override
Show ItemTooltip.
~ShopListBox() override
void mouseExited(gcn::MouseEvent &event) override
Hide ItemTooltip.
unsigned int mRowHeight
Row Height.
Definition shoplistbox.h:95
ShopItems * mShopItems
Keeps another pointer to the same listModel, permitting to use the ShopItems specific functions.
Definition shoplistbox.h:91
void adjustSize()
Adjust List draw size.
Graphics * graphics
Definition client.cpp:104