8 const string WIDGET_IMAGE_THUMBNAIL =
"ImgThumbnail";
9 const string WIDGET_TEXT_LABEL =
"TxtLabel";
10 const string WIDGET_TEXT_DESCRIPTION =
"TxtDescription";
11 const string WIDGET_BTN_DOWNLOAD =
"BtnDownload";
14 protected ImageWidget m_wImgThumbnail;
15 protected TextWidget m_wTxtLabel;
16 protected TextWidget m_wTxtDescription;
19 override void HandlerAttached(Widget w)
21 super.HandlerAttached(w);
24 m_wImgThumbnail = ImageWidget.Cast(w.FindAnyWidget(WIDGET_IMAGE_THUMBNAIL));
25 m_wTxtLabel = TextWidget.Cast(w.FindAnyWidget(WIDGET_TEXT_LABEL));
26 m_wTxtDescription = TextWidget.Cast(w.FindAnyWidget(WIDGET_TEXT_DESCRIPTION));
31 protected void SetTextSafe(TextWidget txt,
string str)
38 void SetLabelText(
string str) { SetTextSafe(m_wTxtLabel, str); }
41 void SetDescriptionText(
string str) { SetTextSafe(m_wTxtDescription, str); }
44 void SetThumbnail(ResourceName image)
51 m_wImgThumbnail.LoadImageTexture(0, image,
false,
true);
53 m_wImgThumbnail.GetImageSize(0, sx, sy);
54 m_wImgThumbnail.SetSize(sx, sy);