internal void RenameCell(int rowIndex, Rect rowRect) { Event current = Event.current; var rows = m_Window.ProfileTreeView.GetRows(); for (int i = 0; i < this.state.visibleColumns.Length; ++i) { Rect cellRect = GetCellRect(i, rowRect); if (cellRect.Contains(current.mousePosition)) { try { ProfileTreeViewItem item = rows[rowIndex] as ProfileTreeViewItem; if (item.displayName == "Default" && i == 0) { return; // Can't rename default profile } cellRect.y -= cellRect.height; PopupWindow.Show(cellRect, new ProfileRenamePopUp(m_Window, cellRect.width, i, item.BuildProfile.id)); } catch (ExitGUIException) { // Exception not being caught through OnGUI call } } } }
void CellGUI(Rect cellRect, ProfileTreeViewItem viewItem, int columnIndex, ref RowGUIArgs args) { if (m_LabelStyle == null) { m_LabelStyle = UnityEngine.GUI.skin.GetStyle("Label"); } if (columnIndex == 0) { if (Event.current.type == EventType.Repaint) { m_LabelStyle.Draw(cellRect, viewItem.BuildProfile.profileName, false, false, args.selected, args.focused); } } else { viewItem.BuildProfile.values[(int)columnIndex - 1].value = EditorGUI.TextField(cellRect, viewItem.BuildProfile.values[(int)columnIndex - 1].value); } }