/// <summary> /// 处理鼠标单击时 <see cref="TreeListHitTestInfo"/> 的处理。 /// </summary> /// <param name="info"></param> /// <param name="eventType"></param> private void ProcessHitTestInfoClick(TreeListHitTestInfo info, TreeListHitTestEventType eventType) { if (info.Bounds.IsEmpty) { return; } if (eventType == TreeListHitTestEventType.MouseUp && info.HitTestType == TreeListHitTestType.Column) { ProcessColumnClick(info); } else if (eventType == TreeListHitTestEventType.MouseDown) { switch (info.HitTestType) { case TreeListHitTestType.Cell: ProcessCellClick(info); break; case TreeListHitTestType.Item: ProcessItemClick(info); break; case TreeListHitTestType.PlusMinus: ProcessPlusMinusClick(info); break; case TreeListHitTestType.Checkbox: ProcessItemCheckedChange(info); break; } } }
/// <summary> /// 测试鼠标经过的位置的对象。 /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="eventType"></param> /// <returns></returns> protected TreeListHitTestInfo HitTest(int x, int y, TreeListHitTestEventType eventType) { if (_bound.ColumnBound.Contains(x, y)) { return(HitTestColumn(x, y)); } if (_bound.AvlieBound.Contains(x, y)) { return(HitTestItem(x, y)); } return(null); }