public void AddTab(Tab tab) { Tabs.Add(tab); var tabBtn = new TabButton(tab, _style.TabButtonStyle); tabBtn.OnClick += () => { SetActiveTab(tabBtn.GetTab()); }; TabButtons.Add(tabBtn); _buttonsTable.Add(tabBtn); if (Tabs.Count == 1) { CurrentTab = Tabs[0]; _tabTable.Add(tab).Left().Top().Fill().Expand(); tabBtn.ToggleOn(); } if (Tabs.Count == 1) { SetActiveTab(0); } }
public Window(string title, WindowStyle style) { Insist.IsNotNull(title, "title cannot be null"); touchable = Touchable.Enabled; Clip = true; titleLabel = new Label(title, new LabelStyle(style.TitleFont, style.TitleFontColor)); titleLabel.SetEllipsis(true); titleTable = new Table(); titleTable.Add(titleLabel).SetExpandX().SetFillX().SetMinWidth(0); AddElement(titleTable); SetStyle(style); width = 150; height = 150; }
/// <summary> /// Adds the given Label to the content table /// </summary> /// <param name="label">Label.</param> public Dialog AddText(Label label) { contentTable.Add(label); return(this); }