cecd34301d Delay load DPI-related functions bfc172f702 Added exception to some unimplemented functions 7c8d469bcb Added item modifications functions 847d0e6d9e Improved keyboard navigation 8c4270e0f8 Dropdown can now be closed by re-selecting it 91402c31ec Fix dropdown positioning in x11 and win32 git-subtree-dir: libraries/ZWidget git-subtree-split: cecd34301d369400227eb0f27bad2ab41ad756d2
33 lines
584 B
C++
33 lines
584 B
C++
|
|
#pragma once
|
|
|
|
#include "../../core/widget.h"
|
|
|
|
enum class 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;
|
|
};
|