protected override void OnMouseLeave(EventArgs e) { rowAtMousePosition = null; if (itemAtMousePosition != null) { OnLeaveItem(itemAtMousePosition); itemAtMousePosition = null; } base.OnMouseLeave(e); }
/// <summary> /// Gets the upper left corner of the specified row. /// </summary> public Point GetPositionFromRow(DynamicListRow row) { int y = -scrollOffset; foreach (DynamicListRow r in Rows) { if (r == row) { return(new Point(0, y)); } y += r.Height + lineMarginY; } throw new ArgumentException("The row in not in this list!"); }
public DynamicListItem GetItemFromPoint(Point position) { DynamicListRow row = GetRowFromPoint(position.Y); if (row == null) { return(null); } int columnIndex = GetColumnIndexFromPoint(position.X); if (columnIndex < 0) { return(null); } return(row[columnIndex]); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); DynamicListRow row = GetRowFromPoint(e.Y); if (rowAtMousePosition != row) { rowAtMousePosition = row; Invalidate(); } if (row == null) { return; } int columnIndex = GetColumnIndexFromPoint(e.X); if (columnIndex < 0) { return; } DynamicListItem item = row[columnIndex]; if (itemAtMousePosition != item) { if (itemAtMousePosition != null) { OnLeaveItem(itemAtMousePosition); } ResetMouseEventArgs(); // raise hover again itemAtMousePosition = item; if (item != null) { if (item.Cursor != null) { this.Cursor = item.Cursor; } item.OnMouseEnter(this); } } if (item != null) { item.OnMouseMove(new DynamicListMouseEventArgs(this, e)); } }
internal DynamicListItem(DynamicListRow row) { this.row = row; }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); DynamicListRow row = GetRowFromPoint(e.Y); if (rowAtMousePosition != row) { rowAtMousePosition = row; Invalidate(); } if (row == null) return; int columnIndex = GetColumnIndexFromPoint(e.X); if (columnIndex < 0) return; DynamicListItem item = row[columnIndex]; if (itemAtMousePosition != item) { if (itemAtMousePosition != null) { OnLeaveItem(itemAtMousePosition); } ResetMouseEventArgs(); // raise hover again itemAtMousePosition = item; if (item != null) { if (item.Cursor != null) this.Cursor = item.Cursor; item.OnMouseEnter(this); } } if (item != null) { item.OnMouseMove(new DynamicListMouseEventArgs(this, e)); } }
/// <summary> /// Gets the upper left corner of the specified row. /// </summary> public Point GetPositionFromRow(DynamicListRow row) { int y = -scrollOffset; foreach (DynamicListRow r in Rows) { if (r == row) return new Point(0, y); y += r.Height + lineMarginY; } throw new ArgumentException("The row in not in this list!"); }