5 const string WIDGET_TEXT_PROGRESS =
"TxtProgress";
6 const string WIDGET_PROGRESS_BAR =
"ProgressDownload";
9 protected TextWidget m_wTxtProgress;
17 override void HandlerAttached(Widget w)
19 super.HandlerAttached(w);
22 m_wTxtProgress = TextWidget.Cast(w.FindAnyWidget(WIDGET_TEXT_PROGRESS));
24 Widget wProgressBar = w.FindAnyWidget(WIDGET_PROGRESS_BAR);
34 void SetProgress(
float progress)
39 m_ProgressBar.SetValue(progress);
42 float progValue = m_ProgressBar.GetValue() - m_ProgressBar.GetMin();
43 progValue /= m_ProgressBar.GetMax() - m_ProgressBar.GetMin();
45 progValue = Math.Floor(progValue);
49 m_wTxtProgress.SetText(progValue.ToString() +
"%");