Exemplo n.º 1
0
        public MultiColumnTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, TreeModel <MyTreeElement> model) : base(state, multicolumnHeader, model)
        {
            Assert.AreEqual(m_SortOptions.Length, Enum.GetValues(typeof(MyColumns)).Length, "Ensure number of sort options are in sync with number of MyColumns enum values");

            // Custom setup
            rowHeight = kRowHeights;
            columnIndexForTreeFoldouts    = 2;
            showAlternatingRowBackgrounds = true;
            showBorder                        = true;
            customFoldoutYOffset              = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI
            extraSpaceBeforeIconAndLabel      = kToggleWidth;
            multicolumnHeader.sortingChanged += OnSortingChanged;

            Reload();
        }
Exemplo n.º 2
0
 void Init(TreeModel <T> model)
 {
     m_TreeModel = model;
     m_TreeModel.modelChanged += ModelChanged;
 }
Exemplo n.º 3
0
 public TreeViewWithTreeModel(TreeViewState state, TreeModel <T> model) : base(state)
 {
     Init(model);
 }
Exemplo n.º 4
0
 public TreeViewWithTreeModel(TreeViewState state, MultiColumnHeader multiColumnHeader, TreeModel <T> model)
     : base(state, multiColumnHeader)
 {
     Init(model);
 }
 public MyTreeView(TreeViewState state, TreeModel <MyTreeElement> model)
     : base(state, model)
 {
     showBorder = true;
     showAlternatingRowBackgrounds = true;
 }