Ejemplo n.º 1
0
        /// <summary>
        /// Raises the MouseMove event
        /// </summary>
        /// <param name="e">A CellMouseEventArgs that contains the event data</param>
        public override void OnMouseMove(IE310.Table.Events.I3CellMouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (this.ShowDropDownButton || (e.Table.IsEditing && e.CellPos == e.Table.EditingCell))
            {
                if (e.Table.IsCellEditable(e.CellPos))
                {
                    // get the button renderer data
                    I3DropDownRendererData rendererData = this.GetDropDownRendererData(e.Cell);

                    if (this.CalcDropDownButtonBounds().Contains(e.X, e.Y))
                    {
                        if (rendererData.ButtonState == I3ComboBoxStates.Normal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                rendererData.ButtonState = I3ComboBoxStates.Pressed;
                            }
                            else
                            {
                                rendererData.ButtonState = I3ComboBoxStates.Hot;
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                    else
                    {
                        if (rendererData.ButtonState != I3ComboBoxStates.Normal)
                        {
                            rendererData.ButtonState = I3ComboBoxStates.Normal;

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the MouseMove event
        /// </summary>
        /// <param name="e">A CellMouseEventArgs that contains the event data</param>
        public override void OnMouseMove(IE310.Table.Events.I3CellMouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (this.ShowUpDownButtons || this.TableUsingNumericCellEditor(e.Table, e.CellPos))
            {
                if (e.Table.IsCellEditable(e.CellPos))
                {
                    // get the button renderer data
                    I3NumberRendererData rendererData = this.GetNumberRendererData(e.Cell);

                    if (this.GetUpButtonBounds().Contains(e.X, e.Y))
                    {
                        if (rendererData.UpButtonState == I3UpDownStates.Normal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                if (this.GetUpButtonBounds().Contains(rendererData.ClickPoint))
                                {
                                    rendererData.UpButtonState = I3UpDownStates.Pressed;

                                    if (this.TableUsingNumericCellEditor(e.Table, e.CellPos))
                                    {
                                        ((II3EditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseDown(this, e);
                                    }
                                }
                                else if (this.GetDownButtonBounds().Contains(rendererData.ClickPoint))
                                {
                                    rendererData.DownButtonState = I3UpDownStates.Normal;

                                    if (this.TableUsingNumericCellEditor(e.Table, e.CellPos))
                                    {
                                        ((II3EditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseUp(this, e);
                                    }
                                }
                            }
                            else
                            {
                                rendererData.UpButtonState = I3UpDownStates.Hot;

                                if (rendererData.DownButtonState == I3UpDownStates.Hot)
                                {
                                    rendererData.DownButtonState = I3UpDownStates.Normal;
                                }
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                    else if (this.GetDownButtonBounds().Contains(e.X, e.Y))
                    {
                        if (rendererData.DownButtonState == I3UpDownStates.Normal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                if (this.GetDownButtonBounds().Contains(rendererData.ClickPoint))
                                {
                                    rendererData.DownButtonState = I3UpDownStates.Pressed;

                                    if (this.TableUsingNumericCellEditor(e.Table, e.CellPos))
                                    {
                                        ((II3EditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseDown(this, e);
                                    }
                                }
                                else if (this.GetUpButtonBounds().Contains(rendererData.ClickPoint))
                                {
                                    rendererData.UpButtonState = I3UpDownStates.Normal;

                                    if (this.TableUsingNumericCellEditor(e.Table, e.CellPos))
                                    {
                                        ((II3EditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseUp(this, e);
                                    }
                                }
                            }
                            else
                            {
                                rendererData.DownButtonState = I3UpDownStates.Hot;

                                if (rendererData.UpButtonState == I3UpDownStates.Hot)
                                {
                                    rendererData.UpButtonState = I3UpDownStates.Normal;
                                }
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                    else
                    {
                        if (rendererData.UpButtonState != I3UpDownStates.Normal || rendererData.DownButtonState != I3UpDownStates.Normal)
                        {
                            rendererData.UpButtonState   = I3UpDownStates.Normal;
                            rendererData.DownButtonState = I3UpDownStates.Normal;

                            if (this.TableUsingNumericCellEditor(e.Table, e.CellPos))
                            {
                                ((II3EditorUsesRendererButtons)e.Table.EditingCellEditor).OnEditorButtonMouseUp(this, e);
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Raises the MouseMove event
        /// </summary>
        /// <param name="e">A CellMouseEventArgs that contains the event data</param>
        public override void OnMouseMove(IE310.Table.Events.I3CellMouseEventArgs e)
        {
            base.OnMouseMove(e);

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

                if (this.CalcCheckBoxDisplayRect(e.Table.TableModel.Rows[e.Row].Alignment, e.Table.ColumnModel.Columns[e.Column].CellAlignment, e.Table.ColumnModel.Columns[e.Column] as I3CheckBoxColumn).Contains(e.X, e.Y))
                {
                    if (e.Cell.CheckState == CheckState.Checked)
                    {
                        if (rendererData.CheckState == I3CheckBoxStates.CheckedNormal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                rendererData.CheckState = I3CheckBoxStates.CheckedPressed;
                            }
                            else
                            {
                                rendererData.CheckState = I3CheckBoxStates.CheckedHot;
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                    else if (e.Cell.CheckState == CheckState.Indeterminate)
                    {
                        if (rendererData.CheckState == I3CheckBoxStates.MixedNormal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                rendererData.CheckState = I3CheckBoxStates.MixedPressed;
                            }
                            else
                            {
                                rendererData.CheckState = I3CheckBoxStates.MixedHot;
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                    else                     //if (e.Cell.CheckState == CheckState.Unchecked)
                    {
                        if (rendererData.CheckState == I3CheckBoxStates.UncheckedNormal)
                        {
                            if (e.Button == MouseButtons.Left && e.Row == e.Table.LastMouseDownCell.Row && e.Column == e.Table.LastMouseDownCell.Column)
                            {
                                rendererData.CheckState = I3CheckBoxStates.UncheckedPressed;
                            }
                            else
                            {
                                rendererData.CheckState = I3CheckBoxStates.UncheckedHot;
                            }

                            e.Table.Invalidate(e.CellRect);
                        }
                    }
                }
                else
                {
                    if (e.Cell.CheckState == CheckState.Checked)
                    {
                        rendererData.CheckState = I3CheckBoxStates.CheckedNormal;
                    }
                    else if (e.Cell.CheckState == CheckState.Indeterminate)
                    {
                        rendererData.CheckState = I3CheckBoxStates.MixedNormal;
                    }
                    else                     //if (e.Cell.CheckState == CheckState.Unchecked)
                    {
                        rendererData.CheckState = I3CheckBoxStates.UncheckedNormal;
                    }

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