DayZ
1.24
Loading...
Searching...
No Matches
Tabber.c
Go to the documentation of this file.
1
// -----------------------------------------------------------
2
class
Tabber
:
ScriptedWidgetEventHandler
3
{
4
Widget
ButtonsPanel
;
5
Widget
ContentPanel
;
6
reference
int
SelectedTab
;
7
8
// -----------------------------------------------------------
9
void
OnWidgetScriptInit
(
Widget
w
)
10
{
11
w
.SetHandler(
this
);
12
SelectTab
(
SelectedTab
);
13
}
14
15
// -----------------------------------------------------------
16
override
bool
OnClick
(
Widget
w
,
int
x
,
int
y
,
int
button
)
17
{
18
if
(
w
&&
w
.GetParent() ==
ButtonsPanel
)
19
{
20
SelectedTab
= 0;
21
Widget
iw
=
ButtonsPanel
.GetChildren();
22
while
(
iw
)
23
{
24
if
(
iw
==
w
)
break
;
25
SelectedTab
++;
26
iw
=
iw
.GetSibling();
27
}
28
29
SelectTab
(
SelectedTab
);
30
}
31
32
return
false
;
33
}
34
35
// -----------------------------------------------------------
36
protected
void
SelectTab
(
int
index
)
37
{
38
Print
(
index
);
39
int
n
= 0;
40
Widget
w
=
ContentPanel
.GetChildren();
41
while
(
w
)
42
{
43
if
(
n
==
index
)
44
w
.Show(
true
);
45
else
46
w
.Show(
false
);
47
n
++;
48
w
=
w
.GetSibling();
49
}
50
}
51
};
x
Icon x
y
Icon y
Param3
Definition
EntityAI.c:95
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
EnWidgets.c:651
Tabber
Definition
Tabber.c:3
Tabber::ButtonsPanel
Widget ButtonsPanel
Definition
Tabber.c:4
Tabber::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition
Tabber.c:9
Tabber::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
Tabber.c:16
Tabber::SelectedTab
reference int SelectedTab
Definition
Tabber.c:6
Tabber::ContentPanel
Widget ContentPanel
Definition
Tabber.c:5
Tabber::SelectTab
void SelectTab(int index)
Definition
Tabber.c:36
Widget
Definition
EnWidgets.c:190
Print
proto void Print(void var)
Prints content of variable to console/log.
scripts
3_Game
GUI
Tabber.c
Generated by
1.10.0