Pioneer
src
gui
GuiLabel.h
Go to the documentation of this file.
1
// Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4
#ifndef _GUILABEL_H
5
#define _GUILABEL_H
6
7
#include "
GuiTextLayout.h
"
8
#include "
GuiWidget.h
"
9
#include <SDL_stdinc.h>
10
#include <string>
11
12
namespace
Text
{
13
class
TextureFont
;
14
}
15
16
namespace
Gui
{
17
class
Label
:
public
Widget
{
18
public
:
19
Label
(
const
char
*text,
TextLayout::ColourMarkupMode
colourMarkupMode =
TextLayout::ColourMarkupUse
);
20
Label
(
const
std::string &text,
TextLayout::ColourMarkupMode
colourMarkupMode =
TextLayout::ColourMarkupUse
);
21
virtual
void
Draw
();
22
virtual
~Label
();
23
virtual
void
GetSizeRequested
(
float
size[2]);
24
void
SetText
(
const
char
*text);
25
void
SetText
(
const
std::string &text);
26
Label
*
Shadow
(
bool
isOn)
27
{
28
m_shadow = isOn;
29
return
this
;
30
}
31
Label
*
Color
(Uint8 r, Uint8 g, Uint8 b);
32
Label
*
Color
(
const ::Color
&);
33
34
private
:
35
void
Init(
const
std::string &text,
TextLayout::ColourMarkupMode
colourMarkupMode);
36
void
UpdateLayout();
37
void
RecalcSize();
38
std::string m_text;
39
::Color
m_color;
40
bool
m_shadow;
41
Uint32 m_dlist;
42
RefCountedPtr<Text::TextureFont>
m_font;
43
std::unique_ptr<TextLayout> m_layout;
44
TextLayout::ColourMarkupMode
m_colourMarkupMode;
45
bool
m_needsUpdate;
46
};
47
}
// namespace Gui
48
49
#endif
/* _GUILABEL_H */
Color
Color4ub Color
Definition:
Color.h:197
GuiTextLayout.h
GuiWidget.h
Gui::Label
Definition:
GuiLabel.h:17
Gui::Label::SetText
void SetText(const char *text)
Definition:
GuiLabel.cpp:68
Gui::Label::~Label
virtual ~Label()
Definition:
GuiLabel.cpp:20
Gui::Label::Color
Label * Color(Uint8 r, Uint8 g, Uint8 b)
Definition:
GuiLabel.cpp:51
Gui::Label::Shadow
Label * Shadow(bool isOn)
Definition:
GuiLabel.h:26
Gui::Label::Label
Label(const char *text, TextLayout::ColourMarkupMode colourMarkupMode=TextLayout::ColourMarkupUse)
Definition:
GuiLabel.cpp:10
Gui::Label::Draw
virtual void Draw()
Definition:
GuiLabel.cpp:82
Gui::Label::GetSizeRequested
virtual void GetSizeRequested(float size[2])
Definition:
GuiLabel.cpp:106
Gui::TextLayout::ColourMarkupMode
ColourMarkupMode
Definition:
GuiTextLayout.h:16
Gui::TextLayout::ColourMarkupUse
@ ColourMarkupUse
Definition:
GuiTextLayout.h:19
Gui::Widget
Definition:
GuiWidget.h:14
RefCountedPtr< Text::TextureFont >
Text::TextureFont
Definition:
TextureFont.h:34
Gui
Definition:
Gui.cpp:10
Text
Definition:
GuiLabel.h:12
Color4ub
Definition:
Color.h:66
Generated by
1.9.1