MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / FormatSection

Method FormatSection

engine/Poseidon/UI/Controls/UIControlsExt.cpp:1799–2063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1797 return;
1798 }
1799 if (to < 0 || to >= _sections.Size())
1800 {
1801 return;
1802 }
1803
1804 HTMLSection& src = _sections[from];
1805 HTMLSection& dest = _sections[to];
1806
1807 for (int i = 0; i < src.fields.Size(); i++)
1808 {
1809 HTMLField& fld = src.fields[i];
1810 int index = dest.fields.Add(fld);
1811 dest.fields[index].indent += _indent;
1812 }
1813}
1814
1815void CHTMLContainer::FormatSection(int s)
1816{
1817 float maxLineWidth = GetPageWidth();
1818 float minHeight = _sizeP;
1819
1820 HTMLSection& section = _sections[s];
1821 section.rows.Clear();
1822
1823 int r = section.rows.Add();
1824 HTMLRow* row = &section.rows[r];
1825 row->firstField = 0;
1826 row->firstPos = 0;
1827 row->width = 0;
1828 row->align = HALeft;
1829 row->height = minHeight;
1830
1831 HTMLFormat format = HFP;
1832 bool bold = false;
1833 Font* font = _fontP;
1834 float size = _sizeP;
1835
1836 bool bottom = false;
1837
1838 int n = section.fields.Size();
1839 for (int f = 0; f < n; f++)
1840 {
1841 HTMLField& field = section.fields[f];
1842 float lineWidth = maxLineWidth - field.indent;
1843 if (field.bottom)
1844 {
1845 bottom = true;
1846 }
1847 if (field.nextline)
1848 {
1849 row->lastField = f + 1;
1850 row->lastPos = 0;
1851 row->bottom = bottom;
1852 r = section.rows.Add();
1853 row = &section.rows[r];
1854 row->firstField = f + 1;
1855 row->firstPos = 0;
1856 row->width = 0;

Callers 5

CreateDebriefingMethod · 0.80
CreateWeaponsPageMethod · 0.80
CreateWeaponsPoolPageMethod · 0.80
UpdateUnitsInBriefingMethod · 0.80
UpdatePlanMethod · 0.80

Calls 12

saturateMaxFunction · 0.85
Utf8CharBytesFunction · 0.85
IsWrapWhitespaceFunction · 0.85
floatMaxFunction · 0.85
reserveMethod · 0.80
SubstringMethod · 0.80
ClearMethod · 0.45
AddMethod · 0.45
SizeMethod · 0.45
GetLengthMethod · 0.45
DataMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected