DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
HorizontalSpacerWithFixedAspect.c
См. документацию.
1// -----------------------------------------------------------
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 // -----------------------------------------------------------
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};
override bool OnUpdate(Widget w)
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения EnWidgets.c:190
WidgetFlags
Определения EnWidgets.c:58