Exemplo n.º 1
0
        public void sortByColumn_descending(int _columnIndex)
        {
            Contract.Requires(_columnIndex >= 0 && _columnIndex < columnCount);

            PM_GridColumn _column = column(_columnIndex);

            if (_column != null)
            {
                switch (_column.type)
                {
                case PM_ColumnType.STRING:
                    Array.Sort(__rows, 0, rowCount, new RowCompareDesc_string(_columnIndex));
                    break;

                case PM_ColumnType.INT:
                    Array.Sort(__rows, 0, rowCount, new RowCompareDesc_int(_columnIndex));
                    break;

                case PM_ColumnType.DOUBLE:
                    Array.Sort(__rows, 0, rowCount, new RowCompareDesc_double(_columnIndex));
                    break;

                case PM_ColumnType.DATE:
                    Array.Sort(__rows, 0, rowCount, new RowCompareDesc_date(_columnIndex));
                    break;

                default:
                    break;
                }
            }
            else
            {
                throw new Exception("column(_columnIndex null.");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Pose un model de colonne à l'index _index.
        /// L'espace columnCount > _index doit avoir été réservé.
        /// </summary>
        public void setColumn(int _index, PM_ColumnType _type, double _width)
        {
            Contract.Requires(_index >= 0 && _index < columnCount);
            PM_GridColumn _column = new PM_GridColumn(_type, _width);

            setColumn(_index, _column);
        }
Exemplo n.º 3
0
        void applyProperties(cellInfo _cellInfo)
        {
            PM_GridColumn _column = __model.column(_cellInfo.colIndex);
            PM_GridRow    _row    = __model.row(_cellInfo.rowIndex);

            _cellInfo.cell.applyControl_value();

            if (_cellInfo.cell.type == PM_GridCellType.HORIZONTALHEADER)
            {
                applyHorizontalHeaderProperties(_cellInfo);
                return;
            }

            if (_cellInfo.cell.type == PM_GridCellType.VERTICALHEADER)
            {
                applyVerticalHeaderProperties(_cellInfo);
                return;
            }

            // readOnly
            if (_cellInfo.cell.readOnly != PM_state.UNSET)
            {
                _cellInfo.cell.applyIsReadOnly(_cellInfo.cell.readOnly);
            }
            else
            if (_row.readOnly != PM_state.UNSET)
            {
                _cellInfo.cell.applyIsReadOnly(_row.readOnly);
            }
            else
            if (_column.readOnly != PM_state.UNSET)
            {
                _cellInfo.cell.applyIsReadOnly(_column.readOnly);
            }
            else
            {
                _cellInfo.cell.applyIsReadOnly(__model.readOnly);
            }

            // style
            if (_cellInfo.cell.style != null)
            {
                _cellInfo.cell.applyStyle(_cellInfo.cell.style);
            }
            else
            if (_row.style != null)
            {
                _cellInfo.cell.applyStyle(_row.style);
            }
            else
            if (_column.style != null)
            {
                _cellInfo.cell.applyStyle(_column.style);
            }
            else
            {
                _cellInfo.cell.applyStyle(__model.style);
            }
        }
Exemplo n.º 4
0
        public void setColumnHeaderValue(int _columnIndex, object _value)
        {
            PM_GridColumn _column = __model.column(_columnIndex);

            if (_column.header == null)
            {
                _column.header = new PM_GridCellHHeader(this);
            }
            _column.header.value = _value;
        }
Exemplo n.º 5
0
        public void setColumnReadOnly(int _index, PM_state _readOnly)
        {
            PM_GridColumn _column = column(_index);

            if (_column == null)
            {
                return;
            }
            _column.readOnly = _readOnly;
        }
Exemplo n.º 6
0
        public void setColumnStyle(int _index, PM_GridCellStyle _style)
        {
            PM_GridColumn _column = column(_index);

            if (_column == null)
            {
                return;
            }
            _column.style = _style;
        }
Exemplo n.º 7
0
        public void setColumnVisibility(int _index, Visibility _visibility)
        {
            PM_GridColumn _column = column(_index);

            if (_column == null)
            {
                return;
            }
            _column.visibility = _visibility;
        }
Exemplo n.º 8
0
        bool showHScrollBar()
        {
            double _n = 0;
            double _w = this.ActualWidth;

            for (int _i = 0; _i < columnCount; _i++)
            {
                PM_GridColumn _column = __model.column(_i);
                if (_column != null)
                {
                    _n += __model.column(_i).width;
                    if (_n > _w)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Pose un model de colonne à l'index _index.
 /// L'espace columnCount > _index doit avoir été réservé.
 /// </summary>
 private void setColumn(int _index, PM_GridColumn _column)
 {
     __columns[_index] = _column;
 }