public PageListPanel(ComponentEditorWindow window) { EnableScroll(true); RelativeSize(true); addPageButton = new EButton().OnClicked((EButton b) => AddNewPage()).Width(70) + new EText("New page"); dbPageList = new EVerticalLayout().EnableScroll(true).RelativeSize(true); this.window = window; this.children.Add( (new EHorizontalLayout().Height(16) + addPageButton ) ); this.children.Add( new ESpacer().Height(8) ); this.children.Add(dbPageList); }
void Construct() { cfg = RTS.Subsys.DataProvider.Get().config; if (contentList == null) { contentList = new EVerticalLayout().RelativeSize(true).EnableScroll(true); } if (root == null) { root = new EVerticalLayout(); root.children.Add(contentList); root.children.Add(new EButton().RelativeSize(false).OnClicked((EButton b) => AddNewEvent()).Height(40) + new EText().Content("Add new event")); } root.OnConstruct(this); }
public PageContentPanel(ComponentEditorWindow window) { RelativeSize(true); UCellRelativeSize(false); UCellWidth(200); HandleSize(4); this.window = window; delPageButton = new EButton().Width(100).OnClicked((EButton b) => DelPage()) + new EText().Content("Del"); editPageButton = new EButton().Width(100).OnClicked((EButton b) => EditPage()) + new EText().Content("Rename"); namingBar = (new ESwitchTab().Height(16) + (new EHorizontalLayout().Height(16) + new EText().BindContent(() => { return(this.window.selectedPage == -1 ? "" : window.database.pages[this.window.selectedPage].pageName); }) .RelativeSize(true) + editPageButton + delPageButton ) + (new EHorizontalLayout().Height(16) + new ETextInputField().RelativeSize(true) + editPageButton + delPageButton ) ); compList = new EVerticalLayout().RelativeSize(true).EnableScroll(true); uchild = (new EVerticalLayout().RelativeSize(true) + namingBar + (new EButton().Height(20) + new EText("Flags")) + (new EVerticalLayout().RelativeSize(true).EnableScroll(true) + new EBox().Content(new GUIContent("Placeholder")).Height(50) + new EBox().Content(new GUIContent("Placeholder")).Height(50) + new EBox().Content(new GUIContent("Placeholder")).Height(50) ) ); //page contents lchild = ( new EVerticalLayout().RelativeSize(true) + (new EButton().OnClicked((EButton b) => window.OpenCompCreateTab()) + new EText("New component")) + compList ); }
private void OnGUI() { if (cfg.events.Count < contentList.children.Count) { contentList.children.RemoveRange(cfg.events.Count, contentList.children.Count - cfg.events.Count); } else { for (int i = contentList.children.Count; i < cfg.events.Count; i++) { { contentList += new EventContentLine(i, this).Height(16); } } } root.OnDrawGUI(new Rect(0, 0, position.width, position.height), this); }
void AddNewEvent() { cfg.events.Add("New event"); contentList += new EventContentLine(cfg.events.Count - 1, this).Height(16); BeginEdit(cfg.events.Count - 1); }