wavelength 1.0.0
Loading...
Searching...
No Matches
uilabel.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/prnstream.h"
4#include "rnd/rndtext.h"
5#include "script/dataarray.h"
6#include "ui/uicomponent.h"
7#include "ui/uistyle.h"
8
18class UILabel : public UIComponent {
19public:
28 UILabel(DataArray *pData, const char *pszPanel);
29
36 ~UILabel() override {
37 }
38
50 static UIComponent *New(DataArray *pData, const char *pszPanel) {
51 return new UILabel(pData, pszPanel);
52 }
53
63 void SetShowing(bool bShowing) override;
64
74 const char *Text() const override;
75
85 void SetText(const char *pszText) override;
86
97 void SetState(int nState, bool bForce) override;
98
106 void Print(PrnStream &stream) override;
107
115 void SetStyle(UIStyle *pStyle);
116
118 RndText *GetText() const {
119 return mText;
120 }
121
122private:
123 RndText *mText;
124 UIStyle *mStyle;
125};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Text output stream.
Definition prnstream.h:16
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
UIComponent(DataArray *pData)
Construct a showing component in the normal state.
Definition uicomponent.h:37
void SetShowing(bool bShowing) override
Show or hide the label and its text object.
void Print(PrnStream &stream) override
Write the name, the visibility, and the name of the text object.
void SetState(int nState, bool bForce) override
Change the state and give the text object the font the style lists for it.
RndText * GetText() const
Definition uilabel.h:118
const char * Text() const override
Report the text of the text object.
void SetStyle(UIStyle *pStyle)
Replace the style and give the text object the font of the current state.
UILabel(DataArray *pData, const char *pszPanel)
Construct a label from its script description.
void SetText(const char *pszText) override
Replace the text of the text object.
static UIComponent * New(DataArray *pData, const char *pszPanel)
Create a label from its script description.
Definition uilabel.h:50
~UILabel() override
Destroy the label.
Definition uilabel.h:36
Material and font a component draws with in each of its states.
Definition uistyle.h:15