32 #include "gui/viewport.h"
123 if (dialog !=
nullptr)
135 const int maxRange) :
145 mItemAmountSlide(
new Slider(this, 1.0, maxRange, 1.0)),
152 mEnabledKeyboard(
keyboard.isEnabled())
154 if (
mItem ==
nullptr)
245 placer(1, n, minusAmountButton, 1, 1);
247 placer(5, n, plusAmountButton, 1, 1);
248 placer(6, n, addAllButton, 1, 1);
271 placer(1, n + 2, minusPriceButton, 1, 1);
273 placer(5, n + 2, plusPriceButton, 1, 1);
277 placer(4, n + 5, cancelButton, 1, 1);
278 placer(5, n + 5, okButton, 1, 1);
282 placer(4, n + 2, cancelButton, 1, 1);
283 placer(5, n + 2, okButton, 1, 1);
314 setCaption(
_(
"Select amount of items to store to cart."));
318 setCaption(
_(
"Select amount of items to retrieve."));
322 setCaption(
_(
"Select amount of items to retrieve from cart."));
387 const std::string &eventId =
event.getId();
388 if (eventId ==
"cancel")
393 else if (eventId ==
"ok")
422 else if (eventId ==
"itemType")
451 if (eventId ==
"inc" && amount <
mMax)
453 else if (eventId ==
"dec" && amount > 1)
455 else if (eventId ==
"all")
457 else if (eventId ==
"slide")
471 if (eventId ==
"incPrice")
478 else if (eventId ==
"decPrice")
485 else if (eventId ==
"slidePrice")
526 finish(item, maxRange, tag, usage);
528 finish(item, maxRange, 0, usage);
533 usage, parent, item, maxRange);
const bool AutoRelease_false
#define fromBool(val, name)
Widget * getSource() const
void setImage(Image *const image)
void setValue(const int value)
void setRange(const int minimum, const int maximum)
void mouseExited(MouseEvent &event)
IntTextField * mItemPriceTextField
static void finish(Item *const item, const int amount, const int price, const ItemAmountWindowUsageT usage)
void keyReleased(KeyEvent &event)
ItemAmountWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, const int maxRange)
IntTextField * mItemAmountTextField
Slider * mItemAmountSlide
void action(const ActionEvent &event)
ItemAmountWindowUsageT mUsage
void mouseMoved(MouseEvent &event)
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
std::string getElementAt(int i)
void setEnabled(const bool flag)
void addItem(const Item *const item, const int amount)
virtual void moveItem2(const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
virtual void splitItem(const Item *const item, const int amount) const =0
virtual void addItem(const Item *const item, const int amount) const =0
virtual NpcDialog * getCurrentNpcDialog() const =0
void addCraftItem(Item *const item, const int amount, const int slot)
void addSellItem(const Item *const item, const int amount, const int price)
void addBuyItem(const Item *const item, const int amount, const int price)
void setValue(const double value)
void tradeItem(const Item *const item, const int quantity, const bool check) const
ContainerPlacer getPlacer(const int x, const int y)
virtual void setVisible(Visible visible)
Window * getParentWindow() const
void reflowLayout(int w, int h)
void setCaption(const std::string &caption)
void mouseMoved(MouseEvent &event)
virtual void scheduleDelete()
void setLocationRelativeTo(const Widget *const widget)
const bool Equipped_false
const bool Favorite_false
const bool Identified_true
Net::InventoryHandler * inventoryHandler
ItemAmountWindowUsage ::T ItemAmountWindowUsageT
const ItemColor ItemColor_one
Net::Mail2Handler * mail2Handler
MailEditWindow * mailEditWindow
const ItemInfo & get(const int id)
Image * getImage(const std::string &idPath)
void dropItem(const Item *const item, const int amount, const Sfx sfx)
Net::NpcHandler * npcHandler
TradeWindow * tradeWindow