DayZ
1.24
Loading...
Searching...
No Matches
HorizontalSpacerWithFixedAspect.c
Go to the documentation of this file.
1
// -----------------------------------------------------------
2
class
HorizontalSpacerWithFixedAspect
:
ScriptedWidgetEventHandler
3
{
4
protected
Widget
m_root
;
5
reference
int
border
;
6
reference
int
gap
;
7
reference
float
coef
;
8
float
itemWidth
;
9
float
itemHeight
;
10
11
// -----------------------------------------------------------
12
void
OnWidgetScriptInit
(
Widget
w
)
13
{
14
m_root
=
w
;
15
m_root
.SetHandler(
this
);
16
}
17
18
// -----------------------------------------------------------
19
override
bool
OnUpdate
(
Widget
w
)
20
{
21
if
(
w
==
m_root
)
UpdateLayout
();
22
return
false
;
23
}
24
25
protected
void
UpdateLayout
()
26
{
27
Widget
child
=
m_root
.GetChildren();
28
29
int
index
= 0;
30
while
(
child
)
31
{
32
if
(
index
== 0)
33
child
.GetScreenSize(
itemWidth
,
itemHeight
);
34
else
35
{
36
child
.SetFlags(
WidgetFlags
.EXACTPOS,
false
);
37
child
.SetPos(
itemWidth
+ (
itemWidth
*
coef
), 0);
38
}
39
40
index
++;
41
child
=
child
.GetSibling();
42
}
43
}
44
};
HorizontalSpacerWithFixedAspect
Definition
HorizontalSpacerWithFixedAspect.c:3
HorizontalSpacerWithFixedAspect::coef
reference float coef
Definition
HorizontalSpacerWithFixedAspect.c:7
HorizontalSpacerWithFixedAspect::border
reference int border
Definition
HorizontalSpacerWithFixedAspect.c:5
HorizontalSpacerWithFixedAspect::gap
reference int gap
Definition
HorizontalSpacerWithFixedAspect.c:6
HorizontalSpacerWithFixedAspect::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition
HorizontalSpacerWithFixedAspect.c:12
HorizontalSpacerWithFixedAspect::itemHeight
float itemHeight
Definition
HorizontalSpacerWithFixedAspect.c:9
HorizontalSpacerWithFixedAspect::itemWidth
float itemWidth
Definition
HorizontalSpacerWithFixedAspect.c:8
HorizontalSpacerWithFixedAspect::OnUpdate
override bool OnUpdate(Widget w)
Definition
HorizontalSpacerWithFixedAspect.c:19
HorizontalSpacerWithFixedAspect::UpdateLayout
void UpdateLayout()
Definition
HorizontalSpacerWithFixedAspect.c:25
HorizontalSpacerWithFixedAspect::m_root
Widget m_root
Definition
HorizontalSpacerWithFixedAspect.c:4
Param3
Definition
EntityAI.c:95
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
EnWidgets.c:651
Widget
Definition
EnWidgets.c:190
WidgetFlags
WidgetFlags
Definition
EnWidgets.c:58
scripts
3_Game
GUI
Spacers
HorizontalSpacerWithFixedAspect.c
Generated by
1.10.0