コード例 #1
0
ファイル: ReferencesTreeView.cs プロジェクト: s1gurd/W-Hub
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (ReferencesTreeViewItem <T>)args.item;

            for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (Columns)args.GetColumn(i), ref args);
            }
        }
コード例 #2
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = args.item as CanvasTreeViewItem;

            for (int i = 0; i < args.GetNumVisibleColumns(); i++)
            {
                CellGUI(args.GetCellRect(i), item, (CanvasColumnType)args.GetColumn(i), args);
            }
        }
コード例 #3
0
        protected override void RowGUI(RowGUIArgs args)
        {
            if (args.item is Element element)
            {
                int columnCount = args.GetNumVisibleColumns();

                for (int i0 = 0; i0 < columnCount; ++i0)
                {
                    var cellRect    = args.GetCellRect(i0);
                    var columnIndex = args.GetColumn(i0);

                    CenterRectUsingSingleLineHeight(ref cellRect);

                    switch ((Column)(1 << columnIndex))
                    {
                    case Column.kName:
                    {
                        base.RowGUI(args);
                        break;
                    }

                    case Column.kExtension:
                    {
                        DefaultGUI.Label(cellRect, element.extension, args.selected, args.focused);
                        break;
                    }

                    case Column.kPath:
                    {
                        DefaultGUI.Label(cellRect, element.path, args.selected, args.focused);
                        break;
                    }

                    case Column.kGuid:
                    {
                        DefaultGUI.Label(cellRect, element.guid, args.selected, args.focused);
                        break;
                    }

                    case Column.kReference:
                    {
                        if (element.reference >= 0)
                        {
                            DefaultGUI.LabelRightAligned(cellRect, element.reference.ToString(), args.selected, args.focused);
                        }
                        break;
                    }

                    default:
                    {
                        base.RowGUI(args);
                        break;
                    }
                    }
                }
            }
        }
コード例 #4
0
    protected override void RowGUI(RowGUIArgs args)
    {
        VCTreeViewItem item = (VCTreeViewItem)args.item;

        for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
        {
            CellGUI(args.GetCellRect(i), item, (MultiColumnView.Column)args.GetColumn(i), ref args);
        }
    }
コード例 #5
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TreeViewItem <BehaviorTreeNode>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (ViewColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #6
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (PackageTreeItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (ColumnEnum)args.GetColumn(i), ref args);
            }
        }
コード例 #7
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var rowItem = (TreeViewItem <FeatureTreeElement>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), rowItem, (FeatureSubLayerColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #8
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TreeViewItem <CustomPackageManagerScopedRegistry>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, ( PackageColumn )args.GetColumn(i), ref args);
            }
        }
コード例 #9
0
ファイル: ATTabelView.cs プロジェクト: xubingyue/ATILRuntime
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (RowItem <TestUnit>)args.item;

            for (var i = 0; i < args.GetNumVisibleColumns(); i++)
            {
                CellGUI(args.GetCellRect(i), item, (ColumnType)args.GetColumn(i), ref args);
            }
        }
コード例 #10
0
        protected override void RowGUI(RowGUIArgs args)
        {
            ThreadTreeViewItem item = (ThreadTreeViewItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #11
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (SerializedPropertyItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
            }
        }
コード例 #12
0
ファイル: PrefabsListTreeView.cs プロジェクト: kbedits/Editor
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TreeViewItem <PrefabsListElement>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (Columns)args.GetColumn(i), ref args);
            }
        }
コード例 #13
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TestListTableItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #14
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (BundleBuilderTreeViewItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
            }
        }
コード例 #15
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (SelectionWindowTreeViewItem)args.item;

            for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #16
0
        protected override void RowGUI(RowGUIArgs args)
        {
            UnityEngine.Profiling.Profiler.BeginSample(GetType().Name + ".RowGUI");

            var item = args.item as AbstractTreeViewItem;

            if (item != null && !item.enabled)
            {
                EditorGUI.BeginDisabledGroup(true);
            }

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                var rect = args.GetCellRect(i);

                if (args.row == m_FirstVisibleRow)
                {
                    var r = rect;
                    r.x     += r.width + (i > 0 ? 2 : -1);
                    r.width  = 1;
                    r.height = 10000;
                    var oldColor = GUI.color;
                    GUI.color = new Color(0, 0, 0, 0.15f);
                    GUI.DrawTexture(r, EditorGUIUtility.whiteTexture);
                    GUI.color = oldColor;
                }

                if (i == 0)
                {
                    rect.x     += extraSpaceBeforeIconAndLabel;
                    rect.width -= extraSpaceBeforeIconAndLabel;

                    // Display the tree as a flat list when content is filtered
                    if (hasSearch)
                    {
                        rect = TreeViewUtility.IndentByDepth(0, rect);
                    }
                    else
                    {
                        rect = TreeViewUtility.IndentByDepth(args.item.depth, rect);
                    }
                }

                if (item != null)
                {
                    var column = args.GetColumn(i);
                    item.OnGUI(rect, column);
                }
            }

            if (item != null && !item.enabled)
            {
                EditorGUI.EndDisabledGroup();
            }

            UnityEngine.Profiling.Profiler.EndSample();
        }
コード例 #17
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (MyTreeViewItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (Columns)args.GetColumn(i));
            }
        }
コード例 #18
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = args.item as EditorTableItem;

            for (int i = 0; i < args.GetNumVisibleColumns(); i++)
            {
                CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
            }
        }
コード例 #19
0
            protected override void RowGUI(RowGUIArgs args)
            {
                var item = m_Entries[args.item.id];

                for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
                }
            }
コード例 #20
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var columnCount = args.GetNumVisibleColumns();

            for (var i = 0; i < columnCount; ++i)
            {
                ColumnGUI(args.GetCellRect(i), args.item, args.GetColumn(i), ref args);
            }
        }
コード例 #21
0
        protected override void RowGUI(RowGUIArgs args)
        {
            TreeViewItem <T> item = (TreeViewItem <T>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (TColumns)(object)args.GetColumn(i), ref args);
            }
        }
コード例 #22
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var ltci = args.item as LocaleTreeViewItem;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), ltci, (Column)args.GetColumn(i));
            }
        }
コード例 #23
0
        /// <summary>
        /// 各行の GUI を描画します
        /// </summary>
        protected override void RowGUI(RowGUIArgs args)
        {
            if (!(args.item is BookmarkData item) || !item.IsValid)
            {
                return;
            }

            var asset   = item.Asset;
            var path    = AssetDatabase.GetAssetPath(asset);
            var columns = args.GetNumVisibleColumns();

            for (var i = 0; i < columns; i++)
            {
                var rect        = args.GetCellRect(i);
                var columnIndex = ( ColumnType )args.GetColumn(i);

                switch (columnIndex)
                {
                case ColumnType.NAME:
                    EditorGUIUtility.SetIconSize(new Vector2(16, 16));
                    var label = EditorGUIUtility.ObjectContent(asset, null);
                    EditorGUI.LabelField(rect, label);
                    break;

                case ColumnType.PING:
                    if (GUI.Button(rect, "ping", EditorStyles.miniButton))
                    {
                        EditorGUIUtility.PingObject(asset);
                    }

                    break;

                case ColumnType.OPEN:
                    var isFolder = AssetDatabase.IsValidFolder(path);
                    using (new EditorGUI.DisabledScope(isFolder))
                    {
                        if (GUI.Button(rect, "open", EditorStyles.miniButton))
                        {
                            AssetDatabase.OpenAsset(asset);
                        }
                    }

                    break;

                case ColumnType.REMOVE:
                    if (GUI.Button(rect, "x", EditorStyles.miniButton))
                    {
                        BookmarkSaveData.List.Remove(item);
                        BookmarkSaveData.Save();
                        OnReload?.Invoke();
                    }

                    break;
                }
            }
        }
コード例 #24
0
 protected override void RowGUI(RowGUIArgs args)
 {
     var item = (SignalReceiverItem)args.item;
     for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
     {
         var rect = args.GetCellRect(i);
         rect.y += k_VerticalPadding;
         item.Draw(rect, args.GetColumn(i), args.row, k_HorizontalPadding, m_Target);
     }
 }
コード例 #25
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (MaintainerTreeViewItem <T>)args.item;

            for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                var rect = args.GetCellRect(i);
                DrawCell(ref rect, item, args.GetColumn(i), args);
            }
        }
コード例 #26
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var moduleTreeViewItem = args.item as UTinyModuleTreeViewItem;

            if (moduleTreeViewItem != null)
            {
                for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    CellGUI(args.GetCellRect(i), moduleTreeViewItem, (ColumnType)args.GetColumn(i), ref args);
                }
            }
            else
            {
                for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    CellGUI(args.GetCellRect(i), args.item, (ColumnType)args.GetColumn(i), ref args);
                }
            }
        }
コード例 #27
0
 protected override void RowGUI(RowGUIArgs args)
 {
     for (int i = 0; i < args.GetNumVisibleColumns(); i++)
     {
         Rect         rect   = args.GetCellRect(i);
         TreeViewItem item   = args.item;
         int          column = args.GetColumn(i);
         CellGUI(rect, item, column, ref args);
     }
 }
コード例 #28
0
ファイル: DocumentTree.cs プロジェクト: weixinxin/CodeLib
    protected override void RowGUI(RowGUIArgs args)
    {
        var item = args.item;

        extraSpaceBeforeIconAndLabel = 18f;
        for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
        {
            CellGUI(args.GetCellRect(i), item as DirectoryTreeItem, (Columns)args.GetColumn(i), ref args);
        }
    }
コード例 #29
0
ファイル: CommitTreeView.cs プロジェクト: Mangiang/GitEditor
        /// <summary>
        /// Display the rows.
        /// </summary>
        /// <param name="args">The row.</param>
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TreeViewItem <CommitTreeElement>)args.item;
            int visibleColumnsCount = args.GetNumVisibleColumns();

            for (int i = 0; i < visibleColumnsCount; ++i)
            {
                CellGUI(args.GetCellRect(i), item, (CommitColumns)args.GetColumn(i), ref args);
            }
        }
コード例 #30
0
        protected override void RowGUI(RowGUIArgs args)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }
            for (int i = 0, count = args.GetNumVisibleColumns(); i < count; i++)
            {
                int  column = args.GetColumn(i);
                Rect rect   = args.GetCellRect(i);
                if (column == (int)Column.Element)
                {
                    if (lineStyle == null)
                    {
                        lineStyle = new GUIStyle(DefaultStyles.label);
                    }
                    rect.xMin += lineStyle.margin.left + GetContentIndent(args.item);

                    int iconRectWidth            = 16;
                    int kSpaceBetweenIconAndText = 2;

                    // Draw icon
                    Rect iconRect = rect;
                    iconRect.width = iconRectWidth;

                    Texture icon = args.item.icon;
                    if (icon != null)
                    {
                        GUI.DrawTexture(iconRect, icon, ScaleMode.ScaleToFit);
                    }

                    // Draw text
                    lineStyle.padding.left = icon == null ? 0 : iconRectWidth + kSpaceBetweenIconAndText;
                    lineStyle.Draw(rect, args.item.displayName, false, false, args.selected, args.focused);

                    continue;
                }

                string content = GetItemcontent(args, column);
                if (content != null)
                {
                    DefaultGUI.LabelRightAligned(rect, content, args.selected, args.focused);
                }
                else
                {
                    //var c = GUI.color;
                    //var f = .65F;
                    //GUI.color = new Color(f, f, f, 1F);
                    GUI.enabled = false;
                    DefaultGUI.LabelRightAligned(rect, "-", false, false);
                    //GUI.color = c;
                    GUI.enabled = true;
                }
            }
        }