gzdoom/libraries/ZWidget/include/zwidget/widgets/textlabel/textlabel.h
Magnus Norddahl 16e578a0f8 Implement NetStartWindow
# Conflicts:
#	src/p_setup.cpp
2024-01-02 16:55:52 +01:00

32 lines
543 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 GetPreferredHeight() const;
protected:
void OnPaint(Canvas* canvas) override;
private:
std::string text;
TextLabelAlignment textAlignment = TextLabelAlignment::Left;
};