Provides data for the CellGotFocus and CellLostFocus events of a Table
Inheritance: CellEventArgsBase
Esempio n. 1
0
        /// <summary>
        /// Raises the GotFocus event
        /// </summary>
        /// <param name="e">A CellFocusEventArgs that contains the event data</param>
        public override void OnGotFocus(CellFocusEventArgs e)
        {
            base.OnGotFocus(e);

            // get the table to redraw the cell
            e.Table.Invalidate(e.CellRect);
        }
Esempio n. 2
0
        /// <summary>
        /// Raises the CellLostFocus event
        /// </summary>
        /// <param name="e">A CellFocusEventArgs that contains the event data</param>
        protected virtual void OnCellLostFocus(CellFocusEventArgs e)
        {
            if (this.CanRaiseEvents)
            {
                ICellRenderer renderer = this.ColumnModel.GetCellRenderer(e.Column);

                if (renderer != null)
                {
                    renderer.OnLostFocus(e);
                }

                if (CellLostFocus != null)
                {
                    CellLostFocus(this, e);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Raises the LostFocus event for the Cell at the specified position
        /// </summary>
        /// <param name="cellPos">The position of the Cell that lost focus</param>
        protected void RaiseCellLostFocus(CellPos cellPos)
        {
            if (!this.IsValidCell(cellPos))
            {
                return;
            }

            ICellRenderer renderer = this.ColumnModel.GetCellRenderer(cellPos.Column);

            if (renderer != null)
            {
                Cell cell = null;

                if (cellPos.Column < this.TableModel.Rows[cellPos.Row].Cells.Count)
                {
                    cell = this.TableModel[cellPos.Row, cellPos.Column];
                }

                CellFocusEventArgs cfea = new CellFocusEventArgs(cell, this, cellPos.Row, cellPos.Column, this.CellRect(cellPos.Row, cellPos.Column));

                this.OnCellLostFocus(cfea);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Raises the LostFocus event
        /// </summary>
        /// <param name="e">A CellFocusEventArgs that contains the event data</param>
        public virtual void OnLostFocus(CellFocusEventArgs e)
        {
            this.Bounds = e.CellRect;

            if (e.Cell == null)
            {
                this.Padding = CellPadding.Empty;
            }
            else
            {
                this.Padding = e.Cell.Padding;
            }

            e.Table.Invalidate(e.CellRect);
        }