forked from pioneerspacesim/pioneer
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GuiLabel.h
37 lines (33 loc) · 1.06 KB
/
GuiLabel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _GUILABEL_H
#define _GUILABEL_H
#include "GuiWidget.h"
#include "GuiTextLayout.h"
#include <string>
namespace Text { class TextureFont; }
namespace Gui {
class Label: public Widget {
public:
Label(const char *text, TextLayout::ColourMarkupMode colourMarkupMode = TextLayout::ColourMarkupUse);
Label(const std::string &text, TextLayout::ColourMarkupMode colourMarkupMode = TextLayout::ColourMarkupUse);
virtual void Draw();
virtual ~Label();
virtual void GetSizeRequested(float size[2]);
void SetText(const char *text);
void SetText(const std::string &text);
Label *Shadow(bool isOn) { m_shadow = isOn; return this; }
Label *Color(float r, float g, float b);
Label *Color(const ::Color &);
private:
void Init(const std::string &text, TextLayout::ColourMarkupMode colourMarkupMode);
void UpdateLayout();
void RecalcSize();
std::string m_text;
::Color m_color;
bool m_shadow;
GLuint m_dlist;
RefCountedPtr<Text::TextureFont> m_font;
TextLayout *m_layout;
TextLayout::ColourMarkupMode m_colourMarkupMode;
};
}
#endif /* _GUILABEL_H */