예제 #1
0
        /// <summary>
        /// get the data cell of a row
        /// </summary>
        /// <param name="AGridRow"></param>
        /// <returns></returns>
        public override SourceGrid.Cells.ICellVirtual GetDataCell(int AGridRow)
        {
            int Reminder;

            System.Drawing.Image TheImage;
            FDataCellSelected = new SourceGrid.Cells.Virtual.CellVirtual();

            // Create Icon
            TheImage = FGetImage(AGridRow - 1);
            FDataCellSelected.Model.AddModel(new SourceGrid.Cells.Models.Image(TheImage));
            ((ViewBase)FDataCellSelected.View).ImageAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;

            // Automatic calculation of column width
            Width = TheImage.Width + IMAGECOLUMN_HORIZONTAL_PADDING;

            // Create a ToolTip
            FDataCellSelected.AddController(SourceGrid.Cells.Controllers.ToolTipText.Default);
            FDataCellSelected.Model.AddModel(TToolTipModel.myDefault);

            // Alternating BackColor (banding effect)
            Math.DivRem(AGridRow, 2, out Reminder);

            if (Reminder != 0)
            {
                if (((TSgrdDataGrid)FGrid).AlternatingBackgroundColour != Color.Empty)
                {
                    FDataCellSelected.View           = (SourceGrid.Cells.Views.IView)FDataCellSelected.View.Clone();
                    FDataCellSelected.View.BackColor = ((TSgrdDataGrid)FGrid).AlternatingBackgroundColour;
                }
            }

            return(FDataCellSelected);
        }
예제 #2
0
        /// <summary>
        /// ќтобразить данные
        /// </summary>
        protected virtual void Bind()
        {
            ValueCell = null;
            if (_dataSource == null)
            {
                return;
            }

            AcceptsInputChar = false;
            //Location = new System.Drawing.Point(0, 0);gg
            ClipboardMode = SourceGrid.ClipboardMode.Copy;
            Dock          = System.Windows.Forms.DockStyle.Fill;
            Name          = _dataSource.Address.ConstName;
            TabStop       = true;
            SelectionMode = SourceGrid.GridSelectionMode.Cell;

            FixedColumns = _dataSource.Address.YMapConstName == "" ? 1 : 2;
            FixedRows    = _dataSource.Address.XMapConstName == "" ? 1 : 2;

            Columns.AddColumns();

            ToolTipText = _dataSource.Address.Comment;

            _valueCell = new SourceGrid.Cells.Virtual.CellVirtual();
            _valueCell.Model.AddModel(new FRomValueModel());
            _valueCell.Editor = SourceGrid.Cells.Editors.Factory.Create(typeof(uint));

            Rows.RowsChanged();
            Columns.ColumnsChanged();

            Rows.AutoSize(true);
            Columns.AutoSize(true);

            RecalcColor();              //ѕересчет переменных дл¤ задани¤ цвета
        }
예제 #3
0
            public MyDataGridColumnStar(SourceGrid.DataGrid grid, string caption) : base(grid, null, caption, null)
            {
                HeaderCell = new SourceGrid.DataGridColumnHeader(caption);
                DataColumn = null;
                DataCell   = null;

                dataCellSelected = new SourceGrid.Cells.Virtual.CellVirtual();
                dataCellSelected.Model.AddModel(new SourceGrid.Cells.Models.Image(Properties.Resources.Star.ToBitmap()));
                dataCellSelected_OFF = new SourceGrid.Cells.Virtual.CellVirtual();
                dataCellSelected_OFF.Model.AddModel(new SourceGrid.Cells.Models.Image(Properties.Resources.StarOff));
            }
예제 #4
0
        protected virtual void Bind()
        {
            ValueCell = null;
            if (mDataSource != null)
            {
                mValueCell = new SourceGrid.Cells.Virtual.CellVirtual();
                mValueCell.Model.AddModel(new ArrayValueModel());
                mValueCell.Editor = Cells.Editors.Factory.Create(mDataSource.GetType().GetElementType());
            }

            Rows.RowsChanged();
            Columns.ColumnsChanged();
        }
예제 #5
0
		protected virtual void Bind()
		{
			ValueCell = null;
			if (mDataSource != null)
			{
				mValueCell = new SourceGrid.Cells.Virtual.CellVirtual();
				mValueCell.Model.AddModel(new ArrayValueModel());
                mValueCell.Editor = Cells.Editors.Factory.Create(mDataSource.GetType().GetElementType());
			}

			Rows.RowsChanged();
			Columns.ColumnsChanged();
		}
예제 #6
0
        /// <summary>
        /// ќтобразить данные
        /// </summary>
        protected virtual void Bind()
        {
            ValueCell = null;
            if (_dataSource != null)
            {
                Init();
                _valueCell = new SourceGrid.Cells.Virtual.CellVirtual();
                _valueCell.Model.AddModel(new FRomValueModel());
                _valueCell.Editor = SourceGrid.Cells.Editors.Factory.Create(typeof(uint));
            }
            Rows.RowsChanged();
            Columns.ColumnsChanged();

            RecalcColor();              //ѕересчет переменных дл¤ задани¤ цвета
        }
예제 #7
0
        /// <summary>
        /// get the data cell of a row
        /// </summary>
        /// <param name="AGridRow"></param>
        /// <returns></returns>
        public override SourceGrid.Cells.ICellVirtual GetDataCell(int AGridRow)
        {
            int Reminder;

            System.Drawing.Image TheImage;
            FDataCellSelected = new SourceGrid.Cells.Virtual.CellVirtual();

            // Create Icon
            TheImage = FGetImage(AGridRow - 1);
            FDataCellSelected.Model.AddModel(new SourceGrid.Cells.Models.Image(TheImage));
            ((ViewBase)FDataCellSelected.View).ImageAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;

            // Automatic calculation of column width
            Width = TheImage.Width + IMAGECOLUMN_HORIZONTAL_PADDING;

            // Create a ToolTip
            FDataCellSelected.AddController(SourceGrid.Cells.Controllers.ToolTipText.Default);
            FDataCellSelected.Model.AddModel(TToolTipModel.myDefault);

            // Alternating BackColor (banding effect)
            Math.DivRem(AGridRow, 2, out Reminder);

            if (Reminder != 0)
            {
                if (((TSgrdDataGrid)FGrid).AlternatingBackgroundColour != Color.Empty)
                {
                    FDataCellSelected.View = (SourceGrid.Cells.Views.IView)FDataCellSelected.View.Clone();
                    FDataCellSelected.View.BackColor = ((TSgrdDataGrid)FGrid).AlternatingBackgroundColour;
                }
            }

            return FDataCellSelected;
        }