5 protected bool m_bIsDragged =
false;
6 protected bool m_bIsHovered =
false;
9 protected float m_fSizeY;
11 protected float m_fPositionY;
12 protected float m_fMouseOffsetY;
14 protected ref Color COLOR_HANDLER_DEFAULT =
UIColors.CONTRAST_COLOR;
15 protected ref Color COLOR_HANDLER_HOVERED = Color.White;
17 ref ScriptInvoker m_OnDrag =
new ScriptInvoker;
24 override void HandlerAttached(Widget w)
26 super.HandlerAttached(w);
30 m_wRoot.SetColor(COLOR_HANDLER_DEFAULT);
34 override bool OnMouseEnter(Widget w,
int x,
int y)
36 super.OnMouseEnter(w, x, y);
39 m_wRoot.SetColor(COLOR_HANDLER_HOVERED);
45 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
47 super.OnMouseLeave(w, enterW, x, y);
54 m_wRoot.SetColor(COLOR_HANDLER_DEFAULT);
59 override bool OnMouseButtonDown(Widget w,
int x,
int y,
int button)
69 WidgetManager.GetMousePos(mouseX, mouseY);
70 m_fMouseOffsetY = mouseY - m_fPositionY - m_fSizeY/2;
79 override bool OnMouseButtonUp(Widget w,
int x,
int y,
int button)
88 m_wRoot.SetColor(COLOR_HANDLER_DEFAULT);
100 protected void DragHandler()
109 GetGame().GetCallqueue().CallLater(DragHandler, 0);
117 void SetSizeY(
float size) { m_fSizeY = size; }
120 float GetSizeY() {
return m_fSizeY; }
123 void SetPositionY(
float pos) { m_fPositionY = pos; }
126 float GetPositionY() {
return m_fPositionY; }
129 float GetMouseOffsetY() {
return m_fMouseOffsetY; }