Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ShopListBox Class Reference

A list box, meant to be used inside a scroll area. More...

#include <shoplistbox.h>

Inheritance diagram for ShopListBox:
ListBox

Public Member Functions

 ShopListBox (gcn::ListModel *listModel)
 
 ShopListBox (gcn::ListModel *listModel, ShopItems *shopListModel)
 Constructor with shopitems.
 
 ~ShopListBox () override
 
void draw (gcn::Graphics *graphics) override
 Draws the list box.
 
unsigned int getRowHeight () const override
 Returns the height of a row.
 
void setPlayersMoney (int money)
 gives information about the current player's money
 
void adjustSize ()
 Adjust List draw size.
 
void setPriceCheck (bool check)
 Set on/off the disabling of too expensive items.
 
void mouseMoved (gcn::MouseEvent &event) override
 Show ItemTooltip.
 
void mouseExited (gcn::MouseEvent &event) override
 Hide ItemTooltip.
 
- Public Member Functions inherited from ListBox
 ListBox (gcn::ListModel *listModel)
 
void draw (gcn::Graphics *graphics) override
 Draws the list box.
 
void drawFrame (gcn::Graphics *graphics) override
 
void keyPressed (gcn::KeyEvent &keyEvent) override
 
void mousePressed (gcn::MouseEvent &mouseEvent) override
 
void mouseWheelMovedUp (gcn::MouseEvent &mouseEvent) override
 
void mouseWheelMovedDown (gcn::MouseEvent &mouseEvent) override
 
void mouseDragged (gcn::MouseEvent &event) override
 

Private Attributes

int mPlayerMoney = 0
 
ShopItemsmShopItems
 Keeps another pointer to the same listModel, permitting to use the ShopItems specific functions.
 
ItemPopupmItemPopup
 
unsigned int mRowHeight
 Row Height.
 
bool mPriceCheck
 

Detailed Description

A list box, meant to be used inside a scroll area.

Same as the Guichan list box except this one doesn't have a background, instead completely relying on the scroll area. It also adds selection listener functionality.

Definition at line 36 of file shoplistbox.h.

Constructor & Destructor Documentation

◆ ShopListBox() [1/2]

ShopListBox::ShopListBox ( gcn::ListModel *  listModel)

Definition at line 39 of file shoplistbox.cpp.

◆ ShopListBox() [2/2]

ShopListBox::ShopListBox ( gcn::ListModel *  listModel,
ShopItems shopListModel 
)

Constructor with shopitems.

Definition at line 48 of file shoplistbox.cpp.

◆ ~ShopListBox()

ShopListBox::~ShopListBox ( )
override

Definition at line 58 of file shoplistbox.cpp.

Member Function Documentation

◆ adjustSize()

void ShopListBox::adjustSize ( )

Adjust List draw size.

Definition at line 142 of file shoplistbox.cpp.

◆ draw()

void ShopListBox::draw ( gcn::Graphics *  graphics)
override

Draws the list box.

Definition at line 68 of file shoplistbox.cpp.

◆ getRowHeight()

unsigned int ShopListBox::getRowHeight ( ) const
inlineoverride

Returns the height of a row.

Definition at line 56 of file shoplistbox.h.

◆ mouseExited()

void ShopListBox::mouseExited ( gcn::MouseEvent &  event)
override

Hide ItemTooltip.

Definition at line 178 of file shoplistbox.cpp.

◆ mouseMoved()

void ShopListBox::mouseMoved ( gcn::MouseEvent &  event)
override

Show ItemTooltip.

Definition at line 153 of file shoplistbox.cpp.

◆ setPlayersMoney()

void ShopListBox::setPlayersMoney ( int  money)

gives information about the current player's money

Definition at line 63 of file shoplistbox.cpp.

◆ setPriceCheck()

void ShopListBox::setPriceCheck ( bool  check)

Set on/off the disabling of too expensive items.

(Good for selling mode.)

Definition at line 148 of file shoplistbox.cpp.

Member Data Documentation

◆ mItemPopup

ItemPopup* ShopListBox::mItemPopup
private

Definition at line 93 of file shoplistbox.h.

◆ mPlayerMoney

int ShopListBox::mPlayerMoney = 0
private

Definition at line 85 of file shoplistbox.h.

◆ mPriceCheck

bool ShopListBox::mPriceCheck
private

Definition at line 97 of file shoplistbox.h.

◆ mRowHeight

unsigned int ShopListBox::mRowHeight
private

Row Height.

Definition at line 95 of file shoplistbox.h.

◆ mShopItems

ShopItems* ShopListBox::mShopItems
private

Keeps another pointer to the same listModel, permitting to use the ShopItems specific functions.

Definition at line 91 of file shoplistbox.h.


The documentation for this class was generated from the following files: