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); }
public void MouseDragBegin(Control container, int x, int y) { // XXX: pass ControlDesigner and not control and check if it is a ParentControlDesigner !!!!!! // // * start resizing the selection frame // * start selecting // SelectionFrame frame = GetSelectionFrameAt(x, y); if (frame != null && frame.HitTest(x, y)) { this.SetSelectedComponents(new IComponent[] { frame.Control }); this.ResizeBegin(x, y); } else { SelectionBegin(container, x, y); } }
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); } }