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);
        }
Example #2
0
        public void OnMouseDoubleClick(MouseEventArgs e, Point point)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (DefaultMenuItem != null)
                {
                    DefaultMenuItem.PerformClick();
                }
            }

            if (point.Y > RowHeight + Padding.Vertical)
            {
                Point         rowRelativePoint;
                CustomListRow row = SelectChild(point, out rowRelativePoint);
                if (row == null)
                {
                    return;
                }

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

                item.OnMouseDoubleClick(e, itemRelativePoint);
            }
        }
Example #3
0
        public void OnMouseDown(Point point)
        {
            if (point.Y > RowHeight + Padding.Vertical)
            {
                Point         rowRelativePoint;
                CustomListRow row = SelectChild(point, out rowRelativePoint);
                if (row == null)
                {
                    ParentPanel.ClearSelection();
                    return;
                }

                row.OnMouseDown(rowRelativePoint);
            }
            else
            {
                if (!Selectable)
                {
                    return;
                }

                ParentPanel.ClearSelection();

                Selected = true;
                ParentPanel.SelectedRow = this;
                ParentPanel.Invalidate();
            }
        }
        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);
            }
        }
Example #5
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);
            }
        }
Example #6
0
        public virtual void OnMouseEnter(Point point)
        {
            System.Diagnostics.Trace.Assert(currentItem == null && currentRow == null);

            if (point.Y > RowHeight + Padding.Vertical)
            {
                Point rowRelativePoint;
                currentRow = SelectChild(point, out rowRelativePoint);
                if (currentRow == null)
                {
                    return;
                }

                currentRow.OnMouseEnter(rowRelativePoint);
            }
            else
            {
                Point itemRelativePoint;
                currentItem = GetItemFromPosition(point, out itemRelativePoint);
                if (currentItem == null)
                {
                    return;
                }

                currentItem.OnMouseEnter(itemRelativePoint);
            }
        }
 public void AddRow(CustomListRow row)
 {
     level1ColWidths = null;
     row.ParentPanel = this;
     Rows.Add(row);
     if (!InUpdate)
         Refresh();
 }
Example #8
0
 public void AddRow(CustomListRow row)
 {
     level1ColWidths = null;
     row.ParentPanel = this;
     Rows.Add(row);
     if (!InUpdate)
         Refresh();
 }
 public void AddChildRow(CustomListRow parent, CustomListRow child)
 {
     level1ColWidths = null;
     child.ParentPanel = this;
     parent.AddChild(child);
     if (!InUpdate)
         Refresh();
 }
 public void ClearSelection()
 {
     if (SelectedRow != null)
     {
         SelectedRow.Selected = false;
         SelectedRow = null;
         Invalidate();
     }
 }
Example #11
0
 public void AddChild(CustomListRow row)
 {
     row.Parent = this;
     if (this.Children.Count == 0)
     {
         row.Padding.Top = 10;
     }
     row.ParentPanel = ParentPanel;
     Children.Add(row);
 }
        protected override void OnMouseLeave(EventArgs e)
        {
            base.OnMouseLeave(e);

            if (currentRow != null)
            {
                currentRow.OnMouseLeave();
                currentRow = null;
            }
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            if (level1ColWidths == null)
                level1ColWidths = level1Widths();

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

            selectedRow.OnMouseDown(rowRelativePoint);
        }
Example #14
0
        public virtual void OnMouseLeave()
        {
            System.Diagnostics.Trace.Assert(currentItem == null || currentRow == null);

            if (currentItem != null)
            {
                currentItem.OnMouseLeave();
                currentItem = null;
            }

            if (currentRow != null)
            {
                currentRow.OnMouseLeave();
                currentRow = null;
            }
        }
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            base.OnMouseDoubleClick(e);
            if (level1ColWidths == null)
            {
                level1ColWidths = level1Widths();
            }

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

            if (selectedRow == null)
            {
                return;
            }

            selectedRow.OnMouseDoubleClick(e, rowRelativePoint);
        }
Example #16
0
        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);
            }
        }
Example #17
0
        public virtual void OnMouseLeave()
        {
            System.Diagnostics.Trace.Assert(currentItem == null || currentRow == null);

            if (currentItem != null)
            {
                currentItem.OnMouseLeave();
                currentItem = null;
            }

            if (currentRow != null)
            {
                currentRow.OnMouseLeave();
                currentRow = null;
            }
        }
Example #18
0
 public void AddChild(CustomListRow row)
 {
     row.Parent = this;
     if (this.Children.Count == 0)
         row.Padding.Top = 10;
     row.ParentPanel = ParentPanel;
     Children.Add(row);
 }
Example #19
0
        public virtual void OnMouseEnter(Point point)
        {
            System.Diagnostics.Trace.Assert(currentItem == null && currentRow == null);

            if (point.Y > RowHeight + Padding.Vertical)
            {
                Point rowRelativePoint;
                currentRow = SelectChild(point, out rowRelativePoint);
                if (currentRow == null)
                    return;
                
                currentRow.OnMouseEnter(rowRelativePoint);
            }
            else
            {
                Point itemRelativePoint;
                currentItem = GetItemFromPosition(point, out itemRelativePoint);
                if (currentItem == null)
                    return;

                currentItem.OnMouseEnter(itemRelativePoint);
            }
        }
Example #20
0
        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);
        }
 public void AddItemToRow(CustomListRow row, CustomListItem item)
 {
     row.AddItem(item);
     Refresh();
 }
Example #22
0
        protected override void OnMouseLeave(EventArgs e)
        {
            base.OnMouseLeave(e);

            if (currentRow != null)
            {
                currentRow.OnMouseLeave();
                currentRow = null;
            }
        }
Example #23
0
 public void AddItemToRow(CustomListRow row, CustomListItem item)
 {
     row.AddItem(item);
     Refresh();
 }
Example #24
0
 public void ClearSelection()
 {
     if (SelectedRow != null)
     {
         SelectedRow.Selected = false;
         SelectedRow = null;
         Invalidate();
     }
 }
Example #25
0
 public void AddChildRow(CustomListRow parent, CustomListRow child)
 {
     level1ColWidths = null;
     child.ParentPanel = this;
     parent.AddChild(child);
     if (!InUpdate)
         Refresh();
 }
Example #26
0
        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);
                }
            }
        }