// static LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("tab_container"); node->getAttributeString("name", name); // Figure out if we are creating a vertical or horizontal tab container. bool is_vertical = false; LLTabContainer::TabPosition tab_position = LLTabContainer::TOP; if (node->hasAttribute("tab_position")) { std::string tab_position_string; node->getAttributeString("tab_position", tab_position_string); LLStringUtil::toLower(tab_position_string); if ("top" == tab_position_string) { tab_position = LLTabContainer::TOP; is_vertical = false; } else if ("bottom" == tab_position_string) { tab_position = LLTabContainer::BOTTOM; is_vertical = false; } else if ("left" == tab_position_string) { is_vertical = true; } } BOOL border = FALSE; node->getAttributeBOOL("border", border); LLTabContainer* tab_container = new LLTabContainer(name, LLRect::null, tab_position, border, is_vertical); S32 tab_min_width = tab_container->mMinTabWidth; if (node->hasAttribute("tab_width")) { node->getAttributeS32("tab_width", tab_min_width); } else if( node->hasAttribute("tab_min_width")) { node->getAttributeS32("tab_min_width", tab_min_width); } S32 tab_max_width = tab_container->mMaxTabWidth; if (node->hasAttribute("tab_max_width")) { node->getAttributeS32("tab_max_width", tab_max_width); } tab_container->setMinTabWidth(tab_min_width); tab_container->setMaxTabWidth(tab_max_width); BOOL hidden(tab_container->getTabsHidden()); node->getAttributeBOOL("hide_tabs", hidden); tab_container->setTabsHidden(hidden); tab_container->setPanelParameters(node, parent); if (LLFloater::getFloaterHost()) { LLFloater::getFloaterHost()->setTabContainer(tab_container); } //parent->addChild(tab_container); // Add all tab panels. LLXMLNodePtr child; for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) { LLView *control = factory->createCtrlWidget(tab_container, child); if (control && control->isPanel()) { LLPanel* panelp = (LLPanel*)control; std::string label; child->getAttributeString("label", label); if (label.empty()) { label = panelp->getLabel(); } BOOL placeholder = FALSE; child->getAttributeBOOL("placeholder", placeholder); tab_container->addTabPanel(panelp, label, false, NULL, NULL, 0, placeholder); } } tab_container->selectFirstTab(); tab_container->postBuild(); tab_container->initButtons(); // now that we have the correct rect return tab_container; }