Mana
Loading...
Searching...
No Matches
inttextfield.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 "textfield.h"
25
29class IntTextField : public TextField
30{
31 public:
35 IntTextField(int def = 0);
36
40 void setRange(int minimum, int maximum);
41
45 int getValue();
46
50 void reset();
51
55 void setValue(int value);
56
60 void setDefaultValue(int value);
61
65 void keyPressed(gcn::KeyEvent &event) override;
66
67 private:
68 int mMin;
69 int mMax;
71 int mValue;
72};
TextBox which only accepts numbers as input.
void keyPressed(gcn::KeyEvent &event) override
Responds to key presses.
int mDefault
Default value.
int mValue
Current value.
int mMax
Maximum value.
int mMin
Minimum value.
void reset()
Reset the field to the default value.
void setRange(int minimum, int maximum)
Sets the minimum and maximum values of the text box.
int getValue()
Returns the value in the text box.
void setDefaultValue(int value)
Set the default value of the text box to the specified value.
void setValue(int value)
Set the value of the text box to the specified value.
A text field.
Definition textfield.h:72