public static ExtUITabstrip Create(UIHelperBase helperBase) { UIHelper actualHelper = helperBase as UIHelper; UIComponent optionsContainer = actualHelper.self as UIComponent; float orgOptsContainerWidth = optionsContainer.height; float orgOptsContainerHeight = optionsContainer.width; int paddingRight = 10;//Options container is Scrollable panel itself(reserves space for scroll - which we don't use) optionsContainer.size = new Vector2(orgOptsContainerWidth + paddingRight, orgOptsContainerHeight); ExtUITabstrip tabStrip = optionsContainer.AddUIComponent <ExtUITabstrip>(); tabStrip.relativePosition = new Vector3(0, 0); tabStrip.size = new Vector2(orgOptsContainerWidth, TAB_STRIP_HEIGHT); UITabContainer tabContainer = optionsContainer.AddUIComponent <UITabContainer>(); tabContainer.relativePosition = new Vector3(0, TAB_STRIP_HEIGHT); tabContainer.width = (orgOptsContainerWidth + paddingRight) - V_SCROLLBAR_WIDTH; tabContainer.height = optionsContainer.height - (TAB_STRIP_HEIGHT - /*padding-top*/ 10 - /*margin-top*/ 10); tabStrip.tabPages = tabContainer; return(tabStrip); }
public static void OnSettingsUI(UIHelper helperBase) { n = 0; ExtUITabstrip tabStrip = ExtUITabstrip.Create(helperBase); AddTab(tabStrip, "A"); AddTab(tabStrip, "B"); AddTab(tabStrip, "C"); AddTab(tabStrip, "D"); AddTab(tabStrip, "E"); AddTab(tabStrip, "D"); tabStrip.Invalidate(); }
public static ExtUITabstrip Create(UIHelperBase helperBase) { UIHelper actualHelper = helperBase as UIHelper; UIComponent container = actualHelper.self as UIComponent; ExtUITabstrip tabStrip = container.AddUIComponent <ExtUITabstrip>(); tabStrip.relativePosition = new Vector3(0, 0); tabStrip.size = new Vector2(container.width - 20, 40); float h = container.height - tabStrip.height * 2 - 40; UITabContainer tabContainer = container.AddUIComponent <UITabContainer>(); tabContainer.relativePosition = new Vector3(0, 80); tabContainer.width = tabStrip.width; tabContainer.height = h; tabStrip.tabPages = tabContainer; return(tabStrip); }
private static void AddTab(ExtUITabstrip tabStrips, string name) { UIHelper panelHelper = tabStrips.AddTabPage("TAB " + name); MakePage(panelHelper, name); }