Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ButtonListComponent.c
Go to the documentation of this file.
1 /*
2 Component for handling button specific list view
3 */
4 
5 //------------------------------------------------------------------------------------------------
7 {
8  protected ref array<SCR_ButtonComponent> m_aButtons = new array<SCR_ButtonComponent>;
9 
10  ref ScriptInvoker m_OnEntryFocus = new ScriptInvoker;
11 
12  //-------------------------------------
13  // List component override
14  //-------------------------------------
15 
16  //------------------------------------------------------------------------------------------------
17  override void HandlerAttached(Widget w)
18  {
19  super.HandlerAttached(w);
20  }
21 
22  //------------------------------------------------------------------------------------------------
24  override protected void SetupEntryBehavior(Widget entry)
25  {
26  // Entry check
27  if (!entry)
28  return;
29 
30  // Find server entry component
31  SCR_ButtonComponent button = SCR_ButtonComponent.Cast(entry.FindHandler(SCR_ButtonComponent));
32  if (!button)
33  return;
34 
35  // Invokers
36  button.m_OnFocus.Insert(OnEntryFocus);
37 
38  // Insert to list
39  m_aButtons.Insert(button);
40  }
41 
42  //-------------------------------------
43  // Invoker actions
44  //-------------------------------------
45 
46  //------------------------------------------------------------------------------------------------
48  protected void OnEntryFocus(Widget w)
49  {
50  m_OnEntryFocus.Invoke();
51 
52  m_iFocusedEntryId = m_aEntryWidgets.Find(w) + Math.Floor(m_fScrollPosition);
53  }
54 
55  //-------------------------------------
56  // Get & Set
57  //-------------------------------------
58 
59  //------------------------------------------------------------------------------------------------
60  array<SCR_ButtonComponent> GetButtons() { return m_aButtons; }
61 };
SCR_ListViewComponent
Definition: SCR_ListViewComponent.c:6
SCR_ButtonListViewComponent
Definition: SCR_ButtonListComponent.c:6
SCR_ButtonComponent
Deprecated button component. Still used in many prefabs, so it works, it's just stripped of most of t...
Definition: SCR_ButtonComponent.c:4
m_aButtons
protected ref array< ref SCR_BrowserTooltipButtonPresetData > m_aButtons
Definition: SCR_BrowserHoverTooltipComponent.c:9