Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScriptedWidgetComponent.c
Go to the documentation of this file.
1
4typedef ScriptInvokerBase<ScriptInvokerScriptedWidgetComponentMethod> ScriptInvokerScriptedWidgetComponent;
5
6//------------------------------------------------------------------------------------------------
8{
9 protected Widget m_wRoot;
10
11 //TODO: typed invoker ScriptInvokerScriptedWidgetComponent
13
14 //------------------------------------------------------------------------------------------------
15 override void HandlerAttached(Widget w)
16 {
17 m_wRoot = w;
18 }
19
20 //------------------------------------------------------------------------------------------------
21 override bool OnClick(Widget w, int x, int y, int button)
22 {
23 m_OnClick.Invoke(this);
24 return super.OnClick(w, x, y, button);
25 }
26
27 //------------------------------------------------------------------------------------------------
29 static SCR_ScriptedWidgetComponent GetComponent(typename componentType, string name, Widget parent, bool searchAllChildren = true)
30 {
31 if (!parent || name == string.Empty)
32 return null;
33
34 Widget w;
35 if (searchAllChildren)
36 w = parent.FindAnyWidget(name);
37 else
38 w = parent.FindWidget(name);
39
40 if (!w)
41 {
42 Print(string.Format("SCR_ScriptedWidgetComponent.GetComponent: widget not found: %1 %2", componentType, name), LogLevel.WARNING);
43 Debug.DumpStack();
44 return null;
45 }
46
47 return SCR_ScriptedWidgetComponent.Cast(w.FindHandler(componentType));
48 }
49
50 //------------------------------------------------------------------------------------------------
52 {
53 return m_wRoot;
54 }
55
56 //------------------------------------------------------------------------------------------------
57 bool IsVisible()
58 {
59 if (!m_wRoot)
60 return false;
61
62 return m_wRoot.IsVisible();
63 }
64};
func ScriptInvokerScriptedWidgetComponentMethod
ScriptInvokerBase< ScriptInvokerScriptedWidgetComponentMethod > ScriptInvokerScriptedWidgetComponent
Definition Debug.c:13
static SCR_ScriptedWidgetComponent GetComponent(typename componentType, string name, Widget parent, bool searchAllChildren=true)
Base method for component lookup through the widget library.
override bool OnClick(Widget w, int x, int y, int button)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134