Mana
Loading...
Searching...
No Matches
src
gui
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
29
class
IntTextField
;
30
class
Item
;
31
class
ItemPopup
;
32
class
Icon
;
33
39
class
ItemAmountWindow
:
public
Window
,
40
public
gcn::ActionListener,
41
public
gcn::KeyListener
42
{
43
public
:
44
enum
Usage
{
45
TradeAdd
,
46
ItemDrop
,
47
StoreAdd
,
48
StoreRemove
,
49
};
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
86
IntTextField
*
mItemAmountTextField
;
87
Item
*
mItem
;
88
Icon
*
mItemIcon
;
89
90
int
mMax
;
91
Usage
mUsage
;
92
ItemPopup
*
mItemPopup
;
93
97
gcn::Slider *
mItemAmountSlide
;
98
99
bool
mEnabledKeyboard
;
100
};
Icon
An icon.
Definition
icon.h:36
IntTextField
TextBox which only accepts numbers as input.
Definition
inttextfield.h:30
ItemAmountWindow
Window used for selecting the amount of items to drop, trade or store.
Definition
itemamountwindow.h:42
ItemAmountWindow::~ItemAmountWindow
~ItemAmountWindow() override
Definition
itemamountwindow.cpp:158
ItemAmountWindow::mItemAmountSlide
gcn::Slider * mItemAmountSlide
Item Amount buttons.
Definition
itemamountwindow.h:97
ItemAmountWindow::close
void close() override
Schedules the Item Amount window for deletion.
Definition
itemamountwindow.cpp:218
ItemAmountWindow::Usage
Usage
Definition
itemamountwindow.h:44
ItemAmountWindow::TradeAdd
@ TradeAdd
Definition
itemamountwindow.h:45
ItemAmountWindow::ItemDrop
@ ItemDrop
Definition
itemamountwindow.h:46
ItemAmountWindow::StoreRemove
@ StoreRemove
Definition
itemamountwindow.h:48
ItemAmountWindow::StoreAdd
@ StoreAdd
Definition
itemamountwindow.h:47
ItemAmountWindow::keyReleased
void keyReleased(gcn::KeyEvent &keyEvent) override
Definition
itemamountwindow.cpp:224
ItemAmountWindow::mItemPopup
ItemPopup * mItemPopup
Definition
itemamountwindow.h:92
ItemAmountWindow::mouseExited
void mouseExited(gcn::MouseEvent &event) override
Definition
itemamountwindow.cpp:174
ItemAmountWindow::finish
static void finish(Item *item, int amount, Usage usage)
Definition
itemamountwindow.cpp:43
ItemAmountWindow::mEnabledKeyboard
bool mEnabledKeyboard
Definition
itemamountwindow.h:99
ItemAmountWindow::mouseMoved
void mouseMoved(gcn::MouseEvent &event) override
Definition
itemamountwindow.cpp:164
ItemAmountWindow::mItemAmountTextField
IntTextField * mItemAmountTextField
Item amount caption.
Definition
itemamountwindow.h:86
ItemAmountWindow::resetAmount
void resetAmount()
Sets default amount value.
Definition
itemamountwindow.cpp:179
ItemAmountWindow::action
void action(const gcn::ActionEvent &event) override
Called when receiving actions from widget.
Definition
itemamountwindow.cpp:184
ItemAmountWindow::mItem
Item * mItem
Definition
itemamountwindow.h:87
ItemAmountWindow::mItemIcon
Icon * mItemIcon
Definition
itemamountwindow.h:88
ItemAmountWindow::mUsage
Usage mUsage
Definition
itemamountwindow.h:91
ItemAmountWindow::showWindow
static void showWindow(Usage usage, Window *parent, Item *item, int maxRange=0)
Creates the dialog, or bypass it if there aren't enough items.
Definition
itemamountwindow.cpp:229
ItemAmountWindow::mMax
int mMax
Definition
itemamountwindow.h:90
ItemPopup
A popup that displays information about an item.
Definition
itempopup.h:39
Item
Represents one or more instances of a certain item type.
Definition
item.h:35
Window
A window.
Definition
window.h:59
window.h
Generated by
1.9.8