protected virtual void ColumnHeaderGUI(MultiColumnHeaderState.Column column, Rect headerRect, int columnIndex)
 {
     if (this.canSort)
     {
         this.SortingButton(column, headerRect, columnIndex);
     }
     GUIStyle columnHeader = DefaultStyles.columnHeader;
     columnHeader.alignment = this.ConvertHeaderAlignmentToTextAnchor(column.headerTextAlignment);
     GUI.Label(headerRect, column.headerText, columnHeader);
 }
 protected virtual void ColumnHeaderClicked(MultiColumnHeaderState.Column column, int columnIndex)
 {
     if (this.state.sortedColumnIndex == columnIndex)
     {
         column.sortedAscending = !column.sortedAscending;
     }
     else
     {
         this.state.sortedColumnIndex = columnIndex;
     }
     this.OnSortingChanged();
 }
        public static bool CanOverwriteSerializedFields(MultiColumnHeaderState source, MultiColumnHeaderState destination)
        {
            if (source == null || destination == null)
            {
                return(false);
            }

            if (source.m_Columns == null || destination.m_Columns == null)
            {
                return(false);
            }

            return(source.m_Columns.Length == destination.m_Columns.Length);
        }
        public static void OverwriteSerializedFields(MultiColumnHeaderState source, MultiColumnHeaderState destination)
        {
            if (!CanOverwriteSerializedFields(source, destination))
            {
                Debug.LogError("MultiColumnHeaderState: Not able to overwrite serialized fields");
                return;
            }

            destination.m_VisibleColumns = source.m_VisibleColumns.ToArray();
            destination.m_SortedColumns  = new List <int>(source.m_SortedColumns);

            for (int i = 0; i < destination.m_Columns.Length; ++i)
            {
                destination.m_Columns[i].width           = source.m_Columns[i].width;
                destination.m_Columns[i].sortedAscending = source.m_Columns[i].sortedAscending;
            }
        }
Esempio n. 5
0
 public MultiColumnHeader(MultiColumnHeaderState state)
 {
     this.m_State = state;
 }
Esempio n. 6
0
 internal MultiColumnInfo(MultiColumnHeaderState multiColumnHeaderState, Rect[] cellRects)
 {
     this.multiColumnHeaderState = multiColumnHeaderState;
     this.cellRects = cellRects;
 }
 public MultiColumnHeader(MultiColumnHeaderState state)
 {
     this.m_State = state;
 }
Esempio n. 8
0
 public static bool CanOverwriteSerializedFields(MultiColumnHeaderState source, MultiColumnHeaderState destination)
 {
     return(source != null && destination != null && source.m_Columns != null && destination.m_Columns != null && source.m_Columns.Length == destination.m_Columns.Length);
 }
Esempio n. 9
0
 public MultiColumnHeader(MultiColumnHeaderState state)
 {
     m_State = state;
     m_HeaderButtonsControlID = GUIUtility.GetPermanentControlID();
 }