Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EventHandlerComponent.c
Go to the documentation of this file.
1 
4 //------------------------------------------------------------------------------------------------
5 class SCR_EventHandlerComponent : ScriptedWidgetComponent
6 {
7  protected ref ScriptInvoker m_OnHandlerAttached;
8  protected ref ScriptInvoker m_OnHandlerDetached;
9  protected ref ScriptInvoker m_OnChange;
10  protected ref ScriptInvoker m_OnChangeFinal;
11  protected ref ScriptInvoker m_OnFocus;
12  protected ref ScriptInvoker m_OnFocusLost;
13  protected ref ScriptInvoker m_OnMouseEnter;
14  protected ref ScriptInvoker m_OnMouseLeave;
15  protected ref ScriptInvoker m_OnClick;
16  protected ref ScriptInvoker m_OnDoubleClick;
17  protected ref ScriptInvoker m_OnMouseButtonDown;
18  protected ref ScriptInvoker m_OnMouseButtonUp;
19 
20  //------------------------------------------------------------------------------------------------
21  override void HandlerAttached(Widget w)
22  {
23  if (m_OnHandlerAttached)
24  m_OnHandlerAttached.Invoke();
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  override void HandlerDeattached(Widget w)
29  {
30  if (m_OnHandlerDetached)
31  m_OnHandlerDetached.Invoke(w);
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override bool OnClick(Widget w, int x, int y, int button)
36  {
37  if (m_OnClick)
38  m_OnClick.Invoke(w);
39  return false;
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override bool OnChange(Widget w, int x, int y, bool finished)
44  {
45  if (m_OnChange)
46  m_OnChange.Invoke(w);
47 
48  if (finished && m_OnChangeFinal)
49  m_OnChangeFinal.Invoke(w);
50 
51  return false;
52  }
53 
54  //------------------------------------------------------------------------------------------------
55  override bool OnMouseEnter(Widget w, int x, int y)
56  {
57  if (m_OnMouseEnter)
58  m_OnMouseEnter.Invoke(w);
59  return false;
60  }
61 
62  //------------------------------------------------------------------------------------------------
63  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
64  {
65  if (m_OnMouseLeave)
66  m_OnMouseLeave.Invoke(w);
67  return false;
68  }
69 
70  //------------------------------------------------------------------------------------------------
71  override bool OnFocus(Widget w, int x, int y)
72  {
73  if (m_OnFocus)
74  m_OnFocus.Invoke(w);
75  return false;
76  }
77 
78  //------------------------------------------------------------------------------------------------
79  override bool OnFocusLost(Widget w, int x, int y)
80  {
81  if (m_OnFocusLost)
82  m_OnFocusLost.Invoke(w);
83  return false;
84  }
85 
86  //------------------------------------------------------------------------------------------------
87  override bool OnMouseButtonDown(Widget w, int x, int y, int button)
88  {
89  if (m_OnMouseButtonDown)
90  m_OnMouseButtonDown.Invoke(w);
91  return false;
92  }
93 
94  //------------------------------------------------------------------------------------------------
95  override bool OnMouseButtonUp(Widget w, int x, int y, int button)
96  {
97  if (m_OnMouseButtonUp)
98  m_OnMouseButtonUp.Invoke(w, button);
99  return false;
100  }
101 
102  //------------------------------------------------------------------------------------------------
103  override bool OnDoubleClick(Widget w, int x, int y, int button)
104  {
105  if (m_OnDoubleClick)
106  m_OnDoubleClick.Invoke(w);
107  return false;
108  }
109 
110  //------------------------------------------------------------------------------------------------
111  ScriptInvoker GetOnHandlerAttached()
112  {
113  if (!m_OnHandlerAttached)
114  m_OnHandlerAttached = new ScriptInvoker();
115  return m_OnHandlerAttached;
116  }
117 
118  //------------------------------------------------------------------------------------------------
119  ScriptInvoker m_OnHandlerDetached()
120  {
121  if (!m_OnHandlerDetached)
122  m_OnHandlerDetached = new ScriptInvoker();
123  return m_OnHandlerDetached;
124  }
125 
126  //------------------------------------------------------------------------------------------------
127  ScriptInvoker GetOnChange()
128  {
129  if (!m_OnChange)
130  m_OnChange = new ScriptInvoker();
131  return m_OnChange;
132  }
133 
134  //------------------------------------------------------------------------------------------------
135  ScriptInvoker GetOnChangeFinal()
136  {
137  if (!m_OnChangeFinal)
138  m_OnChangeFinal = new ScriptInvoker();
139  return m_OnChangeFinal;
140  }
141 
142  //------------------------------------------------------------------------------------------------
143  ScriptInvoker GetOnFocus()
144  {
145  if (!m_OnFocus)
146  m_OnFocus = new ScriptInvoker();
147  return m_OnFocus;
148  }
149 
150  //------------------------------------------------------------------------------------------------
151  ScriptInvoker GetOnFocusLost()
152  {
153  if (!m_OnFocusLost)
154  m_OnFocusLost = new ScriptInvoker();
155  return m_OnFocusLost;
156  }
157 
158  //------------------------------------------------------------------------------------------------
159  ScriptInvoker GetOnMouseEnter()
160  {
161  if (!m_OnMouseEnter)
162  m_OnMouseEnter = new ScriptInvoker();
163  return m_OnMouseEnter;
164  }
165 
166  //------------------------------------------------------------------------------------------------
167  ScriptInvoker GetOnMouseLeave()
168  {
169  if (!m_OnMouseLeave)
170  m_OnMouseLeave = new ScriptInvoker();
171  return m_OnMouseLeave;
172  }
173 
174  //------------------------------------------------------------------------------------------------
175  ScriptInvoker GetOnClick()
176  {
177  if (!m_OnClick)
178  m_OnClick = new ScriptInvoker();
179  return m_OnClick;
180  }
181 
182  //------------------------------------------------------------------------------------------------
183  ScriptInvoker GetOnMouseButtonDown()
184  {
185  if (!m_OnMouseButtonDown)
186  m_OnMouseButtonDown = new ScriptInvoker();
187  return m_OnMouseButtonDown;
188  }
189 
190  //------------------------------------------------------------------------------------------------
191  ScriptInvoker GetOnMouseButtonUp()
192  {
193  if (!m_OnMouseButtonUp)
194  m_OnMouseButtonUp = new ScriptInvoker();
195  return m_OnMouseButtonUp;
196  }
197 
198  //------------------------------------------------------------------------------------------------
199  ScriptInvoker GetOnDoubleClick()
200  {
201  if (!m_OnDoubleClick)
202  m_OnDoubleClick = new ScriptInvoker();
203  return m_OnDoubleClick;
204  }
205 };
m_OnMouseEnter
ref ScriptInvoker m_OnMouseEnter
Definition: SCR_ModularButtonComponent.c:65
m_OnFocusLost
ref ScriptInvoker m_OnFocusLost
Definition: SCR_ModularButtonComponent.c:64
m_OnChange
protected ref ScriptInvoker_EditableDescriptorLocationChange m_OnChange
Definition: SCR_EditableDescriptorComponent.c:22
SCR_EventHandlerComponent
Definition: SCR_EventHandlerComponent.c:5
m_OnFocus
ref ScriptInvoker m_OnFocus
Definition: SCR_ModularButtonComponent.c:63
m_OnMouseLeave
ref ScriptInvoker m_OnMouseLeave
Definition: SCR_ModularButtonComponent.c:66
m_OnClick
ref ScriptInvoker m_OnClick
Definition: SCR_MapToolMenuUI.c:13