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 
47  };
48 }
Button widget.
Definition: button.hpp:32
Grouping to keep widgets together without triggering events.
Definition: group.hpp:44
Input widget for keyboard inputs.
Definition: input.hpp:34
A version of the Input widget that only allows numbers.
std::string get_buffer() const
void set_buffer(const std::string &_buffer)
NumericInput(int _x, int _y, unsigned w, unsigned h, Widget *_parent)
The master widget all the other widgets inherit from, do not use directly instead use one of the many...
Definition: widget.hpp:176