raze/libraries/ZWidget/include/zwidget/widgets/textlabel/textlabel.h

34 lines
578 B
C
Raw Normal View History

2024-01-04 19:37:57 +00:00
#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;
2024-01-11 23:22:08 +00:00
double GetPreferredWidth() const;
2024-01-04 19:37:57 +00:00
double GetPreferredHeight() const;
protected:
void OnPaint(Canvas* canvas) override;
private:
std::string text;
TextLabelAlignment textAlignment = TextLabelAlignment::Left;
};