Mana
Loading...
Searching...
No Matches
itemamountwindow.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/window.h"
25
26#include <guichan/keylistener.hpp>
27#include <guichan/actionlistener.hpp>
28
29class IntTextField;
30class Item;
31class ItemPopup;
32class Icon;
33
39class ItemAmountWindow : public Window,
40 public gcn::ActionListener,
41 public gcn::KeyListener
42{
43 public:
50
54 void action(const gcn::ActionEvent &event) override;
55
59 void resetAmount();
60
61 // MouseListener
62 void mouseMoved(gcn::MouseEvent &event) override;
63 void mouseExited(gcn::MouseEvent &event) override;
64
68 void close() override;
69
70 void keyReleased(gcn::KeyEvent &keyEvent) override;
71
75 static void showWindow(Usage usage, Window *parent, Item *item,
76 int maxRange = 0);
77
78 ~ItemAmountWindow() override;
79
80 private:
81 static void finish(Item *item, int amount, Usage usage);
82
83 ItemAmountWindow(Usage usage, Window *parent, Item *item,
84 int maxRange = 0);
85
89
90 int mMax;
93
97 gcn::Slider *mItemAmountSlide;
98
100};
An icon.
Definition icon.h:36
TextBox which only accepts numbers as input.
Window used for selecting the amount of items to drop, trade or store.
gcn::Slider * mItemAmountSlide
Item Amount buttons.
void close() override
Schedules the Item Amount window for deletion.
void keyReleased(gcn::KeyEvent &keyEvent) override
ItemPopup * mItemPopup
void mouseExited(gcn::MouseEvent &event) override
static void finish(Item *item, int amount, Usage usage)
void mouseMoved(gcn::MouseEvent &event) override
IntTextField * mItemAmountTextField
Item amount caption.
void resetAmount()
Sets default amount value.
void action(const gcn::ActionEvent &event) override
Called when receiving actions from widget.
static void showWindow(Usage usage, Window *parent, Item *item, int maxRange=0)
Creates the dialog, or bypass it if there aren't enough items.
A popup that displays information about an item.
Definition itempopup.h:39
Represents one or more instances of a certain item type.
Definition item.h:35
A window.
Definition window.h:59