protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (level1ColWidths == null) { level1ColWidths = level1Widths(); } Point rowRelativePoint; CustomListRow row = getRowFromPoint(e.Location, out rowRelativePoint); if (row != null && row == currentRow) { currentRow.OnMouseMove(rowRelativePoint); return; } if (currentRow != null) { currentRow.OnMouseLeave(); } currentRow = row; if (currentRow != null) { currentRow.OnMouseEnter(rowRelativePoint); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (currentRow != null) { currentRow.OnMouseLeave(); currentRow = null; } }
public virtual void OnMouseMove(Point point) { System.Diagnostics.Trace.Assert(currentItem == null || currentRow == null); if (point.Y > RowHeight + Padding.Vertical) { if (currentItem != null) { currentItem.OnMouseLeave(); currentItem = null; } Point rowRelativePoint; CustomListRow row = SelectChild(point, out rowRelativePoint); if (row != null && currentRow == row) { currentRow.OnMouseMove(rowRelativePoint); return; } if (currentRow != null) { currentRow.OnMouseLeave(); } currentRow = row; if (currentRow != null) { currentRow.OnMouseEnter(rowRelativePoint); } } else { if (currentRow != null) { currentRow.OnMouseLeave(); currentRow = null; } Point itemRelativePoint; CustomListItem item = GetItemFromPosition(point, out itemRelativePoint); if (item != null && currentItem == item) { currentItem.OnMouseMove(itemRelativePoint); return; } if (currentItem != null) { currentItem.OnMouseLeave(); } currentItem = item; if (currentItem != null) { currentItem.OnMouseEnter(itemRelativePoint); } } }