Ejemplo n.º 1
0
 public void Init(Rect rect, BackendData backendData)
 {
   if (this.m_TreeView != null)
     return;
   this.m_BackendData = backendData;
   TreeViewState treeViewState = new TreeViewState();
   treeViewState.columnWidths = new float[6]
   {
     250f,
     90f,
     93f,
     98f,
     74f,
     78f
   };
   this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
   ITreeViewGUI gui = (ITreeViewGUI) new TestGUI(this.m_TreeView);
   ITreeViewDragging dragging = (ITreeViewDragging) new TestDragging(this.m_TreeView, this.m_BackendData);
   ITreeViewDataSource data = !this.m_Lazy ? (ITreeViewDataSource) new TestDataSource(this.m_TreeView, this.m_BackendData) : (ITreeViewDataSource) new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
   this.m_TreeView.Init(rect, data, gui, dragging);
   this.m_ColumnHeader = new TreeViewColumnHeader();
   this.m_ColumnHeader.columnWidths = treeViewState.columnWidths;
   this.m_ColumnHeader.minColumnWidth = 30f;
   this.m_ColumnHeader.columnRenderer += new System.Action<int, Rect>(this.OnColumnRenderer);
 }
Ejemplo n.º 2
0
 public void Init(Rect rect, BackendData backendData)
 {
     if (this.m_TreeView == null)
     {
         ITreeViewDataSource source;
         this.m_BackendData = backendData;
         TreeViewState treeViewState = new TreeViewState {
             columnWidths = new float[] { 
                 250f,
                 90f,
                 93f,
                 98f,
                 74f,
                 78f
             }
         };
         this.m_TreeView = new TreeViewController(this.m_EditorWindow, treeViewState);
         ITreeViewGUI gui = new TestGUI(this.m_TreeView);
         ITreeViewDragging dragging = new TestDragging(this.m_TreeView, this.m_BackendData);
         if (this.m_Lazy)
         {
             source = new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
         }
         else
         {
             source = new TestDataSource(this.m_TreeView, this.m_BackendData);
         }
         this.m_TreeView.Init(rect, source, gui, dragging);
         this.m_ColumnHeader = new TreeViewColumnHeader();
         this.m_ColumnHeader.columnWidths = treeViewState.columnWidths;
         this.m_ColumnHeader.minColumnWidth = 30f;
         this.m_ColumnHeader.columnRenderer = (Action<int, Rect>) Delegate.Combine(this.m_ColumnHeader.columnRenderer, new Action<int, Rect>(this, (IntPtr) this.OnColumnRenderer));
     }
 }
 public PackageExportTreeView(PackageExport packageExport, TreeViewState treeViewState, Rect startRect)
 {
     this.m_PackageExport = packageExport;
     this.m_TreeView = new TreeViewController(this.m_PackageExport, treeViewState);
     PackageExportTreeViewDataSource data = new PackageExportTreeViewDataSource(this.m_TreeView, this);
     PackageExportTreeViewGUI gui = new PackageExportTreeViewGUI(this.m_TreeView, this);
     this.m_TreeView.Init(startRect, data, gui, null);
     this.m_TreeView.ReloadData();
     this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.SelectionChanged));
     gui.itemWasToggled = (Action<PackageExportTreeViewItem>) Delegate.Combine(gui.itemWasToggled, new Action<PackageExportTreeViewItem>(this.ItemWasToggled));
     this.ComputeEnabledStateForFolders();
 }
 public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback)
 {
     this.m_TreeView = new TreeViewController(mixerWindow, treeState);
     this.m_TreeView.deselectOnUnhandledMouseDown = false;
     this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     this.m_TreeView.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick));
     AudioMixersTreeViewGUI gui = new AudioMixersTreeViewGUI(this.m_TreeView);
     AudioMixersDataSource data = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
     AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action<List<AudioMixerController>, AudioMixerController>(this, (IntPtr) this.OnMixersDroppedOnMixerCallback));
     this.m_TreeView.Init(mixerWindow.position, data, gui, dragging);
     this.m_TreeView.ReloadData();
 }
 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 = (Action) Delegate.Combine(data.onVisibleRowsChanged, new Action(gui, (IntPtr) this.CalculateRowRects));
     this.m_TreeView.Init(rect, data, gui, dragging);
     data.SetExpanded(data.root, true);
 }
 public void InitIfNeeded(EditorWindow owner, Rect rect)
 {
     if (this.m_TreeViewState == null)
     {
         this.m_TreeViewState = new TreeViewState();
         this.m_TreeView = new TreeViewController(owner, this.m_TreeViewState);
         this.m_TreeView.deselectOnUnhandledMouseDown = true;
         this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView);
         TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(this.m_TreeView, owner);
         this.m_TreeView.Init(rect, this.m_TreeViewDataSource, gui, null);
         this.m_TreeViewDataSource.UpdateData();
     }
 }
 public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
 {
   this.m_BackendData = backendData;
   TreeViewState treeViewState = new TreeViewState();
   this.m_TreeView = new TreeView(editorWindow, treeViewState);
   TestGUICustomItemHeights customItemHeights = new TestGUICustomItemHeights(this.m_TreeView);
   TestDragging testDragging = new TestDragging(this.m_TreeView, this.m_BackendData);
   TestDataSource testDataSource1 = new TestDataSource(this.m_TreeView, this.m_BackendData);
   TestDataSource testDataSource2 = testDataSource1;
   System.Action action = testDataSource2.onVisibleRowsChanged + new System.Action(((TreeViewGUIWithCustomItemsHeights) customItemHeights).CalculateRowRects);
   testDataSource2.onVisibleRowsChanged = action;
   this.m_TreeView.Init(rect, (ITreeViewDataSource) testDataSource1, (ITreeViewGUI) customItemHeights, (ITreeViewDragging) testDragging);
   testDataSource1.SetExpanded(testDataSource1.root, true);
 }
 public AudioMixerGroupTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState)
 {
     this.m_AudioGroupTreeState = treeState;
     this.m_AudioGroupTree = new TreeViewController(mixerWindow, this.m_AudioGroupTreeState);
     this.m_AudioGroupTree.deselectOnUnhandledMouseDown = false;
     this.m_AudioGroupTree.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_AudioGroupTree.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     this.m_AudioGroupTree.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_AudioGroupTree.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick));
     this.m_AudioGroupTree.expandedStateChanged = (Action) Delegate.Combine(this.m_AudioGroupTree.expandedStateChanged, new Action(this, (IntPtr) this.SaveExpandedState));
     this.m_TreeViewGUI = new AudioGroupTreeViewGUI(this.m_AudioGroupTree);
     this.m_TreeViewGUI.NodeWasToggled = (Action<AudioMixerTreeViewNode, bool>) Delegate.Combine(this.m_TreeViewGUI.NodeWasToggled, new Action<AudioMixerTreeViewNode, bool>(this, (IntPtr) this.OnNodeToggled));
     this.m_AudioGroupTreeDataSource = new AudioGroupDataSource(this.m_AudioGroupTree, this.m_Controller);
     this.m_AudioGroupTree.Init(mixerWindow.position, this.m_AudioGroupTreeDataSource, this.m_TreeViewGUI, new AudioGroupTreeViewDragging(this.m_AudioGroupTree, this));
     this.m_AudioGroupTree.ReloadData();
 }