DayZ 1.24
Loading...
Searching...
No Matches
CollapsibleContainer.c
Go to the documentation of this file.
2{
4 protected bool m_Hidden;
5
6 void CollapsibleContainer(LayoutHolder parent, int sort = -1)
7 {
8 m_MainWidget.Show(true);
9
10 if (sort > -1)
11 m_MainWidget.SetSort(sort + 2);
12
13 m_MainWidget = m_MainWidget.FindAnyWidget("header");
14
15 m_Body = new array<ref LayoutHolder>;
16 m_CollapsibleHeader = new CollapsibleHeader(this, "CollapseButtonOnMouseButtonDown");
17 }
18
19 override void SetLayoutName()
20 {
22 }
23
25 {
26 return m_Entity;
27 }
28
29 override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver) { }
30
31 override void Refresh()
32 {
33 super.Refresh();
34 }
35
36 override void OnShow()
37 {
38 super.OnShow();
39 m_Hidden = false;
40 for (int i = 0; i < m_Body.Count(); i++)
41 {
42 m_Body.Get(i).OnShow();
43 Container c = Container.Cast(m_Body.Get(i));
44 if (c)
45 c.Open();
46 }
48 }
49
50 override void OnHide()
51 {
52 m_Hidden = true;
55 else
56 super.OnHide();
57
58 }
59
60 override void Insert(LayoutHolder container, int pos = -1, bool immedUpdate = true)
61 {
62 super.Insert(container, pos, immedUpdate);
63
64 //if ( immedUpdate )
65 //{
66 RecomputeOpenedContainers();
68 //}
69
71 }
72
74 {
75 super.Remove(container);
76 RecomputeOpenedContainers();
78 }
79
81 {
82 return false;
83 }
84
86 {
87#ifndef PLATFORM_CONSOLE
88 if (m_Body.Count() < 2)
89 {
91 m_CollapsibleHeader.ShowCollapseButton(false);
92 }
93 else
94 {
96 m_CollapsibleHeader.ShowCollapseButton(true);
97 }
98#endif
99 }
100
102 {
103 m_Hidden = !ItemManager.GetInstance().GetDefaultHeaderOpenState("VICINITY");
104 //m_Closed = m_Hidden;
105
106 if (m_Hidden)
107 OnHide();
108 else
109 OnShow();
110 }
111
112 bool IsHidden()
113 {
114 return m_Hidden;
115 }
116
121
122 override void Toggle()
123 {
124 if (!m_Hidden)
125 {
126 for (int i = 1; i < m_Body.Count(); i++)
127 {
128 m_Body.Get(i).OnHide();
129 Container c = Container.Cast(m_Body.Get(i));
130 if (c)
131 c.Close();
132 }
133 OnHide();
134 }
135 else
136 OnShow();
137 m_Closed = m_Hidden;
138
140
142 }
143
145 {
146 if (w == GetMainWidget())
147 GetMainWidget().Update();
148 return true;
149 }
150
152 {
153 if (w == GetMainWidget())
154 GetMainWidget().Update();
155 return true;
156 }
157
158 override Header GetHeader()
159 {
160 return m_CollapsibleHeader;
161 }
162
163 override void SetHeader(Header header)
164 {
166 }
167
169 {
171 m_CollapsibleHeader.SetArrowButtonOpened(open);
172 }
173}
EntityAI m_Entity
Definition ActionDebug.c:11
Icon x
Icon y
void CollapsibleContainer(LayoutHolder parent, int sort=-1)
override void Remove(LayoutHolder container)
ref CollapsibleHeader m_CollapsibleHeader
void SetCollapsibleHeaderArrowState(bool open)
override bool OnChildAdd(Widget w, Widget child)
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
override Header GetHeader()
override void SetHeader(Header header)
void CollapseButtonOnMouseButtonDown(Widget w)
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
override bool OnChildRemove(Widget w, Widget child)
override void SetLayoutName()
Definition Header.c:2
static ItemManager GetInstance()
const string CollapsibleContainer