Beispiel #1
0
 protected override void OnMouseLeave(EventArgs e)
 {
     rowAtMousePosition = null;
     if (itemAtMousePosition != null)
     {
         OnLeaveItem(itemAtMousePosition);
         itemAtMousePosition = null;
     }
     base.OnMouseLeave(e);
 }
Beispiel #2
0
        /// <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!");
        }
Beispiel #3
0
        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]);
        }
Beispiel #4
0
        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));
            }
        }
Beispiel #5
0
 internal DynamicListItem(DynamicListRow row)
 {
     this.row = row;
 }
Beispiel #6
0
		protected override void OnMouseLeave(EventArgs e)
		{
			rowAtMousePosition = null;
			if (itemAtMousePosition != null) {
				OnLeaveItem(itemAtMousePosition);
				itemAtMousePosition = null;
			}
			base.OnMouseLeave(e);
		}
Beispiel #7
0
		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));
			}
		}
Beispiel #8
0
		/// <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!");
		}
		internal DynamicListItem(DynamicListRow row)
		{
			this.row = row;
		}