MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / InitTabControl

Method InitTabControl

ogsr_engine/xrGame/ui/UIXmlInit.cpp:867–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867bool 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

Callers 3

InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80

Calls 4

NavigateToNodeMethod · 0.80
GetNodesNumMethod · 0.80
ReadAttribIntMethod · 0.80
AddItemMethod · 0.45

Tested by

no test coverage detected