-
Notifications
You must be signed in to change notification settings - Fork 99
/
label.h
49 lines (36 loc) · 938 Bytes
/
label.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
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "forms/control.h"
#include "forms/forms_enums.h"
#include "library/sp.h"
#include "library/strings.h"
namespace OpenApoc
{
class BitmapFont;
class ScrollBar;
class Label : public Control
{
private:
UString text;
sp<BitmapFont> font;
int scrollOffset;
protected:
void onRender() override;
public:
sp<ScrollBar> scroller;
HorizontalAlignment TextHAlign;
VerticalAlignment TextVAlign;
bool WordWrap;
Colour Tint{255, 255, 255, 255};
Label(const UString &Text = "", sp<BitmapFont> font = nullptr);
~Label() override;
void eventOccured(Event *e) override;
void update() override;
void unloadResources() override;
UString getText() const;
void setText(const UString &Text);
sp<BitmapFont> getFont() const;
void setFont(sp<BitmapFont> NewFont);
sp<Control> copyTo(sp<Control> CopyParent) override;
void configureSelfFromXml(pugi::xml_node *node) override;
};
}; // namespace OpenApoc