4 protected string m_sIconWidgetName;
7 protected string m_sToggleWidgetName;
10 protected ImageWidget m_IconWidget;
11 protected ImageWidget m_ToggleWidget;
15 protected void OnToggleChange(
int value,
bool highlight =
false)
17 m_IconWidget.SetVisible(!highlight);
18 m_ToggleWidget.SetVisible(highlight);
23 m_TooltipTarget.SetInfo(m_ToggleAction.GetInfoToggled(), m_ToggleAction);
25 m_TooltipTarget.SetInfo(m_ToggleAction.GetInfo(), m_ToggleAction);
41 m_TooltipTarget.SetInfo(info, action);
48 info.SetIconTo(m_IconWidget);
53 m_IconWidget.SetColor(colorInfo.GetColor());
56 m_ToggleWidget = ImageWidget.Cast(widget.FindAnyWidget(m_sToggleWidgetName));
59 m_ToggleWidget.SetVisible(
false);
64 if (m_ToggleAction.GetInfoToggled())
65 m_ToggleAction.GetInfoToggled().SetIconTo(m_ToggleWidget);
67 info.SetIconTo(m_ToggleWidget);
69 m_ToggleAction.GetOnToggleChange().Insert(OnToggleChange);
70 m_ToggleAction.Track();
76 override void HandlerDeattached(Widget w)
78 super.HandlerDeattached(w);
82 m_ToggleAction.GetOnToggleChange().Remove(OnToggleChange);
83 m_ToggleAction.Untrack();