private void ResizeBegin(int x, int y) { // Console.WriteLine ("ResizeBegin"); _resizing = true; _selectionFrame = this.GetSelectionFrameAt(x, y); _selectionFrame.ResizeBegin(x, y); }
public bool AdornmentsHitTest(Control control, int x, int y) { SelectionFrame frame = GetSelectionFrameAt(x, y); if (frame != null) { return(frame.HitTest(x, y)); } return(false); }
public bool SetCursor(int x, int y) { bool modified = false; // if moving mouse around - set cursor if mouse is hovering a selectionframes' grabhandles // SelectionFrame frame = GetSelectionFrameAt(x, y); if (frame != null && frame.HitTest(x, y) && frame.SetCursor(x, y)) { modified = true; } return(modified); }
private SelectionFrame GetSelectionFrameAt(int x, int y) { SelectionFrame result = null; foreach (SelectionFrame frame in _selectionFrames) { if (frame.Bounds.Contains(new Point(x, y))) { result = frame; break; } } return(result); }
private void ResizeContinue(int x, int y) { // Console.WriteLine ("ResizeContinue"); Rectangle deltaBounds = _selectionFrame.ResizeContinue(x, y); ICollection selection = this.SelectionService.GetSelectedComponents(); foreach (IComponent component in selection) { if (component is Control) { SelectionFrame frame = GetSelectionFrameFor((Control)component); if (frame != _selectionFrame) { frame.Resize(deltaBounds); } } } }
public void MouseDragBegin(Control container, int x, int y) { // * start resizing the selection frame // * start selecting // SelectionFrame frame = GetSelectionFrameAt(x, y); if (frame != null && frame.HitTest(x, y)) { this.SelectionService.SetSelectedComponents(new IComponent[] { frame.Control }); if (_transaction == null) { IDesignerHost host = this.GetService(typeof(IDesignerHost)) as IDesignerHost; _transaction = host.CreateTransaction("Resize " + (this.SelectionService.SelectionCount == 1 ? ((IComponent)this.SelectionService.PrimarySelection).Site.Name : "controls")); } this.ResizeBegin(x, y); } else { SelectionBegin(container, x, y); } }
private void ResizeBegin (int x, int y) { // Console.WriteLine ("ResizeBegin"); _resizing = true; _selectionFrame = this.GetSelectionFrameAt (x, y); _selectionFrame.ResizeBegin (x, y); }