Beispiel #1
0
        public void OnMouseClick(MouseEventArgs e, Point point)
        {
            if (point.Y > RowHeight + Padding.Vertical)
            {
                Point         rowRelativePoint;
                CustomListRow row = SelectChild(point, out rowRelativePoint);
                if (row == null)
                {
                    return;
                }

                row.OnMouseClick(e, rowRelativePoint);
            }
            else
            {
                Point          itemRelativePoint;
                CustomListItem item = GetItemFromPosition(point, out itemRelativePoint);
                if (item == null)
                {
                    return;
                }

                item.OnMouseClick(e, itemRelativePoint);
            }
        }
        protected override void OnMouseClick(MouseEventArgs e)
        {
            //
            // CA-14088: Clicking the general panel makes it scroll to the top
            //
            // Don't focus this control, focus its parent.  Focusing this control
            // causes it to scroll into view, therefore flick to top on first click
            //
            if (this.Parent != null)
            {
                this.Parent.Select();
            }

            base.OnMouseClick(e);
            if (level1ColWidths == null)
            {
                level1ColWidths = level1Widths();
            }

            Point         rowRelativePoint;
            CustomListRow selectedRow = getRowFromPoint(e.Location, out rowRelativePoint);

            if (selectedRow == null)
            {
                return;
            }

            selectedRow.OnMouseClick(e, rowRelativePoint);
        }