Esempio n. 1
0
 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));
     }
 }
Esempio n. 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;
        }