Exemplo n.º 1
0
        /// <summary>
        /// Raises the KeyDown event
        /// </summary>
        /// <param name="e">A CellKeyEventArgs that contains the event data</param>
        public override void OnKeyDown(I3CellKeyEventArgs e)
        {
            base.OnKeyDown(e);

            if (e.KeyData == Keys.Space && e.Table.IsCellEditable(e.CellPos))
            {
                // get the renderer data
                I3CheckBoxRendererData rendererData = this.GetCheckBoxRendererData(e.Cell);

                //
                if (e.Cell.CheckState == CheckState.Checked)
                {
                    rendererData.CheckState = I3CheckBoxStates.CheckedPressed;
                }
                else if (e.Cell.CheckState == CheckState.Indeterminate)
                {
                    rendererData.CheckState = I3CheckBoxStates.MixedPressed;
                }
                else                 //if (e.Cell.CheckState == CheckState.Unchecked)
                {
                    rendererData.CheckState = I3CheckBoxStates.UncheckedPressed;
                }

                e.Table.Invalidate(e.CellRect);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the KeyDown event
        /// </summary>
        /// <param name="e">A CellKeyEventArgs that contains the event data</param>
        public override void OnKeyDown(I3CellKeyEventArgs e)
        {
            base.OnKeyDown(e);

            // get the button renderer data
            I3ButtonRendererData rendererData = this.GetButtonRendererData(e.Cell);

            //
            if (e.KeyData == Keys.Enter || e.KeyData == Keys.Space)
            {
                rendererData.ButtonState = I3PushButtonStates.Pressed;

                e.Table.Invalidate(e.CellRect);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Raises the KeyUp event
        /// </summary>
        /// <param name="e">A CellKeyEventArgs that contains the event data</param>
        public override void OnKeyUp(I3CellKeyEventArgs e)
        {
            base.OnKeyUp(e);

            // get the button renderer data
            I3ButtonRendererData rendererData = this.GetButtonRendererData(e.Cell);

            //
            if (e.KeyData == Keys.Enter || e.KeyData == Keys.Space)
            {
                rendererData.ButtonState = I3PushButtonStates.Normal;

                e.Table.Invalidate(e.CellRect);
                I3Column column = e.Table.ColumnModel.Columns[e.Column];
                if (column.GetType() == typeof(I3ButtonColumn))
                {
                    I3ButtonColumn buttonColumn = (I3ButtonColumn)column;
                    buttonColumn.OnButtonClicked(new I3CellButtonEventArgs(e.Cell, e.Column, e.Row));
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Raises the KeyUp event
        /// </summary>
        /// <param name="e">A CellKeyEventArgs that contains the event data</param>
        public override void OnKeyUp(I3CellKeyEventArgs e)
        {
            base.OnKeyUp(e);

            if (e.KeyData == Keys.Space && e.Table.IsCellEditable(e.CellPos))
            {
                // get the renderer data
                I3CheckBoxRendererData rendererData = this.GetCheckBoxRendererData(e.Cell);

                //
                if (e.Cell.CheckState == CheckState.Checked)
                {
                    if (!e.Cell.ThreeState || !(e.Table.ColumnModel.Columns[e.Column] is I3CheckBoxColumn) ||
                        ((I3CheckBoxColumn)e.Table.ColumnModel.Columns[e.Column]).CheckBoxColumnStyle == I3CheckBoxColumnStyle.RadioButton)
                    {
                        rendererData.CheckState = I3CheckBoxStates.UncheckedNormal;
                        e.Cell.CheckState       = CheckState.Unchecked;
                    }
                    else
                    {
                        rendererData.CheckState = I3CheckBoxStates.MixedNormal;
                        e.Cell.CheckState       = CheckState.Indeterminate;
                    }
                }
                else if (e.Cell.CheckState == CheckState.Indeterminate)
                {
                    rendererData.CheckState = I3CheckBoxStates.UncheckedNormal;
                    e.Cell.CheckState       = CheckState.Unchecked;
                }
                else                 //if (e.Cell.CheckState == CheckState.Unchecked)
                {
                    rendererData.CheckState = I3CheckBoxStates.CheckedNormal;
                    e.Cell.CheckState       = CheckState.Checked;
                }

                e.Table.Invalidate(e.CellRect);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Raises the KeyUp event
 /// </summary>
 /// <param name="e">A CellKeyEventArgs that contains the event data</param>
 public virtual void OnKeyUp(I3CellKeyEventArgs e)
 {
 }