gzdoom/libraries/ZWidget/include/zwidget/widgets/textlabel/textlabel.h
2024-01-10 17:08:50 +01:00

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;
};