SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Label.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
12class Label : public Component
13{
14 wstring _text;
15 long _alignment;
16
17 COLORREF _bkColor, _fgColor;
18 BOOL _bkColorSet, _fgColorSet;
19
20protected:
21
31 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
32
37
38public:
39
44
48 virtual ~Label();
49
55 void setText(const wstring& text);
56
62 void setAlignment(long alignment);
63
64 void setBackgroundColor(COLORREF color);
65 void setForegroundColor(COLORREF color);
66
67public: // Overridables
68
69 void onPaint(Graphics* g) override;
70 void onWindowResized() override;
71};
Component()
Constructs a new Component instance.
Definition Graphics.h:171
void setBackgroundColor(COLORREF color)
void onWindowResized() override
Called when the component's window is resized.
void onPaint(Graphics *g) override
Called to paint the component's client area.
void setForegroundColor(COLORREF color)
void setText(const wstring &text)
Sets the text content of the label.
void setAlignment(long alignment)
Sets the text alignment within the label.
void windowCreated()
Called after the native window has been created to perform initialization.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Provides options needed to create the native window for the label.
virtual ~Label()
Destructor for Label component.
Label()
Constructs an empty Label component.