コード例 #1
0
 private void ResizeBegin(int x, int y)
 {
     // Console.WriteLine ("ResizeBegin");
     _resizing       = true;
     _selectionFrame = this.GetSelectionFrameAt(x, y);
     _selectionFrame.ResizeBegin(x, y);
 }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        private void ResizeContinue(int x, int y)
        {
            Rectangle   deltaBounds = _selectionFrame.ResizeContinue(x, y);
            ICollection selection   = this.GetSelectedComponents();

            foreach (IComponent component in selection)
            {
                if (component is Control)
                {
                    SelectionFrame frame = GetSelectionFrameFor((Control)component);
                    if (frame != _selectionFrame)
                    {
                        frame.Resize(deltaBounds);
                    }
                }
            }
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
0
		private void ResizeBegin (int x, int y)
		{
			_resizing = true;
			_selectionFrame = this.GetSelectionFrameAt (x, y);
			_selectionFrame.ResizeBegin (x, y);
		}
コード例 #9
0
 private void ResizeBegin(int x, int y)
 {
     _resizing       = true;
     _selectionFrame = this.GetSelectionFrameAt(x, y);
     _selectionFrame.ResizeBegin(x, y);
 }