mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-02 08:53:42 +00:00
33 lines
578 B
C++
33 lines
578 B
C++
|
|
#pragma once
|
|
|
|
#include "../../core/widget.h"
|
|
|
|
enum TextLabelAlignment
|
|
{
|
|
Left,
|
|
Center,
|
|
Right
|
|
};
|
|
|
|
class TextLabel : public Widget
|
|
{
|
|
public:
|
|
TextLabel(Widget* parent = nullptr);
|
|
|
|
void SetText(const std::string& value);
|
|
const std::string& GetText() const;
|
|
|
|
void SetTextAlignment(TextLabelAlignment alignment);
|
|
TextLabelAlignment GetTextAlignment() const;
|
|
|
|
double GetPreferredWidth() const;
|
|
double GetPreferredHeight() const;
|
|
|
|
protected:
|
|
void OnPaint(Canvas* canvas) override;
|
|
|
|
private:
|
|
std::string text;
|
|
TextLabelAlignment textAlignment = TextLabelAlignment::Left;
|
|
};
|