DayZ 1.24
Loading...
Searching...
No Matches
VerticalSpacer Class Reference
Inheritance diagram for VerticalSpacer:
[legend]
Collaboration diagram for VerticalSpacer:
[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 VerticalSpacer.c.

Member Function Documentation

◆ UpdateChild()

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

Definition at line 7 of file VerticalSpacer.c.

8 {
9 float itemWidth = w - (2 * border);
10 float itemHeight = (h - (border * 2) - ((m_count - 1) * gap)) / m_count;
11
12 child.SetPos(border, border + ((itemHeight + gap) * index));
13 child.SetSize(itemWidth, itemHeight);
14 }
int m_count
Definition SpacerBase.c:5
reference int border
reference int gap

References border, gap, and SpacerBase::m_count.

Member Data Documentation

◆ border

reference int VerticalSpacer::border
private

Definition at line 4 of file VerticalSpacer.c.

Referenced by UpdateChild().

◆ gap

reference int VerticalSpacer::gap
private

Definition at line 5 of file VerticalSpacer.c.

Referenced by UpdateChild().


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