7 string m_sDescriptionName;
22 string m_sUnreadImageName;
25 string m_sReadButtonName;
28 Widget m_wUnreadImage;
32 TextWidget m_wDescription;
37 ref ScriptInvoker m_OnRead =
new ScriptInvoker();
40 override void HandlerAttached(Widget w)
42 super.HandlerAttached(w);
44 m_wUnreadImage = w.FindAnyWidget(m_sUnreadImageName);
45 m_wTitle = TextWidget.Cast(w.FindAnyWidget(m_sTitleName));
46 m_wAuthor = TextWidget.Cast(w.FindAnyWidget(m_sAuthorName));
47 m_wDate = TextWidget.Cast(w.FindAnyWidget(m_sDateName));
48 m_wDescription = TextWidget.Cast(w.FindAnyWidget(m_sDescriptionName));
49 m_wFooter = w.FindAnyWidget(m_sFooterName);
51 if (!m_sReadButtonName.IsEmpty())
55 m_Read.m_OnActivated.Insert(OnRead);
60 m_wFooter.SetOpacity(0);
61 m_wFooter.SetEnabled(
false);
66 UpdateConnectionButtons();
70 override void HandlerDeattached(Widget w)
72 super.HandlerDeattached(w);
78 override bool OnFocus(Widget w,
int x,
int y)
80 super.OnFocus(w, x, y);
83 m_wFooter.SetEnabled(
true);
84 AnimateWidget.Opacity(m_wFooter, 1, m_fAnimationRate);
89 m_OnFocused.Invoke(
this);
94 override bool OnFocusLost(Widget w,
int x,
int y)
96 super.OnFocusLost(w, x, y);
100 AnimateWidget.Opacity(m_wFooter, 0, m_fAnimationRate);
101 m_wFooter.SetEnabled(
false);
106 protected void OnCommStatusCheckFinished(
SCR_ECommStatus status,
float responseTime,
float lastSuccessTime,
float lastFailTime)
108 UpdateConnectionButtons();
112 protected void UpdateConnectionButtons()
125 AnimateWidget.Opacity(m_wUnreadImage, 0,
UIConstants.FADE_RATE_DEFAULT);
133 m_wRoot.SetOpacity(entry !=
null);
134 m_wRoot.SetEnabled(entry !=
null);
141 m_wTitle.SetText(entry.m_Item.Title());
144 m_wDescription.SetText(entry.m_Item.Excerpt());
147 m_wAuthor.SetText(entry.m_Item.Slug());
150 m_wDate.SetText(entry.m_Item.Date());
152 string imagePreview = entry.m_Item.Path();
154 if (
m_wImage && !imagePreview.IsEmpty())
157 bool loaded =
m_wImage.LoadImageTexture(1, imagePreview);
165 m_wImage.GetImageSize(loaded, sx, sy);
170 m_wUnreadImage.SetOpacity(!entry.m_bRead);
177 m_OnRead.Invoke(
this);