7 const string WIDGET_LABEL =
"Content";
8 const string WIDGET_ICON =
"Icon";
9 const string WIDGET_DATA =
"Data";
11 const string WIDGET_BACKGROUND =
"Background";
14 protected bool m_bVisibleBackground;
17 protected bool m_bVisibleIcon;
20 protected bool m_bVisibleData;
23 protected string m_sLabel;
25 [
Attribute(
"{2EFEA2AF1F38E7F0}UI/Textures/Icons/icons_wrapperUI-64.imageset", UIWidgets.ResourceNamePicker)]
26 protected ResourceName m_ImageSetDefault;
29 protected string m_sImage;
31 protected TextWidget m_wTxtLabel;
32 protected ImageWidget m_wImgIcon;
33 protected TextWidget m_wTxtData;
35 protected ImageWidget m_wImgBackground;
38 override void HandlerAttached(Widget w)
40 super.HandlerAttached(w);
43 m_wTxtLabel = TextWidget.Cast(w.FindAnyWidget(WIDGET_LABEL));
44 m_wImgIcon = ImageWidget.Cast(w.FindAnyWidget(WIDGET_ICON));
45 m_wTxtData = TextWidget.Cast(w.FindAnyWidget(WIDGET_DATA));
47 m_wImgBackground = ImageWidget.Cast(w.FindAnyWidget(WIDGET_BACKGROUND));
51 SetIconFromImageSet(m_sImage, m_ImageSetDefault);
55 protected void VisualSetup()
60 m_wImgBackground.SetVisible(m_bVisibleBackground);
66 m_wImgIcon.SetVisible(m_bVisibleIcon);
72 m_wTxtData.SetVisible(m_bVisibleData);
76 if (m_wTxtLabel && !m_sLabel.IsEmpty())
78 m_wTxtLabel.SetText(m_sLabel);
84 void SetLabelText(
string text)
87 m_wTxtLabel.SetText(text);
91 void SetIconFromImageSet(
string text, ResourceName imageSet =
string.Empty)
94 imageSet = m_ImageSetDefault;
102 m_wImgIcon.LoadImageFromSet(0, imageSet, m_sImage);
106 void SetDataText(
string text)
109 m_wTxtData.SetText(text);
113 void SetElementsVisible(
bool label,
bool icon,
bool data)
116 m_wTxtLabel.SetVisible(label);
119 m_wImgIcon.SetVisible(icon);
122 m_wTxtData.SetVisible(
data);
127 void SetBackroundVisible(
bool visible)
129 if (m_wImgBackground)
131 m_wImgBackground.SetVisible(visible);