Example #1
0
        public bool AdornmentsHitTest(Control control, int x, int y)
        {
            SelectionFrame frame = GetSelectionFrameAt(x, y);

            if (frame != null)
            {
                return(frame.HitTest(x, y));
            }

            return(false);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
            }
        }