protected override void RowGUI(RowGUIArgs args)
        {
            // Draw background
            if (!args.selected)
            {
                var headerRect = args.rowRect;
                if (headerRect.Contains(Event.current.mousePosition))
                {
                    HierarchyGui.BackgroundColor(headerRect, BuildManifestColors.Table.Hover);
                    m_CurrentHoveredRect = headerRect;
                }
            }

            switch (args.item)
            {
            case SceneReferenceItem sceneRefItem:
                for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    DrawRowCell(args.GetCellRect(i), (Column)args.GetColumn(i), sceneRefItem, args);
                }
                break;

            case TreeViewItem treeItem:
                for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    DrawRowCell(args.GetCellRect(i), (Column)args.GetColumn(i), treeItem, args);
                }
                break;
            }

            base.RowGUI(args);
        }
Example #2
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = args.item as TreeViewItem <object>;
            var numVisibleColumns = args.GetNumVisibleColumns();

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                var column = _model.Columns[i];
                CellGUI(args.GetCellRect(i), item, column, ref args);
            }
        }
Example #3
0
        protected override void RowGUI(RowGUIArgs args) // draw gui
        {
            var item = args.item as FileTreeViewItem;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = args.GetColumn(visibleColumnIndex);
                var labelStyle  = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.MiddleLeft;

                switch (columnIndex)
                {
                case 0:
                    EditorGUI.LabelField(rect, item.FileName, labelStyle);
                    break;

                case 1:
                    EditorGUI.LabelField(rect, item.FileId, labelStyle);
                    break;

                case 2:
                    EditorGUI.LabelField(rect, item.MimeType, labelStyle);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
Example #4
0
            protected override void RowGUI(RowGUIArgs args)
            {
                var item       = args.item;
                var transition = profile.transitions[item.id];

                EditorGUI.BeginChangeCheck();

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

                    switch (args.GetColumn(i))
                    {
                    case 0: { // on
                        transition.enabled = EditorGUI.Toggle(cellRect, transition.enabled);
                    } break;

                    case 1: { // from
                        EditorGUI.LabelField(cellRect, transition.fromState.GetStatePreview());
                    } break;

                    case 2: { // to
                        EditorGUI.LabelField(cellRect, transition.targetInfo);
                    } break;
                    }
                }

                if (EditorGUI.EndChangeCheck())
                {
                    EditorUtility.SetDirty(profile);
                }
            }
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = args.item as MessagePipeDiagnosticsInfoTreeViewItem;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = args.GetColumn(visibleColumnIndex);

                var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.MiddleLeft;
                switch (columnIndex)
                {
                case 0:
                    EditorGUI.LabelField(rect, item.Head, labelStyle);
                    break;

                case 1:
                    EditorGUI.LabelField(rect, item.Elapsed.TotalSeconds.ToString(@"00.00"), labelStyle);
                    break;

                case 2:
                    EditorGUI.LabelField(rect, item.Count.ToString(), labelStyle);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
Example #6
0
            protected override void RowGUI(RowGUIArgs args)
            {
                var item = (CustomTreeViewItem)args.item;

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

                    string value = "";
                    switch (args.GetColumn(i))
                    {
                    case 0:
                        value = item.index.ToString();
                        break;

                    case 1:
                        value = item.displayName;
                        break;
                    }

                    DefaultGUI.Label(cellRect, value, args.selected, args.focused);
                    //if (i == 0)
                    //    DefaultGUI.Label(cellRect, value, args.selected, args.focused);
                    //else
                    //    DefaultGUI.LabelRightAligned(cellRect, value, args.selected, args.focused);
                }
            }
Example #7
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var   item = (TreeViewItem <MyTreeElement>)args.item;
            Event evt  = Event.current;

            //Debug.Log(" button event " + evt.button + " item: " + item + " " + item.displayName);

            if (evt.button != 0 && evt.type == EventType.MouseDown)
            {
                if (item.data.m_Canvas != null)
                {
                    if (args.rowRect.Contains(evt.mousePosition))
                    {
                        //EditorUtility.DisplayPopupMenu(new Rect(evt.mousePosition.x, evt.mousePosition.y, 0, 0), "Assets/", null);
                        GenericMenu menu = new GenericMenu();

                        // forward slashes nest menu items under submenus
                        AddMenuItemForColor(menu, "Load To Canvas " + item.displayName, item);
                        // display the menu
                        menu.ShowAsContext();
                        evt.Use();
                    }
                }
            }

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
            }
        }
        protected override void RowGUI(RowGUIArgs args)
        {
            if (ComponentMap.TryGetValue(args.item.id, out EntityComponent entityComponent))
            {
                for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
                {
                    Rect cellRect = args.GetCellRect(i);
                    args.rowRect = cellRect;
                    switch (i)
                    {
                    case 0:
                        base.RowGUI(args);
                        break;

                    case 1:
                        GUI.Label(cellRect, entityComponent.GetExtraInfo());
                        break;
                    }
                }
            }
            else
            {
                base.RowGUI(args);
            }
        }
Example #9
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (PreviewItem)args.item;

            if (Event.current.type == EventType.MouseDown && args.rowRect.Contains(Event.current.mousePosition))
            {
                SelectionClick(args.item, false);
            }

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                var rect = args.GetCellRect(i);
                CenterRectUsingSingleLineHeight(ref rect);
                //Debug.Log(rect);
                var clums = args.GetColumn(i);
                if (clums == 0)
                {
                    GUI.Label(rect, args.row.ToString());
                }
                else if (clums == 1)
                {
                    Rect toggleRect = rect;
                    toggleRect.x    += GetContentIndent(item);
                    toggleRect.width = kToggleWidth;

                    var texture = AnalysisUtility.GetPreviewIcon(item, rule);
                    GUI.DrawTexture(toggleRect, texture);

                    args.rowRect = rect;
                    base.RowGUI(args);
                }
            }
        }
Example #10
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var uniReduxTreeModel = args.item as UniReduxTreeModel;

            if (uniReduxTreeModel == null)
            {
                base.RowGUI(args);
                return;
            }

            var backgroundColor = GUI.backgroundColor;

            switch (uniReduxTreeModel.Element.ObjectType)
            {
            case ObjectType.Array:
                backgroundColor = Color.blue;
                break;

            case ObjectType.Object:
                backgroundColor = Color.yellow;
                break;

            default:
                break;
            }
            using (new BackgroundColorScope(backgroundColor))
            {
                for (var index = 0; index < args.GetNumVisibleColumns(); index++)
                {
                    CellGUI(args.GetCellRect(index), uniReduxTreeModel, (ColumnIndex)args.GetColumn(index), ref args);
                }
            }
        }
Example #11
0
        static void IncomingChangeTreeViewItemGUI(
            string wkPath,
            UnityIncomingChangesTree incomingChangesTree,
            IncomingChangesTreeView treeView,
            ChangeTreeViewItem item,
            RowGUIArgs args,
            bool isCurrentConflict,
            bool isSolvedConflict)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                IncomingChangesTreeColumn column =
                    (IncomingChangesTreeColumn)args.GetColumn(visibleColumnIdx);

                IncomingChangeTreeViewItemCellGUI(
                    wkPath,
                    cellRect,
                    treeView.rowHeight,
                    incomingChangesTree,
                    treeView,
                    item,
                    column,
                    args.selected,
                    args.focused,
                    isCurrentConflict,
                    isSolvedConflict);
            }
        }
Example #12
0
        static void UpdateReportListViewItemGUI(
            string wkPath,
            UpdateReportLineListViewItem item,
            RowGUIArgs args,
            float rowHeight,
            int totalLinesCount,
            Action onCheckedReportLineChanged,
            HashSet <UpdateReportLineListViewItem> checkedLines)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                ErrorsListColumn column =
                    (ErrorsListColumn)args.GetColumn(visibleColumnIdx);

                UpdateReportListViewItemCellGUI(
                    cellRect,
                    wkPath,
                    item,
                    column,
                    rowHeight,
                    args.selected,
                    args.focused,
                    totalLinesCount,
                    onCheckedReportLineChanged,
                    checkedLines);
            }
        }
Example #13
0
 protected override void RowGUI(RowGUIArgs args)
 {
     for (int i = 0; i < args.GetNumVisibleColumns(); i++)
     {
         CellGUI(args.GetCellRect(i), args.item as EditorTableItem, args.GetColumn(i), ref args);
     }
 }
Example #14
0
 protected override void RowGUI(RowGUIArgs args)
 {
     for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
     {
         CellGUI(args.GetCellRect(i), args.item as AssetBundleModel.AssetTreeItem, args.GetColumn(i), ref args);
     }
 }
Example #15
0
 protected override void RowGUI(RowGUIArgs args)
 {
     for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
     {
         CellGUI(args.GetCellRect(i), args.item, args.GetColumn(i));
     }
 }
        protected override void RowGUI(RowGUIArgs args)
        {
            if (m_LabelStyle == null)
            {
                m_LabelStyle = new GUIStyle("PR Label");
                if (m_LabelStyle == null)
                    m_LabelStyle = UnityEngine.GUI.skin.GetStyle("Label");
            }

            var item = args.item as AssetEntryTreeViewItem;
            if (item == null)
            {
                base.RowGUI(args);
            }
            else if (item.group != null)
            {
                if (item.isRenaming && !args.isRenaming)
                    item.isRenaming = false;
                using (new EditorGUI.DisabledScope(item.group.ReadOnly))
                {
                    base.RowGUI(args);
                }
            }
            else if (item.entry != null && !args.isRenaming)
            {
                using (new EditorGUI.DisabledScope(item.entry.ReadOnly))
                {
                    for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
                    {
                        CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
                    }
                }
            }
        }
Example #17
0
        static void ChangeTreeViewItemGUI(
            string wkPath,
            PendingChangesTreeView treeView,
            UnityPendingChangesTree pendingChangesTree,
            ChangeTreeViewItem item,
            RowGUIArgs args)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                PendingChangesTreeColumn column =
                    (PendingChangesTreeColumn)args.GetColumn(visibleColumnIdx);

                ChangeTreeViewItemCellGUI(
                    cellRect,
                    treeView.rowHeight,
                    treeView,
                    pendingChangesTree,
                    item,
                    column,
                    args.selected,
                    args.focused);
            }
        }
Example #18
0
        static void ChangesetsListViewItemGUI(
            ViewQueryResult queryResult,
            float rowHeight,
            ChangesetListViewItem item,
            RowGUIArgs args,
            bool isBoldText,
            Action avatarLoadedAction)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                if (visibleColumnIdx == 0)
                {
                    cellRect.x     += UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT;
                    cellRect.width -= UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT;
                }

                ChangesetsListColumn column =
                    (ChangesetsListColumn)args.GetColumn(visibleColumnIdx);

                ChangesetsListViewItemCellGUI(
                    cellRect,
                    rowHeight,
                    queryResult,
                    item,
                    column,
                    avatarLoadedAction,
                    args.selected,
                    args.focused,
                    isBoldText);
            }
        }
Example #19
0
 protected override void RowGUI(RowGUIArgs args)
 {
     for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
     {
         CellGUI(args.GetCellRect(i), args.item as ResAssetsTreeEitor.AssetTreeViewItem, args.GetColumn(i), ref args);
     }
 }
Example #20
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var items = (DebuggerItem)args.item;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = (DebuggerColumnIndex)args.GetColumn(visibleColumnIndex);

                var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.MiddleLeft;
                switch (columnIndex)
                {
                case DebuggerColumnIndex.SortId:
                    EditorGUI.SelectableLabel(rect, args.item.id.ToString(), labelStyle);
                    break;

                case DebuggerColumnIndex.Message:
                    EditorGUI.SelectableLabel(rect, items.element.Message, labelStyle);
                    break;

                case DebuggerColumnIndex.Type:
                    EditorGUI.SelectableLabel(rect, items.element.Type.ToString(), labelStyle);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
 protected override void RowGUI(RowGUIArgs args)
 {
     for (var i = 0; i < args.GetNumVisibleColumns(); ++i)
     {
         CellGui(ref args, i);
     }
 }
Example #22
0
        protected override void RowGUI(RowGUIArgs args)
        {
            ConformObjectTreeViewItem item = args.item as ConformObjectTreeViewItem;

            if (item == null)
            {
                Debug.LogWarning("Unknown TreeViewItem for conform tree");
                return;
            }

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                if (i == 0)
                {
                    ConformsGUI(args.GetCellRect(i), item);
                }
                else if (i == 1)
                {
                    PropertyNameGUI(args.GetCellRect(i), item, ref args);
                }
                else if (i == 2 && item.conformObject != null)
                {
                    ExpectedValueGUI(args.GetCellRect(i), item);
                }
                else if (i == 3 && item.conformObject != null)
                {
                    ActualValueGUI(args.GetCellRect(i), item);
                }
            }
        }
Example #23
0
        static void HistoryListViewItemGUI(
            string wkPath,
            RepositorySpec repSpec,
            float rowHeight,
            HistoryListViewItem item,
            RowGUIArgs args,
            bool isBoldText,
            Action avatarLoadedAction)
        {
            for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
            {
                Rect cellRect = args.GetCellRect(visibleColumnIdx);

                HistoryListColumn column =
                    (HistoryListColumn)args.GetColumn(visibleColumnIdx);

                HistoryListViewItemCellGUI(
                    cellRect,
                    rowHeight,
                    wkPath,
                    repSpec,
                    item,
                    column,
                    avatarLoadedAction,
                    args.selected,
                    args.focused,
                    isBoldText);
            }
        }
Example #24
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var items = (PeerInfoItem)args.item;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = (ColumnIndex)args.GetColumn(visibleColumnIndex);

                var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.MiddleLeft;
                switch (columnIndex)
                {
                case ColumnIndex.SortId:
                    EditorGUI.LabelField(rect, args.item.id.ToString(), labelStyle);
                    break;

                case ColumnIndex.PeerId:
                    EditorGUI.LabelField(rect, items.element.ID, labelStyle);
                    break;

                case ColumnIndex.IPEndPoint:
                    if (items.element.IPEndPoint != null)
                    {
                        EditorGUI.LabelField(rect, items.element.IPEndPoint.ToString(), labelStyle);
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
Example #25
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = args.item as UniTaskTrackerViewItem;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = args.GetColumn(visibleColumnIndex);

                var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.MiddleLeft;
                switch (columnIndex)
                {
                case 0:
                    EditorGUI.LabelField(rect, item.TaskType, labelStyle);
                    break;

                case 1:
                    EditorGUI.LabelField(rect, item.Elapsed, labelStyle);
                    break;

                case 2:
                    EditorGUI.LabelField(rect, item.Status, labelStyle);
                    break;

                case 3:
                    EditorGUI.LabelField(rect, item.PositionFirstLine, labelStyle);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
Example #26
0
        protected override void RowGUI(RowGUIArgs args) // draw gui
        {
            if (m_LabelStyle == null)
            {
                m_LabelStyle = new GUIStyle(EditorStyles.label);
            }

            var item = args.item as UrlTreeViewItem;

            for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++)
            {
                var rect        = args.GetCellRect(visibleColumnIndex);
                var columnIndex = args.GetColumn(visibleColumnIndex);

                var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label;
                labelStyle.alignment = TextAnchor.UpperLeft;

                var textFieldStyle = EditorStyles.textField;

                bool isEdit = m_EditTarget != null && m_EditData != null && item.id == m_EditTarget.id;
                switch (columnIndex)
                {
                case 0:
                    if (isEdit)
                    {
                        rect.x          += 2;
                        rect.width      -= 4;
                        rect.y          += 1;
                        rect.height     -= 2;
                        m_EditData.Title = EditorGUI.TextField(rect, m_EditData.Title, textFieldStyle);
                    }
                    else
                    {
                        rect.x += 4;
                        EditorGUI.LabelField(rect, item.Data.Title, labelStyle);
                    }
                    break;

                case 1:
                    if (isEdit)
                    {
                        rect.x        += 2;
                        rect.width    -= 4;
                        rect.y        += 1;
                        rect.height   -= 2;
                        m_EditData.URL = EditorGUI.TextField(rect, m_EditData.URL, textFieldStyle);
                    }
                    else
                    {
                        EditorGUI.LabelField(rect, item.Data.URL, labelStyle);
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null);
                }
            }
        }
        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);
            }
        }
Example #28
0
        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (AssetTreeItem)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (ColumnEnum)args.GetColumn(i), ref args);
            }
        }
Example #29
0
//		int GetIcon1Index(TreeViewItem<MyTreeElement> item)
//		{
//			return (int)(Mathf.Min(0.99f, item.data.floatValue1) * s_TestIcons.Length);
//		}
//
//		int GetIcon2Index (TreeViewItem<MyTreeElement> item)
//		{
//			return Mathf.Min(item.data.text.Length, s_TestIcons.Length-1);
//		}

        protected override void RowGUI(RowGUIArgs args)
        {
            var item = (TreeViewItem <MerinoTreeElement>)args.item;

            for (int i = 0; i < args.GetNumVisibleColumns(); ++i)
            {
                CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args);
            }
        }
Example #30
0
        protected override void RowGUI(RowGUIArgs args)
        {
            TreeViewItem <FolderElement> item = (TreeViewItem <FolderElement>)args.item;

            for (int i = 0, columns = args.GetNumVisibleColumns(); i < columns; i++)
            {
                drawItemGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
            }
        }