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