66 mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
91 mSlider->setActionEventId(
"slider");
92 mSlider->addActionListener(
this);
153 if (event.getId() ==
"quit")
162 if (selectedItem == -1 ||
168 if (event.getId() ==
"slider")
185 else if (event.getId() ==
"max")
196 int sellCount, itemIndex;
209 itemIndex = item->
getId();
225 gcn::Rectangle scroll;
272 if (selectedItem > -1)
This class is a helper for adding widgets to nested tables in a window.
Represents one or more instances of a certain item type.
int getQuantity() const
Returns the number of items.
int getInvIndex() const
Returns the inventory index of this item.
int getId() const
Returns the item id.
void setRowHeight(int n, int h)
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
This class is an helper for setting the position of widgets.
@ AUTO_SET
Uses the share as the new size.
virtual void sellItem(int beingId, int itemId, int amount)=0
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
void mouseClicked(gcn::MouseEvent &mouseEvent) override
Allows for quick-selling by extending double-click events.
std::list< SellDialog * > DialogList
void updateButtonsAndLabels()
Updates the state of buttons and labels.
void addItem(const Item *item, int price)
Adds an item to the inventory.
void reset()
Resets the dialog, clearing inventory.
gcn::Button * mIncreaseButton
gcn::Button * mSellButton
gcn::Label * mQuantityLabel
void setVisible(bool visible) override
Sets the visibility of this window.
gcn::ScrollArea * mScrollArea
void valueChanged(const gcn::SelectionEvent &event) override
Updates labels according to selected item.
static void closeAll()
Closes all instances.
static DialogList instances
gcn::Button * mDecreaseButton
ShopListBox * mShopItemList
gcn::Button * mAddMaxButton
void setMoney(int amount)
Gives Player's Money amount.
gcn::Button * mQuitButton
Represents an item in a shop inventory.
int getCurrentInvIndex() const
Gets the inventory index of the currently topmost duplicate.
int sellCurrentDuplicate(int quantity)
Reduces the quantity of the topmost duplicate by the specified amount.
int getPrice() const
Gets the price of the item.
This class handles the list of items available in a shop.
void addItem(int id, int amount, int price)
Adds an item to the list.
ShopItem * at(int i) const
Returns the item number i in the shop.
int getNumberOfElements() override
Returns the number of items in the shop.
void erase(int i)
Removes an element from the shop.
void clear()
Clears the list of items in the shop.
A list box, meant to be used inside a scroll area.
void setPriceCheck(bool check)
Set on/off the disabling of too expensive items.
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.
static std::string formatCurrency(int value)
Formats the given number in the correct currency format.
void center()
Positions the window in the center of it's parent.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void setMinHeight(int height)
Sets the minimum height of the window.
virtual void close()
Overrideable functionality for when the window is to close.
Layout & getLayout()
Gets the layout handler for this window.
void setWindowName(const std::string &name)
Sets the name of the window.
ContainerPlacer getPlacer(int x, int y)
Returns a proxy for adding widgets in an inner table of the layout.
void setResizable(bool resize)
Sets whether or not the window can be resized.
LayoutCell & place(int x, int y, gcn::Widget *, int w=1, int h=1)
Adds a widget to the window and sets it at given cell.
void scheduleDelete()
Schedule this window for deletion.
void setCloseButton(bool flag)
Sets whether or not the window has a close button.
void setDefaultSize()
Set the default win pos and size to the current ones.
void loadWindowState()
Reads the position (and the size for resizable windows) in the configuration based on the given strin...
void setMinWidth(int width)
Sets the minimum width of the window.
bool isDoubleClick(int selected)
Returns whether this call and the last call were done for the same selected index and within a short ...
ServerType getNetworkType()
NpcHandler * getNpcHandler()
void setBuySellState(BuySellState buySellState)
Sets which buy, sell, or related interaction the player is currently involved in.
BuySellState getBuySellState()
Returns the current buy, sell, or related interaction the player is involved in.
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.