/// <summary> /// Raises the MouseEnter event /// </summary> /// <param name="e">A CellMouseEventArgs that contains the event data</param> public virtual void OnMouseEnter(I3CellMouseEventArgs e) { this.Bounds = e.CellRect; if (e.Cell == null) { this.Padding = I3CellPadding.Empty; } else { this.Padding = e.Cell.Padding; } bool tooltipActive = e.Table.ToolTip.Active; if (tooltipActive) { e.Table.ToolTip.Active = false; } e.Table.ResetMouseEventArgs(); e.Table.ToolTip.SetToolTip(e.Table, e.Cell.ToolTipText); if (tooltipActive) { e.Table.ToolTip.Active = true; } }
/// <summary> /// Initializes a new instance of the CellRenderer class with default settings /// </summary> protected I3CellRenderer() : base() { //this.format = ""; this.grayTextBrush = new SolidBrush(SystemColors.GrayText); this.padding = I3CellPadding.Empty; }
/// <summary> /// Raises the MouseMove event /// </summary> /// <param name="e">A CellMouseEventArgs that contains the event data</param> public virtual void OnMouseMove(I3CellMouseEventArgs e) { this.Bounds = e.CellRect; if (e.Cell == null) { this.Padding = I3CellPadding.Empty; } else { this.Padding = e.Cell.Padding; } }
/// <summary> /// Raises the LostFocus event /// </summary> /// <param name="e">A CellFocusEventArgs that contains the event data</param> public virtual void OnLostFocus(I3CellFocusEventArgs e) { this.Bounds = e.CellRect; if (e.Cell == null) { this.Padding = I3CellPadding.Empty; } else { this.Padding = e.Cell.Padding; } e.Table.Invalidate(e.CellRect); }
/// <summary> /// Raises the DoubleClick event /// </summary> /// <param name="e">A CellMouseEventArgs that contains the event data</param> public virtual void OnDoubleClick(I3CellMouseEventArgs e) { this.Bounds = e.CellRect; if (e.Cell == null) { this.Padding = I3CellPadding.Empty; } else { this.Padding = e.Cell.Padding; } if ((e.Table.EditStartAction == I3EditStartAction.DoubleClick || e.Table.EditStartAction == I3EditStartAction.DoubleClick_DataInputKey || e.Table.EditStartAction == I3EditStartAction.DoubleClick_DataInputKey) && e.Table.IsCellEditable(e.CellPos)) { e.Table.EditCell(e.CellPos); } }
/// <summary> /// Raises the MouseDown event /// </summary> /// <param name="e">A CellMouseEventArgs that contains the event data</param> public virtual void OnMouseDown(I3CellMouseEventArgs e) { if (!e.Table.Focused) { if (!(e.Table.IsEditing && e.Table.EditingCell == e.CellPos && e.Table.EditingCellEditor is II3EditorUsesRendererButtons)) { e.Table.Focus(); } } this.Bounds = e.CellRect; if (e.Cell == null) { this.Padding = I3CellPadding.Empty; } else { this.Padding = e.Cell.Padding; } }
/// <summary> /// Raises the PaintCell event /// </summary> /// <param name="e">A PaintCellEventArgs that contains the event data</param> public virtual void OnPaintCell(I3PaintCellEventArgs e) { this.Bounds = e.CellRect; if (e.Cell != null) { this.Padding = e.Cell.Padding; this.Alignment = e.Table.ColumnModel.Columns[e.Column].CellAlignment; this.AutoWarp = e.Table.ColumnModel.Columns[e.Column].CellTextAutoWarp; this.LineAlignment = e.Table.TableModel.Rows[e.Row].Alignment; //this.Format = e.Table.ColumnModel.Columns[e.Column].Format; this.Font = e.Cell.Font; } else { this.Padding = I3CellPadding.Empty; this.Alignment = I3ColumnAlignment.Left; this.LineAlignment = I3RowAlignment.Center; //this.Format = ""; this.Font = null; } // if the font is null, use the default font if (this.Font == null) { this.Font = Control.DefaultFont; } // paint the Cells background this.OnPaintBackground(e); // paint the Cells foreground this.OnPaint(e); }