void CreateContentGUI() { TwoPaneSplitView splitView = new TwoPaneSplitView(); splitView.orientation = TwoPaneSplitViewOrientation.Vertical; splitView.fixedPaneIndex = 1; splitView.fixedPaneInitialDimension = 80; rootVisualElement.Add(splitView); m_DataListView = new LogDataListViewer(); m_DataListView.BindedData = searchedLogDatas; splitView.Add(m_DataListView); VisualElement stacktraceElement = new VisualElement(); stacktraceElement.ExpandWidth(); stacktraceElement.SetHeight(80); splitView.Add(stacktraceElement); m_StacktraceText = new TextField(); m_StacktraceText.label = null; m_StacktraceText.ExpandWidthAndHeight(); m_StacktraceText.multiline = true; m_StacktraceText.isReadOnly = true; stacktraceElement.Add(m_StacktraceText); m_DataListView.OnDataSelected += (data) => { m_StacktraceText.value = data == null ? string.Empty : data.Stacktrace; }; }
void OnEnable() { var root = rootVisualElement; var visualTreeAsset = Resources.Load <VisualTreeAsset>(INI_WINDOW_UXML); var visualTree = visualTreeAsset.CloneTree(); visualTree.SetWidth(100, LengthUnit.Percent); visualTree.SetHeight(100, LengthUnit.Percent); root.Add(visualTree); visualTree.AssignQueryResults(this); toolbarCreateBtn.clicked += () => { var x = root.layout.x + toolbarCreateBtn.layout.x; var y = root.layout.y + toolbarCreateBtn.layout.y; x += Input.mousePosition.x + position.x; y += Input.mousePosition.y + position.y; x = toolbarCreateBtn.worldBound.x; y = toolbarCreateBtn.worldBound.y; CustomPopupWindow.OpenWindow(new Rect(x, y, 400, 300), null, true, false); }; toolbarOpenBtn.clicked += () => { }; toolbarSaveBtn.clicked += () => { }; toolbarSaveAsBtn.clicked += () => { }; m_SectionListView = new IniSectionListView(); m_SectionView = new IniSectionView(); TwoPaneSplitView splitView = new TwoPaneSplitView(0, 200, TwoPaneSplitViewOrientation.Horizontal); splitView.Add(m_SectionListView); splitView.Add(m_SectionView); m_ContentContainer.Add(splitView); }
void DrawContainer() { TwoPaneSplitView splitView = new TwoPaneSplitView(); splitView.fixedPaneInitialDimension = 200; splitView.fixedPaneIndex = 0; VisualElement sectionListContainer = new VisualElement(); sectionListContainer.name = "section-list-container"; splitView.Add(sectionListContainer); VisualElement sectionDetailContainer = new VisualElement(); sectionDetailContainer.name = "section-detail-container"; splitView.Add(sectionDetailContainer); sectionDetailContainer.Add(new IniPropertyView() { BindData = new IniProperty("Test1", "Value1") }); rootVisualElement.Add(splitView); }