8#include "helper/SplitString.h"
13 : m_uAlign(Align_Center)
25 for (
int i = 0; i < 4; i++)
60 uRet |= DT_SINGLELINE;
62 uRet |= DT_END_ELLIPSIS;
68 int fonts = 1, colors = 1;
69 for (
int i = 1; i < 4; i++)
71 if (
m_ftText[i].GetFontPtr() != NULL)
76 return smax(fonts, colors);
92 return m_ftText[iState].GetFontPtr();
98 return !bLoading ? S_OK : S_FALSE;
104 return !bLoading ? S_OK : S_FALSE;
111 return !bLoading ? S_OK : S_FALSE;
117 size_t nValues = SplitString(strValue, L
',', values);
120 layoutSizes[0] = layoutSizes[1] = layoutSizes[2] = layoutSizes[3] = GETLAYOUTSIZE(values[0]);
122 else if (nValues == 2)
124 layoutSizes[0] = layoutSizes[2] = GETLAYOUTSIZE(values[0]);
125 layoutSizes[1] = layoutSizes[3] = GETLAYOUTSIZE(values[1]);
127 else if (nValues == 4)
129 layoutSizes[0] = GETLAYOUTSIZE(values[0]);
130 layoutSizes[1] = GETLAYOUTSIZE(values[1]);
131 layoutSizes[2] = GETLAYOUTSIZE(values[2]);
132 layoutSizes[3] = GETLAYOUTSIZE(values[3]);
139 return bLoading ? S_FALSE : S_OK;
145 for (
int i = 0; i < 4; i++)
188 for (
int i = 0; i < 4; i++)
A class representing an ASCII string.
UINT GetTextAlign() const
Retrieves the text alignment.
void UpdateFont()
Updates the font based on the current scale.
SDpiAwareFont m_ftText[4]
UINT GetAlign() const
Retrieves the alignment (horizontal and vertical).
IFontPtr GetTextFont(int iState)
Retrieves the text font for a specific state.
int GetScale() const
Retrieves the scale factor.
void _ParseLayoutSize4(const SStringW &strValue, SLayoutSize layoutSizes[])
Parses a string into an array of layout sizes.
HRESULT OnAttrPadding(const SStringW &strValue, BOOL bLoading)
Handles the 'padding' attribute.
void SetScale(int nScale)
Sets the scale factor.
void SetVAlign(UINT uAlign)
Sets the vertical alignment.
void SetAlign(UINT uAlign)
Sets the horizontal alignment.
HRESULT OnAttrMarginX(const SStringW &strValue, BOOL bLoading)
Handles the 'margin-x' attribute.
SLayoutSize m_rcMargin[4]
HRESULT OnAttrMarginY(const SStringW &strValue, BOOL bLoading)
Handles the 'margin-y' attribute.
HRESULT OnAttrMargin(const SStringW &strValue, BOOL bLoading)
Handles the 'margin' attribute.
int GetStates()
Retrieves the number of states.
COLORREF GetTextColor(int iState)
Retrieves the text color for a specific state.
CRect GetMargin() const
Retrieves the margin rectangle.
CRect GetPadding() const
Retrieves the padding rectangle.