public void Init(Rect rect, BackendData backendData)
 {
     if (this.m_TreeView == null)
     {
         this.m_BackendData = backendData;
         TreeViewStateWithColumns treeViewStateWithColumns = new TreeViewStateWithColumns();
         treeViewStateWithColumns.columnWidths = new float[]
         {
             250f,
             90f,
             93f,
             98f,
             74f,
             78f
         };
         this.m_TreeView = new TreeViewController(this.m_EditorWindow, treeViewStateWithColumns);
         ITreeViewGUI        gui      = new TestGUI(this.m_TreeView);
         ITreeViewDragging   dragging = new TestDragging(this.m_TreeView, this.m_BackendData);
         ITreeViewDataSource data;
         if (this.m_Lazy)
         {
             data = new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
         }
         else
         {
             data = new TestDataSource(this.m_TreeView, this.m_BackendData);
         }
         this.m_TreeView.Init(rect, data, gui, dragging);
         this.m_ColumnHeader = new TreeViewColumnHeader();
         this.m_ColumnHeader.columnWidths   = treeViewStateWithColumns.columnWidths;
         this.m_ColumnHeader.minColumnWidth = 30f;
         TreeViewColumnHeader expr_DA = this.m_ColumnHeader;
         expr_DA.columnRenderer = (Action <int, Rect>)Delegate.Combine(expr_DA.columnRenderer, new Action <int, Rect>(this.OnColumnRenderer));
     }
 }
Exemple #2
0
        public void Init(Rect rect, BackendData backendData)
        {
            if (m_TreeView != null)
            {
                return;
            }

            m_BackendData = backendData;

            var state = new TreeViewStateWithColumns();

            state.columnWidths = new float[] { 250f, 90f, 93f, 98f, 74f, 78f };

            m_TreeView = new TreeViewController(m_EditorWindow, state);
            ITreeViewGUI        gui      = new TestGUI(m_TreeView);
            ITreeViewDragging   dragging = new TestDragging(m_TreeView, m_BackendData);
            ITreeViewDataSource dataSource;

            if (m_Lazy)
            {
                dataSource = new LazyTestDataSource(m_TreeView, m_BackendData);
            }
            else
            {
                dataSource = new TestDataSource(m_TreeView, m_BackendData);
            }
            m_TreeView.Init(rect, dataSource, gui, dragging);


            m_ColumnHeader = new TreeViewColumnHeader();
            m_ColumnHeader.columnWidths    = state.columnWidths;
            m_ColumnHeader.minColumnWidth  = 30f;
            m_ColumnHeader.columnRenderer += OnColumnRenderer;
        }
Exemple #3
0
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            this.m_TreeView = new TreeViewController(editorWindow, treeViewState);
            TestGUICustomItemHeights gui      = new TestGUICustomItemHeights(this.m_TreeView);
            TestDragging             dragging = new TestDragging(this.m_TreeView, this.m_BackendData);
            TestDataSource           data     = new TestDataSource(this.m_TreeView, this.m_BackendData);

            data.onVisibleRowsChanged = (System.Action)Delegate.Combine(data.onVisibleRowsChanged, new System.Action(gui.CalculateRowRects));
            this.m_TreeView.Init(rect, data, gui, dragging);
            data.SetExpanded(data.root, true);
        }
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            this.m_TreeView = new TreeViewController(editorWindow, treeViewState);
            TestGUICustomItemHeights testGUICustomItemHeights = new TestGUICustomItemHeights(this.m_TreeView);
            TestDragging             dragging       = new TestDragging(this.m_TreeView, this.m_BackendData);
            TestDataSource           testDataSource = new TestDataSource(this.m_TreeView, this.m_BackendData);
            TestDataSource           expr_52        = testDataSource;

            expr_52.onVisibleRowsChanged = (Action)Delegate.Combine(expr_52.onVisibleRowsChanged, new Action(testGUICustomItemHeights.CalculateRowRects));
            this.m_TreeView.Init(rect, testDataSource, testGUICustomItemHeights, dragging);
            testDataSource.SetExpanded(testDataSource.root, true);
        }
Exemple #5
0
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            m_BackendData = backendData;

            var state = new TreeViewState();

            m_TreeView = new TreeViewController(editorWindow, state);
            var gui        = new TestGUICustomItemHeights(m_TreeView);
            var dragging   = new TestDragging(m_TreeView, m_BackendData);
            var dataSource = new TestDataSource(m_TreeView, m_BackendData);

            dataSource.onVisibleRowsChanged += gui.CalculateRowRects;
            m_TreeView.Init(rect, dataSource, gui, dragging);
            dataSource.SetExpanded(dataSource.root, true);
        }