internal NodeObject MakeNode() { NodeObject node = new NodeObject(); drawableObjects.Add(node); return(node); }
public FreeHandRegionForm() { points = new List<Point>(128); regionFillPath = new GraphicsPath(); lastNode = new NodeObject() { Shape = NodeShape.Circle }; DrawableObjects.Add(lastNode); }
public FreeHandRegion() { points = new List <Point>(128); regionFillPath = new GraphicsPath(); lastNode = new NodeObject() { Shape = NodeShape.Circle }; DrawableObjects.Add(lastNode); }
private void CreateNode() { NodeObject newNode = new NodeObject() { Shape = NodeShape.Diamond }; ActivateNode(newNode); nodes.Add(newNode); DrawableObjects.Add(newNode); }
public FreeHandRegionForm() { points = new List <Point>(128); regionFillPath = new GraphicsPath(); lastNode = new NodeObject() { Shape = NodeShape.Circle }; drawableObjects.Add(lastNode); MouseDoubleClick += FreeHandRegionForm_MouseDoubleClick; }
private void ActivateNode(NodeObject node) { node.Position = InputManager.MousePosition0Based; node.Visible = true; node.IsDragging = true; }
internal NodeObject MakeNode() { NodeObject node = new NodeObject(); DrawableObjects.Add(node); return node; }
public virtual void OnNodeUpdate() { for (int i = 0; i < 8; i++) { NodeObject node = Manager.Nodes[i]; if (node.IsDragging) { Manager.IsResizing = true; if (!InputManager.IsBeforeMouseDown(MouseButtons.Left)) { tempNodePos = node.Position; tempStartPos = Rectangle.Location; tempEndPos = new Point(Rectangle.X + Rectangle.Width - 1, Rectangle.Y + Rectangle.Height - 1); } Point pos = InputManager.MousePosition0Based; Point startPos = tempStartPos; Point endPos = tempEndPos; NodePosition nodePosition = (NodePosition)i; int x = pos.X - tempNodePos.X; switch (nodePosition) { case NodePosition.TopLeft: case NodePosition.Left: case NodePosition.BottomLeft: startPos.X += x; break; case NodePosition.TopRight: case NodePosition.Right: case NodePosition.BottomRight: endPos.X += x; break; } int y = pos.Y - tempNodePos.Y; switch (nodePosition) { case NodePosition.TopLeft: case NodePosition.Top: case NodePosition.TopRight: startPos.Y += y; break; case NodePosition.BottomLeft: case NodePosition.Bottom: case NodePosition.BottomRight: endPos.Y += y; break; } Rectangle = CaptureHelpers.CreateRectangle(startPos, endPos); } } }