Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
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
{
34
child.GetScreenSize(
itemWidth
,
itemHeight
);
35
}
36
else
37
{
38
child.SetFlags(
WidgetFlags
.EXACTPOS,
false
);
39
child.SetPos(
itemWidth
+(
itemWidth
*
coef
), 0);
40
}
41
42
index++;
43
child = child.GetSibling();
44
}
45
}
46
};
HorizontalSpacerWithFixedAspect
Definition
horizontalspacerwithfixedaspect.c:3
HorizontalSpacerWithFixedAspect::m_root
Widget m_root
Definition
horizontalspacerwithfixedaspect.c:4
HorizontalSpacerWithFixedAspect::itemHeight
float itemHeight
Definition
horizontalspacerwithfixedaspect.c:9
HorizontalSpacerWithFixedAspect::border
reference int border
Definition
horizontalspacerwithfixedaspect.c:5
HorizontalSpacerWithFixedAspect::UpdateLayout
void UpdateLayout()
Definition
horizontalspacerwithfixedaspect.c:25
HorizontalSpacerWithFixedAspect::itemWidth
float itemWidth
Definition
horizontalspacerwithfixedaspect.c:8
HorizontalSpacerWithFixedAspect::gap
reference int gap
Definition
horizontalspacerwithfixedaspect.c:6
HorizontalSpacerWithFixedAspect::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition
horizontalspacerwithfixedaspect.c:12
HorizontalSpacerWithFixedAspect::coef
reference float coef
Definition
horizontalspacerwithfixedaspect.c:7
HorizontalSpacerWithFixedAspect::OnUpdate
override bool OnUpdate(Widget w)
Definition
horizontalspacerwithfixedaspect.c:19
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
enwidgets.c:657
Widget
Definition
enwidgets.c:190
WidgetFlags
WidgetFlags
Definition
enwidgets.c:58
Games
Dayz
scripts
3_game
gui
spacers
horizontalspacerwithfixedaspect.c
Generated by
1.17.0