| 865 | } |
| 866 | |
| 867 | bool CUIXmlInit::InitTabControl(CUIXml& xml_doc, LPCSTR path, int index, CUITabControl* pWnd) |
| 868 | { |
| 869 | R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path); |
| 870 | |
| 871 | bool status = true; |
| 872 | |
| 873 | status &= InitWindow(xml_doc, path, index, pWnd); |
| 874 | InitOptionsItem(xml_doc, path, index, pWnd); |
| 875 | int tabsCount = xml_doc.GetNodesNum(path, index, "button"); |
| 876 | int radio = xml_doc.ReadAttribInt(path, index, "radio"); |
| 877 | |
| 878 | XML_NODE* tab_node = xml_doc.NavigateToNode(path, index); |
| 879 | xml_doc.SetLocalRoot(tab_node); |
| 880 | |
| 881 | CUITabButton* newButton; |
| 882 | |
| 883 | for (int i = 0; i < tabsCount; ++i) |
| 884 | { |
| 885 | newButton = radio ? xr_new<CUIRadioButton>() : xr_new<CUITabButton>(); |
| 886 | status &= Init3tButton(xml_doc, "button", i, newButton); |
| 887 | pWnd->AddItem(newButton); |
| 888 | } |
| 889 | |
| 890 | xml_doc.SetLocalRoot(xml_doc.GetRoot()); |
| 891 | |
| 892 | return status; |
| 893 | } |
| 894 | |
| 895 | ////////////////////////////////////////////////////////////////////////// |
| 896 |
no test coverage detected