| 1377 | } |
| 1378 | |
| 1379 | bool CUIXmlInit::InitScrollView(CUIXml& xml_doc, const char* path, int index, CUIScrollView* pWnd) |
| 1380 | { |
| 1381 | R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path); |
| 1382 | |
| 1383 | InitWindow(xml_doc, path, index, pWnd); |
| 1384 | pWnd->SetRightIndention(xml_doc.ReadAttribFlt(path, index, "right_ident", 0.0f)); |
| 1385 | pWnd->SetLeftIndention(xml_doc.ReadAttribFlt(path, index, "left_ident", 0.0f)); |
| 1386 | pWnd->SetUpIndention(xml_doc.ReadAttribFlt(path, index, "top_indent", 0.0f)); |
| 1387 | pWnd->SetDownIndention(xml_doc.ReadAttribFlt(path, index, "bottom_indent", 0.0f)); |
| 1388 | |
| 1389 | float vi = xml_doc.ReadAttribFlt(path, index, "vert_interval", 0.0f); |
| 1390 | pWnd->m_vertInterval = (vi); |
| 1391 | |
| 1392 | bool bInverseDir = (1 == xml_doc.ReadAttribInt(path, index, "inverse_dir", 0)); |
| 1393 | pWnd->m_flags.set(CUIScrollView::eInverseDir, bInverseDir); |
| 1394 | |
| 1395 | pWnd->SetScrollBarProfile(xml_doc.ReadAttrib(path, index, "scroll_profile", "default")); |
| 1396 | |
| 1397 | pWnd->Init(); |
| 1398 | |
| 1399 | bool bVertFlip = (1 == xml_doc.ReadAttribInt(path, index, "flip_vert", 0)); |
| 1400 | pWnd->SetVertFlip(bVertFlip); |
| 1401 | |
| 1402 | bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1)); |
| 1403 | |
| 1404 | pWnd->SetFixedScrollBar(b); |
| 1405 | |
| 1406 | b = (1 == xml_doc.ReadAttribInt(path, index, "can_select", 0)); |
| 1407 | |
| 1408 | pWnd->m_flags.set(CUIScrollView::eItemsSelectabe, b); |
| 1409 | |
| 1410 | ///////////////////////////////////////////////////////////////////// |
| 1411 | int tabsCount = xml_doc.GetNodesNum(path, index, "text"); |
| 1412 | |
| 1413 | XML_NODE* _stored_root = xml_doc.GetLocalRoot(); |
| 1414 | xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); |
| 1415 | |
| 1416 | CUIStatic* newStatic; |
| 1417 | |
| 1418 | for (int i = 0; i < tabsCount; ++i) |
| 1419 | { |
| 1420 | newStatic = xr_new<CUIStatic>(); |
| 1421 | InitText(xml_doc, "text", i, newStatic); |
| 1422 | newStatic->SetTextComplexMode(true); |
| 1423 | newStatic->SetWidth(pWnd->GetDesiredChildWidth()); |
| 1424 | newStatic->AdjustHeightToText(); |
| 1425 | pWnd->AddWindow(newStatic, true); |
| 1426 | } |
| 1427 | xml_doc.SetLocalRoot(_stored_root); |
| 1428 | return true; |
| 1429 | } |
| 1430 | |
| 1431 | bool CUIXmlInit::InitListBox(CUIXml& xml_doc, const char* path, int index, CUIListBox* pWnd) |
| 1432 | { |
no test coverage detected