DayZ 1.24
Loading...
Searching...
No Matches
HorizontalSpacer Class Reference
Inheritance diagram for HorizontalSpacer:
[legend]
Collaboration diagram for HorizontalSpacer:
[legend]

Protected Member Functions

void UpdateChild (Widget child, float w, float h, int index)
 

Private Attributes

reference int Border
 
reference int Gap
 
- Private Attributes inherited from SpacerBase
Widget m_root
 
int m_count
 

Additional Inherited Members

- Private Member Functions inherited from SpacerBase
void OnWidgetScriptInit (Widget w)
 
override bool OnUpdate (Widget w)
 
override bool OnChildAdd (Widget w, Widget child)
 
override bool OnChildRemove (Widget w, Widget child)
 
int GetChildIndex (Widget w)
 
void UpdateLayout ()
 
void UpdateChild (Widget child, float w, float h, int index)
 

Detailed Description

Definition at line 2 of file HorizontalSpacer.c.

Member Function Documentation

◆ UpdateChild()

void HorizontalSpacer::UpdateChild ( Widget child,
float w,
float h,
int index )
inlineprotected

Definition at line 7 of file HorizontalSpacer.c.

8 {
9 float itemWidth = (w - (Border * 2) - ((m_count - 1) * Gap)) / m_count;
10 float itemHeight = h - (2 * Border);
11
12 child.SetPos(Border + ((itemWidth + Gap) * index), Border);
13 child.SetSize(itemWidth, itemHeight);
14
15 if (child.GetChildren())
16 {
17 Widget c = child.GetChildren();
18 RightGap gap;
19 c.GetScript(gap);
20 if (gap)
21 gap.OnUpdate(c);
22
23 //gap.Update();
24
25 }
26 }
reference int Border
reference int Gap
override bool OnUpdate(Widget w)
Definition RightGap.c:18
int m_count
Definition SpacerBase.c:5

References Border, Gap, SpacerBase::m_count, and RightGap::OnUpdate().

Member Data Documentation

◆ Border

reference int HorizontalSpacer::Border
private

Definition at line 4 of file HorizontalSpacer.c.

Referenced by UpdateChild().

◆ Gap

reference int HorizontalSpacer::Gap
private

Definition at line 5 of file HorizontalSpacer.c.

Referenced by UpdateChild().


The documentation for this class was generated from the following file: