Symphony Of Empires
numeric_input.hpp
Go to the documentation of this file.
1
// Symphony of Empires
2
// Copyright (C) 2021, Symphony of Empires contributors
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
//
17
// ----------------------------------------------------------------------------
18
// Name:
19
// eng3d/ui/numeric_input.hpp
20
//
21
// Abstract:
22
// Numeric input allows the user to input only numerical digits
23
// useful for dates or decimal digits.
24
// ----------------------------------------------------------------------------
25
26
#pragma once
27
28
#include <string>
29
#include "eng3d/ui/group.hpp"
30
31
namespace
UI
{
32
class
Context;
33
class
Input
;
34
class
Button;
35
38
class
NumericInput
:
public
Group
{
39
public
:
40
NumericInput
(
int
_x,
int
_y,
unsigned
w,
unsigned
h,
Widget
* _parent);
41
void
set_buffer
(
const
std::string& _buffer);
42
std::string
get_buffer
()
const
;
43
44
Input
*
inp
;
45
Button
*
add_btn
;
46
Button
*
sub_btn
;
47
};
48
}
Input
Definition:
game_state.hpp:95
UI::Button
Button widget.
Definition:
button.hpp:32
UI::Group
Grouping to keep widgets together without triggering events.
Definition:
group.hpp:44
UI::Input
Input widget for keyboard inputs.
Definition:
input.hpp:34
UI::NumericInput
A version of the Input widget that only allows numbers.
Definition:
numeric_input.hpp:38
UI::NumericInput::sub_btn
Button * sub_btn
Definition:
numeric_input.hpp:46
UI::NumericInput::add_btn
Button * add_btn
Definition:
numeric_input.hpp:45
UI::NumericInput::get_buffer
std::string get_buffer() const
Definition:
numeric_input.cpp:64
UI::NumericInput::set_buffer
void set_buffer(const std::string &_buffer)
Definition:
numeric_input.cpp:60
UI::NumericInput::inp
Input * inp
Definition:
numeric_input.hpp:44
UI::NumericInput::NumericInput
NumericInput(int _x, int _y, unsigned w, unsigned h, Widget *_parent)
Definition:
numeric_input.cpp:31
UI::Widget
The master widget all the other widgets inherit from, do not use directly instead use one of the many...
Definition:
widget.hpp:176
UI
Definition:
game_state.hpp:117
eng3d
src
ui
numeric_input.hpp
Generated by
1.9.1