Symphony Of Empires
label.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/label.hpp
20 //
21 // Abstract:
22 // Label is a simple widget that draws text on the screen - it does not
23 // support multiline paragraphs, use Text for that instead.
24 // ----------------------------------------------------------------------------
25 
26 #pragma once
27 
28 #include <cstddef>
29 #include <deque>
30 #include <functional>
31 #include <vector>
32 #include <string>
33 
34 #include "eng3d/ui/widget.hpp"
35 
36 namespace UI {
37  class Context;
40  class Label: public Widget {
41  public:
42  Label(int x, int y, const std::string& text = " ", Widget* parent = nullptr);
43  virtual ~Label();
44  virtual void set_text(const std::string& _text);
45  };
46 }
Simple widget for drawing text on the screen, no multiline support.
Definition: label.hpp:40
virtual ~Label()
Definition: label.cpp:48
virtual void set_text(const std::string &_text)
Generates text for the widget and overrides the current text texture.
Definition: label.cpp:52
Label(int x, int y, const std::string &text=" ", Widget *parent=nullptr)
Definition: label.cpp:41
The master widget all the other widgets inherit from, do not use directly instead use one of the many...
Definition: widget.hpp:176
UI::Widget * parent
Definition: widget.hpp:314