Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ContentEntryComponent.c
Go to the documentation of this file.
1
2// Base for Mods & Scenario entries
3
4//------------------------------------------------------------------------------------------------
6{
7 //const string WIDGET_ = "";
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";
12
13 // Widgets
17
18 //------------------------------------------------------------------------------------------------
19 override void HandlerAttached(Widget w)
20 {
21 super.HandlerAttached(w);
22
23 // Get widgets
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));
27 }
28
29 //------------------------------------------------------------------------------------------------
31 protected void SetTextSafe(TextWidget txt, string str)
32 {
33 if (txt)
34 txt.SetText(str);
35 }
36
37 //------------------------------------------------------------------------------------------------
38 void SetLabelText(string str) { SetTextSafe(m_wTxtLabel, str); }
39
40 //------------------------------------------------------------------------------------------------
42
43 //------------------------------------------------------------------------------------------------
45 {
46 if (image.IsEmpty())
47 return;
48
50 {
51 m_wImgThumbnail.LoadImageTexture(0, image, false, true);
52 int sx, sy;
53 m_wImgThumbnail.GetImageSize(0, sx, sy);
54 m_wImgThumbnail.SetSize(sx, sy);
55 }
56 }
57
58
59};
Base class for any button, regardless its own content.
Base component for widgets displaying content data.
void SetThumbnail(ResourceName image)
void SetTextSafe(TextWidget txt, string str)
Just simple on line text setting.
void SetDescriptionText(string str)
void SetLabelText(string str)
override void HandlerAttached(Widget w)
TextWidget m_wTxtLabel
ImageWidget m_wImgThumbnail
TextWidget m_wTxtDescription