wavelength 1.0.0
Loading...
Searching...
No Matches
uistyle.h
Go to the documentation of this file.
1#pragma once
2
3#include "rnd/rndfont.h"
4#include "rnd/rndmat.h"
5#include "script/dataarray.h"
6
15class UIStyle {
16public:
27 explicit UIStyle(DataArray *pData);
28
35 virtual ~UIStyle() {
36 }
37
47 RndMat *GetMat(int nState) const;
48
58 RndFont *GetFont(int nState) const;
59
68 void SetNormal(RndMat *pMat, RndFont *pFont);
69
78 void SetSelected(RndMat *pMat, RndFont *pFont);
79
88 void SetGrey(RndMat *pMat, RndFont *pFont);
89
100 static UIStyle *New(DataArray *pData) {
101 return new UIStyle(pData);
102 }
103
105 const char *GetName() const {
106 return mName;
107 }
108
109private:
110 const char *mName;
111 RndMat *mNormalMat;
112 RndMat *mSelectedMat;
113 RndMat *mGreyMat;
114 RndFont *mNormalFont;
115 RndFont *mSelectedFont;
116 RndFont *mGreyFont;
117};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Bitmap font, a grid of character cells in the texture of a material's first stage.
Definition rndfont.h:20
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
static UIStyle * New(DataArray *pData)
Create a style from its script description.
Definition uistyle.h:100
UIStyle(DataArray *pData)
Construct a style from its script description.
RndMat * GetMat(int nState) const
Report the material of a state.
const char * GetName() const
Definition uistyle.h:105
void SetNormal(RndMat *pMat, RndFont *pFont)
Set the material and the font of the normal state.
void SetSelected(RndMat *pMat, RndFont *pFont)
Set the material and the font of the selected state.
void SetGrey(RndMat *pMat, RndFont *pFont)
Set the material and the font of the disabled state.
RndFont * GetFont(int nState) const
Report the font of a state.
virtual ~UIStyle()
Destroy the style.
Definition uistyle.h:35