Пример #1
0
        public GridViewGroup(ViewGroupManager owner, ItemDataSource itemDataSource, string dragId = null) : base(owner)
        {
            m_ItemDataSource = itemDataSource;
            m_SearchBar      = new SearchBar(owner);
            m_SearchBar.UpOrDownArrowPressedAction += SearchBarUpOrDownArrowPressedAction;
            m_SearchBar.OnTextChangedAction        += (str) => UpdateItemsBySearchText();

            m_GridViewDataSource                 = new GridViewDataSource();
            m_GridView                           = new GridView(owner, new GenericGridLayouter(m_GridViewDataSource));
            m_GridView.KeyboardCallback         += ListAreaKeyboardCallback;
            m_GridView.ItemExpandedAction       += ItemExpandedAction;
            m_GridView.BeginRenameAction        += ItemBeginRenameAction;
            m_GridView.RenameEndAction          += ItemRenameEndAction;
            m_GridView.ViewHandler.GenericDragId = dragId != null ? dragId : GetHashCode().ToString();
            m_GridView.GridSizeChangedAction    += (size) =>
            {
                m_BottomBar.Value = size;
            };

            m_BottomBar                       = new BottomBar(owner);
            m_BottomBar.Value                 = m_GridView.GridSize;
            m_BottomBar.MinValue              = m_GridView.ViewLayouter.LayoutParams.MinGridSize;
            m_BottomBar.MaxValue              = m_GridView.ViewLayouter.LayoutParams.MaxGridSize;
            m_BottomBar.OnValueChangedAction += (size) =>
            {
                m_GridView.GridSize = size;
            };


            GridViewDeleteAction += DeleteGridItems;
        }
Пример #2
0
 public GridView(ViewGroupManager owner, GridLayouter gridLayouter, GridViewHandler viewHandler = null) : base(owner)
 {
     m_ViewConfig      = new GridViewConfig();
     m_GridLayouter    = gridLayouter;
     m_DataSource      = m_GridLayouter.DataSource;
     m_GridViewHandler = viewHandler;
     if (m_GridViewHandler == null)
     {
         m_GridViewHandler = new GridViewHandler(m_DataSource);
     }
     m_GridLayouter.Owner = this;
     m_RenameOverlay.Clear();
 }
        public FolderGridViewGroup(ViewGroupManager owner, EditorWindowConfigSource configSource, string stateConfigName, string containerConfigName, string dragId = null) : base(owner)
        {
            m_ConfigSource = configSource;

            m_ItemDataSource = new ItemDataSource();
            m_SearchBar      = new SearchBar(owner);
            m_SearchBar.UpOrDownArrowPressedAction += SearchBarUpOrDownArrowPressedAction;
            m_SearchBar.OnTextChangedAction        += (str) => UpdateItemsBySearchText();

            dragId = dragId != null ? dragId : GetHashCode().ToString();
            m_FolderTreeViewGroup = new FolderTreeViewGroup(owner, configSource, stateConfigName, containerConfigName, dragId);

            m_GridViewDataSource = new GridViewDataSource();
            var layout      = new GenericGridLayouter(m_GridViewDataSource);
            var viewHandler = new FolderGridViewHandler(layout.DataSource);

            viewHandler.TreeViewDragging = m_FolderTreeViewGroup.GetTreeViewDragging();
            m_GridView = new GridView(owner, layout, viewHandler);
            m_GridView.KeyboardCallback         += ListAreaKeyboardCallback;
            m_GridView.ItemExpandedAction       += ItemExpandedAction;
            m_GridView.BeginRenameAction        += ItemBeginRenameAction;
            m_GridView.RenameEndAction          += ItemRenameEndAction;
            m_GridView.ItemDoubleClickAction    += ItemDoubleClick;
            m_GridView.ItemSelectedAction       += GridViewItemSelected;
            m_GridView.ViewHandler.GenericDragId = dragId;
            m_GridView.GridSizeChangedAction    += (size) =>
            {
                m_BottomBar.Value = size;
            };

            m_BreadcrumbBar = new BreadcrumbBar(owner);
            m_BreadcrumbBar.ShowFolderContentsAction += (id) =>
            {
                m_TreeView.SetSelection(new int[] { id }, false);
                UpdateBreadcrumbBarContents();
                UpdateGridViewContent();
            };

            m_BottomBar                       = new BottomBar(owner);
            m_BottomBar.Value                 = m_GridView.GridSize;
            m_BottomBar.MinValue              = m_GridView.ViewLayouter.LayoutParams.MinGridSize;
            m_BottomBar.MaxValue              = m_GridView.ViewLayouter.LayoutParams.MaxGridSize;
            m_BottomBar.OnValueChangedAction += (size) =>
            {
                m_GridView.GridSize = size;
            };

            GridViewDeleteAction += DeleteGridItems;

            m_TreeView = m_FolderTreeViewGroup.GetTreeView();
            m_BreadcrumbBar.FolderTreeView = m_TreeView;
            m_FolderTreeViewGroup.GetFolderTreeViewGUI().RenameEndAction += (item, name) =>
            {
                UpdateBreadcrumbBarContents();
            };

            m_HorizontalSplitLine = new HorizontalSplitLine(m_SplitLineStartPosX, HorizontalSplitLineMinX);
            m_HorizontalSplitLine.PositionChangedAction += RefreshSplittedSelectedPath;
            m_HorizontalSplitLine.ConfigSource           = configSource;
            m_ItemDataSource.SetConfigSource(configSource);

            m_TreeView.selectionChangedCallback += FolderTreeViewSelectionChanged;
            m_FolderTreeViewGroup.GetTreeViewDragging().EndDragAction += (hasError) =>
            {
                UpdateGridViewContent();
            };
            m_FolderTreeViewGroup.DuplicateItemsDone += UpdateGridViewContent;

            GetDataContainer().UpdateItemChangedAction += () =>
            {
                UpdateGridViewContent();
                CheckBottomBarItemValidity();
                UpdateBreadcrumbBarContents();
            };

            DuplicateItemsAction += DuplicateItemGridView;
        }
 public FolderGridViewHandler(GridViewDataSource dataSource) : base(dataSource)
 {
 }
Пример #5
0
 protected GridLayouter(GridViewDataSource dataSource)
 {
     m_DataSource = dataSource;
 }
Пример #6
0
 public GridViewHandler(GridViewDataSource dataSource)
 {
     m_DataSource = dataSource;
 }
Пример #7
0
 public GenericGridLayouter(GridViewDataSource dataSource) : base(dataSource)
 {
 }