protected virtual void UpdateHintPosition(Point mousePosition) { RadListElement nodeElement = this.DropTarget as RadListElement; RadListVisualItem item = nodeElement.ElementTree.GetElementAtPoint(nodeElement.ElementTree.Control.PointToClient(mousePosition)) as RadListVisualItem; if (item == null) { return; } Rectangle itemBounds = nodeElement.ElementTree.Control.RectangleToScreen(item.ControlBoundingRectangle); Padding margins = Padding.Empty; int imageHeight = 1; //if (this.DropHintColor == Color.Empty) //{ // RadImageShape imageShape = this.owner.ItemDropHint; // imageHeight = imageShape.Image.Size.Height; // margins = imageShape.Margins; //} Point client = nodeElement.PointFromScreen(mousePosition); bool isDropAtTop = client.Y <= nodeElement.Size.Height / 2; int y = isDropAtTop ? itemBounds.Y : itemBounds.Bottom; Point hitLocation = new Point(itemBounds.X - margins.Left, y - imageHeight / 2); this.dropHintWindow.Width = itemBounds.Width; this.dropHintWindow.ShowWindow(hitLocation); }
protected virtual bool CanShowDropHint(Point mousePosition) { RadListElement dropTarget = this.DropTarget as RadListElement; if (dropTarget == null) return false; Point point = dropTarget.PointFromScreen(mousePosition); int num = dropTarget.ItemHeight / 3; if (point.Y >= num) return point.Y > num * 2; return true; }
protected virtual void UpdateHintPosition(Point mousePosition) { RadListElement dropTarget = this.DropTarget as RadListElement; RadListVisualItem elementAtPoint = dropTarget.ElementTree.GetElementAtPoint(dropTarget.ElementTree.Control.PointToClient(mousePosition)) as RadListVisualItem; if (elementAtPoint == null) return; Rectangle screen = dropTarget.ElementTree.Control.RectangleToScreen(elementAtPoint.ControlBoundingRectangle); Padding empty = Padding.Empty; int num1 = 1; int num2 = dropTarget.PointFromScreen(mousePosition).Y <= dropTarget.Size.Height / 2 ? screen.Y : screen.Bottom; Point screenLocation = new Point(screen.X - empty.Left, num2 - num1 / 2); this.dropHintWindow.Width = screen.Width; this.dropHintWindow.ShowWindow(screenLocation); }
protected virtual bool CanShowDropHint(Point mousePosition) { RadListElement element = this.DropTarget as RadListElement; if (element == null) { return(false); } Point client = element.PointFromScreen(mousePosition); int part = element.ItemHeight / 3; return(client.Y < part || client.Y > part * 2); }