Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EventHandlerComponent.c
Go to the documentation of this file.
1
3
4//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
5// Old, unmantained and barely used. Should be merged with SCR_ScriptedWidgetComponent as the base of the widget library, given the need for such events on all UI components
6
7//------------------------------------------------------------------------------------------------
9{
14 protected ref ScriptInvoker m_OnFocus;
18 protected ref ScriptInvoker m_OnClick;
22
23 //------------------------------------------------------------------------------------------------
24 override void HandlerAttached(Widget w)
25 {
27 m_OnHandlerAttached.Invoke();
28 }
29
30 //------------------------------------------------------------------------------------------------
31 override void HandlerDeattached(Widget w)
32 {
34 m_OnHandlerDetached.Invoke(w);
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override bool OnClick(Widget w, int x, int y, int button)
39 {
40 if (m_OnClick)
41 m_OnClick.Invoke(w);
42 return false;
43 }
44
45 //------------------------------------------------------------------------------------------------
46 override bool OnChange(Widget w, bool finished)
47 {
48 if (m_OnChange)
49 m_OnChange.Invoke(w);
50
51 if (finished && m_OnChangeFinal)
52 m_OnChangeFinal.Invoke(w);
53
54 return false;
55 }
56
57 //------------------------------------------------------------------------------------------------
58 override bool OnMouseEnter(Widget w, int x, int y)
59 {
61 m_OnMouseEnter.Invoke(w);
62 return false;
63 }
64
65 //------------------------------------------------------------------------------------------------
66 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
67 {
69 m_OnMouseLeave.Invoke(w);
70 return false;
71 }
72
73 //------------------------------------------------------------------------------------------------
74 override bool OnFocus(Widget w, int x, int y)
75 {
76 if (m_OnFocus)
77 m_OnFocus.Invoke(w);
78 return false;
79 }
80
81 //------------------------------------------------------------------------------------------------
82 override bool OnFocusLost(Widget w, int x, int y)
83 {
84 if (m_OnFocusLost)
85 m_OnFocusLost.Invoke(w);
86 return false;
87 }
88
89 //------------------------------------------------------------------------------------------------
90 override bool OnMouseButtonDown(Widget w, int x, int y, int button)
91 {
93 m_OnMouseButtonDown.Invoke(w);
94 return false;
95 }
96
97 //------------------------------------------------------------------------------------------------
98 override bool OnMouseButtonUp(Widget w, int x, int y, int button)
99 {
101 m_OnMouseButtonUp.Invoke(w, button);
102 return false;
103 }
104
105 //------------------------------------------------------------------------------------------------
106 override bool OnDoubleClick(Widget w, int x, int y, int button)
107 {
108 if (m_OnDoubleClick)
109 m_OnDoubleClick.Invoke(w);
110 return false;
111 }
112
113 //------------------------------------------------------------------------------------------------
120
121 //------------------------------------------------------------------------------------------------
128
129 //------------------------------------------------------------------------------------------------
131 {
132 if (!m_OnChange)
134 return m_OnChange;
135 }
136
137 //------------------------------------------------------------------------------------------------
144
145 //------------------------------------------------------------------------------------------------
147 {
148 if (!m_OnFocus)
149 m_OnFocus = new ScriptInvoker();
150 return m_OnFocus;
151 }
152
153 //------------------------------------------------------------------------------------------------
155 {
156 if (!m_OnFocusLost)
158 return m_OnFocusLost;
159 }
160
161 //------------------------------------------------------------------------------------------------
168
169 //------------------------------------------------------------------------------------------------
176
177 //------------------------------------------------------------------------------------------------
179 {
180 if (!m_OnClick)
181 m_OnClick = new ScriptInvoker();
182 return m_OnClick;
183 }
184
185 //------------------------------------------------------------------------------------------------
192
193 //------------------------------------------------------------------------------------------------
200
201 //------------------------------------------------------------------------------------------------
208
209 //---- REFACTOR NOTE END ----
210};
override bool OnFocus(Widget w, int x, int y)
override bool OnFocusLost(Widget w, int x, int y)
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
override void HandlerAttached(Widget w)
override bool OnMouseButtonUp(Widget w, int x, int y, int button)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override bool OnClick(Widget w, int x, int y, int button)
override bool OnDoubleClick(Widget w, int x, int y, int button)
override bool OnChange(Widget w, bool finished)
override bool OnMouseEnter(Widget w, int x, int y)
override void HandlerDeattached(Widget w)
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134