Example #1
0
 private void HandlePan(UIPanGestureRecognizer rec)
 {
     if (rec.State == UIGestureRecognizerState.Began)
     {
         HandleTouchesBeganAtLocation(rec.LocationInView(View));
     }
     else if (rec.State == UIGestureRecognizerState.Changed)
     {
         HandleTouchesMovedToLocation(rec.LocationInView(View));
     }
     else if (rec.State == UIGestureRecognizerState.Ended ||
              rec.State == UIGestureRecognizerState.Cancelled ||
              rec.State == UIGestureRecognizerState.Failed)
     {
         float velocity = rec.VelocityInView(View).X;
         if (Math.Abs(velocity) > kLWMinimumVelocityToTriggerSlide)
         {
             if (velocity > 0f)
             {
                 SlideOutSlideNavigationView();
             }
             else
             {
                 SlideInSlideNavigationView();
             }
         }
         else
         {
             HandleTouchesEndedAtLocation(rec.LocationInView(View));
         }
     }
 }
Example #2
0
        private void ViewDragged(UIPanGestureRecognizer panInfo)
        {
            if (panInfo.State == UIGestureRecognizerState.Began)
            {
                _viewCoordinate = panInfo.LocationInView(panInfo.View);
            }
            var newCoord        = panInfo.LocationInView(panInfo.View);
            var deltaWidthDrag  = newCoord.X - _viewCoordinate.X;
            var deltaHeightDrag = newCoord.Y - _viewCoordinate.Y;


            var width  = Frame.Size.Width;
            var height = Frame.Size.Height;

            var xMax = Superview.Frame.Width;
            var yMax = Superview.Frame.Height;
            var view = Superview as UIScrollView;

            if (view != null)
            {
                xMax = view.ContentSize.Width;
                yMax = view.ContentSize.Height;
            }

            var x = Math.Max(0, Math.Min(xMax - panInfo.View.Frame.Width, panInfo.View.Frame.X + deltaWidthDrag));
            var y = Math.Max(0, Math.Min(yMax - panInfo.View.Frame.Height, panInfo.View.Frame.Y + deltaHeightDrag));

            panInfo.View.Frame = new CGRect(x, y,
                                            width,
                                            height);
            LayoutSubviews();
        }
Example #3
0
        public UISwipeGestureRecognizerDirection?GetDirection(UIPanGestureRecognizer recognizer)
        {
            double heightDiff    = 0;
            double widthDiff     = 0;
            double heightDiffAbs = 0;
            double widthDiffAbs  = 0;

            UISwipeGestureRecognizerDirection?verticalDirection   = null;
            UISwipeGestureRecognizerDirection?horizontalDirection = null;
            UISwipeGestureRecognizerDirection?generalDirection    = null;

            switch (recognizer.State)
            {
            case UIGestureRecognizerState.Began:
                _pointStart = recognizer.LocationInView(_view);
                break;

            case UIGestureRecognizerState.Ended:
                _pointEnd = recognizer.LocationInView(_view);


                widthDiff    = _pointStart.X - _pointEnd.X;
                widthDiffAbs = Math.Abs(widthDiff);
                if (widthDiffAbs < MinLenght)
                {
                    widthDiff = widthDiffAbs = 0;
                }

                heightDiff    = _pointStart.Y - _pointEnd.Y;
                heightDiffAbs = Math.Abs(heightDiff);
                if (heightDiffAbs < MinLenght)
                {
                    heightDiff = heightDiffAbs = 0;
                }

                if (widthDiff != 0)
                {
                    horizontalDirection = widthDiff < 0 ? UISwipeGestureRecognizerDirection.Right : UISwipeGestureRecognizerDirection.Left;
                }

                if (heightDiff != 0)
                {
                    verticalDirection = heightDiff < 0 ? UISwipeGestureRecognizerDirection.Down : UISwipeGestureRecognizerDirection.Up;
                }

                if (widthDiffAbs != heightDiffAbs)
                {
                    generalDirection = widthDiffAbs > heightDiffAbs ? horizontalDirection : verticalDirection;
                }
                break;
            }

            return(generalDirection);
        }
Example #4
0
        private void processGesture(UIPanGestureRecognizer g)
        {
            if ((MasterDetailPage == null) || !MasterDetailPage.IsGestureEnabled)
            {
                return;
            }

            UIViewController masterController = this.ChildViewControllers[0];
            UIViewController detailController = this.ChildViewControllers[1];

            switch (g.State)
            {
            case UIGestureRecognizerState.Began:
                lastPointF = (PointF)g.LocationInView(g.View);
                break;

            case UIGestureRecognizerState.Changed:
                float      x     = (float)(g.LocationInView(g.View).X - lastPointF.X);
                RectangleF frame = (RectangleF)detailController.View.Frame;

                if (GetPresentedValue() == true)
                {
                    frame.X = (float)Math.Max(0f, masterController.View.Frame.Width + Math.Min(0f, x));
                }
                else
                {
                    frame.X = (float)Math.Min(masterController.View.Frame.Width, Math.Max(0f, x));
                }

                detailController.View.Frame = frame;
                lastX = frame.X;
                break;

            case UIGestureRecognizerState.Ended:
                bool isPresented = GetPresentedValue();
                if (isPresented == true && lastX < masterController.View.Frame.Width * 0.75f)
                {
                    SetPresentedValue(false);
                }
                else if (isPresented == false && lastX > masterController.View.Frame.Width * 0.25f)
                {
                    SetPresentedValue(true);
                }
                else
                {
                    this.InvokeLayoutChildren(true);
                }
                break;
            }
        }
Example #5
0
        public void OnPanGesture(UIPanGestureRecognizer sender)
        {
            var location = sender.LocationInView(sender.View);
            var position = GetOffsetPosition(new Vector2(location.X, location.Y), true);

            var delta = position - _previousPanPosition.GetValueOrDefault(position);

            if (sender.State == UIGestureRecognizerState.Ended ||
                sender.State == UIGestureRecognizerState.Cancelled ||
                sender.State == UIGestureRecognizerState.Failed)
            {
                TouchPanel.GestureList.Enqueue(new GestureSample(
                                                   GestureType.DragComplete, new TimeSpan(DateTime.Now.Ticks),
                                                   position, Vector2.Zero,
                                                   delta, Vector2.Zero));

                _previousPanPosition = null;
            }
            else
            {
                TouchPanel.GestureList.Enqueue(new GestureSample(
                                                   GestureType.FreeDrag, new TimeSpan(DateTime.Now.Ticks),
                                                   position, Vector2.Zero,
                                                   delta, Vector2.Zero));
                _previousPanPosition = position;
            }
        }
        private void HandlePanFrom(UIPanGestureRecognizer recognizer)
        {
            if (recognizer.State == UIGestureRecognizerState.Began)
            {
                PointF touchLocation = recognizer.LocationInView(recognizer.View);
                touchLocation = this.ConvertPointFromView(touchLocation);
                this.SelectNodeForTouch(touchLocation);
            }
            else if (recognizer.State == UIGestureRecognizerState.Changed)
            {
                PointF translation = recognizer.TranslationInView(recognizer.View);
                translation = new PointF(translation.X, -translation.Y);
                this.PanForTranslation(translation);
                recognizer.SetTranslation(new PointF(0, 0), recognizer.View);
            }
            else if (recognizer.State == UIGestureRecognizerState.Ended)
            {
                float scrollDuration = 0.2f;

                if (this.SelectedNode.Name != ANIMAL_NODE_NAME)
                {
                    PointF velocity = recognizer.VelocityInView(recognizer.View);
                    PointF p        = mult(velocity, scrollDuration);

                    PointF position = this.SelectedNode.Position;
                    PointF newPos   = new PointF(position.X + p.X, position.Y + p.Y);
                    newPos = this.BoundLayerPosition(newPos);
                    this.SelectedNode.RemoveAllActions();

                    SKAction moveTo = SKAction.MoveTo(newPos, scrollDuration);
                    moveTo.TimingMode = SKActionTimingMode.EaseOut;
                    this.SelectedNode.RunAction(moveTo);
                }
            }
        }
        void HandlePan(UIPanGestureRecognizer panGestureRecognizer)
        {
            if (panGestureRecognizer != null)
            {
                var point = panGestureRecognizer.LocationInView(this);
                var navigationController = GetUINavigationController(GetViewController());

                switch (panGestureRecognizer.State)
                {
                case UIGestureRecognizerState.Began:
                    if (navigationController != null)
                    {
                        navigationController.InteractivePopGestureRecognizer.Enabled = false;
                    }

                    HandleTouchDown(point);
                    break;

                case UIGestureRecognizerState.Changed:
                    HandleTouchMove(point);
                    break;

                case UIGestureRecognizerState.Ended:
                case UIGestureRecognizerState.Cancelled:
                    if (navigationController != null)
                    {
                        navigationController.InteractivePopGestureRecognizer.Enabled = true;
                    }

                    HandleTouchUpOrCancel();
                    break;
                }
            }
        }
        private void Pan(UIPanGestureRecognizer gesture)
        {
            location = gesture.LocationInView(MainView);
            MyTouchScreenEvent();

            SetValues();
        }
Example #9
0
        private UIPanGestureRecognizer CreatePanGesture()
        {
            UIPanGestureRecognizer result = null;
            nfloat dy   = 0;
            nfloat navX = 70;

            result = new UIPanGestureRecognizer(() => {
                if ((result.State == UIGestureRecognizerState.Began || result.State == UIGestureRecognizerState.Changed) && (result.NumberOfTouches == 1))
                {
                    _isDragging = true;

                    var p0       = result.LocationInView(this);
                    var currentY = (_position == ChartPosition.Top) ? topY : downY;

                    if (dy.CompareTo(0) == 0)
                    {
                        dy = p0.Y - currentY;
                    }

                    var p1 = new CGPoint(_containerView.Center.X, p0.Y - dy);
                    if (p1.Y > topY || p1.Y < downY)
                    {
                        return;
                    }
                    _containerView.Center = p1;
                }
                else if (result.State == UIGestureRecognizerState.Ended)
                {
                    nfloat newY;
                    ChartPosition newPosition;

                    if (_position == ChartPosition.Top && _containerView.Center.Y <= topY - navX)
                    {
                        newPosition = ChartPosition.Down;
                        newY        = downY;
                    }
                    else if (_position == ChartPosition.Down && _containerView.Center.Y >= downY + navX)
                    {
                        newPosition = ChartPosition.Top;
                        newY        = topY;
                    }
                    else
                    {
                        newPosition = _position;
                        newY        = (_position == ChartPosition.Top) ? topY : downY;
                    }

                    UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseOut,
                                   () => {
                        _containerView.Center = new CGPoint(_containerView.Center.X, newY);
                    }, () => {
                        _isDragging = false;
                        _position   = newPosition;
                    });
                    dy = 0;
                }
            });

            return(result);
        }
        private void CreatePanGestureRecognizer()
        {
            panGesture = new UIPanGestureRecognizer(() =>
            {
                if ((panGesture.State == UIGestureRecognizerState.Began || panGesture.State == UIGestureRecognizerState.Changed) && (panGesture.NumberOfTouches == 1))
                {
                    var p0 = panGesture.LocationInView(this);

                    if (dx == 0)
                    {
                        dx = p0.X - Subviews[0].Center.X;
                    }

                    if (dy == 0)
                    {
                        dy = p0.Y - Subviews[0].Center.Y;
                    }

                    var p1 = new PointF((float)(p0.X - dx), (float)(p0.Y - dy));

                    Subviews[0].Center = p1;
                }
                else if (panGesture.State == UIGestureRecognizerState.Ended)
                {
                    dx = 0;
                    dy = 0;
                }
            });
        }
Example #11
0
        //#pragma mark - Input.

        public void _handleHighlightGestureRecognizer(UIPanGestureRecognizer gestureRecognizer)
        {
            CGPoint point = gestureRecognizer.LocationInView(this);

            if (gestureRecognizer.State == UIGestureRecognizerState.Changed || gestureRecognizer.State == UIGestureRecognizerState.Ended)
            {
                foreach (UIButton button in this.buttonDictionary.Values)
                {
                    bool points = button.Frame.Contains(point) && !button.Hidden;

                    if (gestureRecognizer.State == UIGestureRecognizerState.Changed)
                    {
                        button.Highlighted = points;
                    }
                    else
                    {
                        button.Highlighted = false;
                    }

                    if (gestureRecognizer.State == UIGestureRecognizerState.Ended && points)
                    {
                        button.SendActionForControlEvents(UIControlEvent.TouchUpInside);
                    }
                }
            }
        }
Example #12
0
        unsafe protected void pan(UIPanGestureRecognizer sender)
        {
            if (nsvc.SigningMode == true)
            {
                this.touchLocation = sender.LocationInView(this);
                CGPoint mid = BezierSignatureView.MidPoint(this.touchLocation, this.prevTouchLocation);

                switch (sender.State)
                {
                case UIGestureRecognizerState.Began:
                {
                    this.drawPath.MoveToPoint(this.touchLocation);
                    break;
                }

                case UIGestureRecognizerState.Changed:
                {
                    this.drawPath.AddQuadCurveToPoint(this.prevTouchLocation.X, this.prevTouchLocation.Y, mid.X, mid.Y);
                    this.nsvc.hasBeenSigned = true;
                    break;
                }

                default:
                {
                    break;
                }
                }
                this.prevTouchLocation = this.touchLocation;
                this.SetNeedsDisplay();
            }
        }
Example #13
0
        public NodeTouchEvent(NodeUIView parent, UIPanGestureRecognizer pan)
        {
            switch (pan.State)
            {
            case UIGestureRecognizerState.Began:
                type = TouchType.Down;
                break;

            case UIGestureRecognizerState.Changed:
                type = TouchType.Move;
                break;

            case UIGestureRecognizerState.Ended:
                type = TouchType.Up;
                break;

            case UIGestureRecognizerState.Possible:
            case UIGestureRecognizerState.Cancelled:
            case UIGestureRecognizerState.Failed:
                break;
            }

            var p = pan.LocationInView(parent);

            point = new Point(p.X, p.Y);

            var velo = pan.VelocityInView(parent);

            velocity = new Vec2(velo.X / 1000, velo.Y / 1000);
        }
Example #14
0
        private void Panned(UIPanGestureRecognizer sender)
        {
            var currentPos = sender.LocationInView(this);
            var alpha      = ImageCropView.Alpha;

            if (sender.State == UIGestureRecognizerState.Began)
            {
                PannedBegan(sender, currentPos);
            }
            else if (sender.State == UIGestureRecognizerState.Changed)
            {
                PannedChanged(currentPos);
            }
            else
            {
                alpha = PannedOtherwise(sender, currentPos, alpha);
            }

            AnimateNotify(0.3, 0, UIViewAnimationOptions.CurveEaseOut, () =>
            {
                ImageCropView.Alpha = alpha;
                MovieView.Alpha     = alpha;
                LayoutIfNeeded();
            }, finished => { });
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            nfloat r  = 0;
            nfloat dx = 0;
            nfloat dy = 0;

            using (var image = UIImage.FromFile("monkey.png")) {
                imageView = new UIImageView(image)
                {
                    Frame = new CGRect(new CGPoint(0, 0), image.Size)
                };
                imageView.UserInteractionEnabled = true;
                View.AddSubview(imageView);
            }
            rotateGesture = new UIRotationGestureRecognizer((() => {
                if ((rotateGesture.State == UIGestureRecognizerState.Began || rotateGesture.State == UIGestureRecognizerState.Changed) && (rotateGesture.NumberOfTouches == 2))
                {
                    imageView.Transform = CGAffineTransform.MakeRotation(rotateGesture.Rotation + r);
                }
                else if (rotateGesture.State == UIGestureRecognizerState.Ended)
                {
                    r += rotateGesture.Rotation;
                }
            }));


            panGesture = new UIPanGestureRecognizer(() => {
                if ((panGesture.State == UIGestureRecognizerState.Began || panGesture.State == UIGestureRecognizerState.Changed) && (panGesture.NumberOfTouches == 1))
                {
                    var p0 = panGesture.LocationInView(View);

                    if (dx == 0)
                    {
                        dx = p0.X - imageView.Center.X;
                    }

                    if (dy == 0)
                    {
                        dy = p0.Y - imageView.Center.Y;
                    }

                    var p1 = new CGPoint(p0.X - dx, p0.Y - dy);

                    imageView.Center = p1;
                }
                else if (panGesture.State == UIGestureRecognizerState.Ended)
                {
                    dx = 0;
                    dy = 0;
                }
            });

            imageView.AddGestureRecognizer(panGesture);
            imageView.AddGestureRecognizer(rotateGesture);

            View.BackgroundColor = UIColor.White;
        }
        private void OnMoved(UIPanGestureRecognizer recognizer)
        {
            var touchController = Element as ITouchCanvasViewController;

            if (recognizer.State == UIGestureRecognizerState.Changed)
            {
                touchController.OnMove(recognizer.LocationInView(Control).ToSKPoint());
            }
            if (recognizer.State == UIGestureRecognizerState.Began)
            {
                touchController.OnPress(recognizer.LocationInView(Control).ToSKPoint());
            }
            if (recognizer.State == UIGestureRecognizerState.Ended)
            {
                touchController.OnRelease(recognizer.LocationInView(Control).ToSKPoint());
            }
        }
 void OnProgressPan(UIPanGestureRecognizer recognizer)
 {
     if (ContainerView != null)
     {
         var point = recognizer.LocationInView(ContainerView);
         UpdateProgressBaseOnPoint(point);
     }
 }
Example #18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            image.UserInteractionEnabled = true; //
            var GestoToque = new UITapGestureRecognizer(Tocando);

            //Se aplican los gestos a la imagen
            image.AddGestureRecognizer(GestoToque);

            GestoMover = new UIPanGestureRecognizer(() =>
            {
                if ((GestoMover.State == UIGestureRecognizerState.Began || //Validar el estado del gesto
                     GestoMover.State == UIGestureRecognizerState.Changed) &&
                    (GestoMover.NumberOfTouches == 1))
                {
                    var P0 = GestoMover.LocationInView(View); //Gesto en toda la pantalla.

                    if (coordenadasX == 0)
                    {
                        coordenadasX = P0.X - image.Center.X;
                    }

                    if (coordenadasY == 0)
                    {
                        coordenadasY = P0.Y - image.Center.Y;
                    }

                    var P1 = new CGPoint(P0.X - coordenadasX, P0.Y - coordenadasY);

                    image.Center = P1;
                }
                else
                {
                    coordenadasX = 0;
                    coordenadasY = 0;
                }
            });


            GestoRotar = new UIRotationGestureRecognizer(() =>
            {
                if ((GestoRotar.State == UIGestureRecognizerState.Began ||                            //Validar el estado del gesto
                     GestoRotar.State == UIGestureRecognizerState.Changed) &&
                    (GestoRotar.NumberOfTouches == 2))                                                //el gesto de rotar se hace con dos toques.
                {
                    image.Transform = CGAffineTransform.MakeRotation(GestoRotar.Rotation + rotacion); //Se vuelve a verificar el estado, para validar en donde se quedo.
                }
                else if (GestoRotar.State == UIGestureRecognizerState.Ended)
                {
                    rotacion = GestoRotar.Rotation; //Se obtinen los valores de rotación.
                }
            });

            //Se aplican los gestos a la imagen
            image.AddGestureRecognizer(GestoMover);
            image.AddGestureRecognizer(GestoRotar);
        }
Example #19
0
        void Pan(UIPanGestureRecognizer pan)
        {
            var location = pan.LocationInView(View);

            switch (pan.State)
            {
            case UIGestureRecognizerState.Began:
                // Capture the initial touch offset from the itemView's center.
                var center = itemView.Center;
                offset.X = location.X - center.X;
                offset.Y = location.Y - center.Y;

                // Disable the behavior while the item is manipulated by the pan recognizer.
                stickyBehavior.Enabled = false;
                break;

            case UIGestureRecognizerState.Changed:
                // Get reference bounds.
                var referenceBounds = View.Bounds;
                var referenceWidth  = referenceBounds.Width;
                var referenceHeight = referenceBounds.Height;

                // Get item bounds.
                var itemBounds     = itemView.Bounds;
                var itemHalfWidth  = itemBounds.Width / 2f;
                var itemHalfHeight = itemBounds.Height / 2f;

                // Apply the initial offset.
                location.X -= offset.X;
                location.Y -= offset.Y;

                // Bound the item position inside the reference view.
                location.X = NMath.Max(itemHalfWidth, location.X);
                location.X = NMath.Min(referenceWidth - itemHalfWidth, location.X);
                location.Y = NMath.Max(itemHalfHeight, location.Y);
                location.Y = NMath.Min(referenceHeight - itemHalfHeight, location.Y);

                // Apply the resulting item center.
                itemView.Center = location;
                break;

            case UIGestureRecognizerState.Ended:
            case UIGestureRecognizerState.Cancelled:
                // Get the current velocity of the item from the pan gesture recognizer.
                var velocity = pan.VelocityInView(View);

                // Re-enable the stickyCornersBehavior.
                stickyBehavior.Enabled = true;

                // Add the current velocity to the sticky corners behavior.
                stickyBehavior.AddLinearVelocity(velocity);
                break;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            Imagen.UserInteractionEnabled = true;
            var GestoToque = new UITapGestureRecognizer(Tocando);

            Imagen.AddGestureRecognizer(GestoToque);

            GestoMover = new UIPanGestureRecognizer(() =>
            {
                if ((GestoMover.State == UIGestureRecognizerState.Began ||
                     GestoMover.State == UIGestureRecognizerState.Changed) &&
                    (GestoMover.NumberOfTouches == 1))
                {
                    var p0 = GestoMover.LocationInView(View);
                    if (coordenadaX == 0)
                    {
                        coordenadaX = p0.X - Imagen.Center.X;
                    }
                    if (coordenadaY == 0)
                    {
                        coordenadaY = p0.Y - Imagen.Center.Y;
                    }
                    var p1        = new CGPoint(p0.X - coordenadaX, p0.Y - coordenadaY);
                    Imagen.Center = p1;
                }
                else
                {
                    coordenadaX = 0;
                    coordenadaY = 0;
                }
            });

            GestoRotar = new UIRotationGestureRecognizer(() =>
            {
                if ((GestoRotar.State == UIGestureRecognizerState.Began ||
                     GestoRotar.State == UIGestureRecognizerState.Changed) &&
                    (GestoRotar.NumberOfTouches == 2))
                {
                    Imagen.Transform = CGAffineTransform.MakeRotation(GestoRotar.Rotation + rotacion);
                }
                else if (GestoRotar.State == UIGestureRecognizerState.Ended)
                {
                    rotacion = GestoRotar.Rotation;
                }
            });

            Imagen.AddGestureRecognizer(GestoMover);
            Imagen.AddGestureRecognizer(GestoRotar);
        }
        void OnPanGesture()
        {
            Point   ptOffset = Point.Zero;
            CGPoint pt       = _panGestureRecognizer.LocationInView(UIApplication.SharedApplication.KeyWindow);

            if (_oldPt != null)
            {
                ptOffset = new Point(pt.X - _oldPt.Value.X, pt.Y - _oldPt.Value.Y);
            }
            _oldPt = pt;

            Element.UpdateGrid(ptOffset.X, ptOffset.Y);
        }
Example #22
0
        private bool PanGestureInActiveArea(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea)
        {
            var position = panGesture.LocationInView(ContentViewController.View).X;

            if (menuLocation == MenuLocations.Left)
            {
                return(position > gestureActiveArea);
            }
            else
            {
                return(position < ContentViewController.View.Bounds.Width - gestureActiveArea);
            }
        }
Example #23
0
        private void Pan(UIPanGestureRecognizer panGestureRecognizer)
        {
            var point = panGestureRecognizer.LocationInView(this).GetPoint();

            if (panGestureRecognizer.State == UIGestureRecognizerState.Began)
            {
                Delegate?.PathStartedAt(point);
            }
            else
            {
                Delegate?.PathAppendedAt(point);
            }
        }
		void Pan (UIPanGestureRecognizer pan)
		{
			var location = pan.LocationInView (View);

			switch (pan.State) {
			case UIGestureRecognizerState.Began:
				// Capture the initial touch offset from the itemView's center.
				var center = itemView.Center;
				offset.X = location.X - center.X;
				offset.Y = location.Y - center.Y;

				// Disable the behavior while the item is manipulated by the pan recognizer.
				stickyBehavior.Enabled = false;
				break;
			case UIGestureRecognizerState.Changed:
				// Get reference bounds.
				var referenceBounds = View.Bounds;
				var referenceWidth = referenceBounds.Width;
				var referenceHeight = referenceBounds.Height;

				// Get item bounds.
				var itemBounds = itemView.Bounds;
				var itemHalfWidth = itemBounds.Width / 2f;
				var itemHalfHeight = itemBounds.Height / 2f;

				// Apply the initial offset.
				location.X -= offset.X;
				location.Y -= offset.Y;

				// Bound the item position inside the reference view.
				location.X = NMath.Max (itemHalfWidth, location.X);
				location.X = NMath.Min (referenceWidth - itemHalfWidth, location.X);
				location.Y = NMath.Max (itemHalfHeight, location.Y);
				location.Y = NMath.Min (referenceHeight - itemHalfHeight, location.Y);

				// Apply the resulting item center.
				itemView.Center = location;
				break;
			case UIGestureRecognizerState.Ended:
			case UIGestureRecognizerState.Cancelled:
				// Get the current velocity of the item from the pan gesture recognizer.
				var velocity = pan.VelocityInView (View);

				// Re-enable the stickyCornersBehavior.
				stickyBehavior.Enabled = true;

				// Add the current velocity to the sticky corners behavior.
				stickyBehavior.AddLinearVelocity (velocity);
				break;
			}
		}
Example #25
0
 protected void HandleDrag(UIPanGestureRecognizer recognizer)
 {
     if (recognizer.State != (UIGestureRecognizerState.Cancelled | UIGestureRecognizerState.Failed
                              | UIGestureRecognizerState.Possible))
     {
         //cololabel.Text = "" + recognizer.LocationInView (colorView).X;
         int idx = (int)(recognizer.LocationInView(colorView).X / 142);
         if (idx >= 0 && idx < 6)
         {
             IndexColor = idx;
         }
         resetColors(IndexColor);
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Imagen.UserInteractionEnabled = true;
            var GestoToque = new UITapGestureRecognizer(Tocando);

            Gestomover = new UIPanGestureRecognizer(() =>
            {
                if ((Gestomover.State == UIGestureRecognizerState.Began || Gestomover.State == UIGestureRecognizerState.Changed) &&
                    (Gestomover.NumberOfTouches == 1))
                {
                    var p0 = Gestomover.LocationInView(View);
                    if (CoordenadaX == 0)
                    {
                        CoordenadaX = p0.X - Imagen.Center.X;
                    }
                    if (CoordenadaY == 0)
                    {
                        CoordenadaY = p0.Y - Imagen.Center.Y;
                    }
                    var p1        = new CGPoint(p0.X - CoordenadaX, p0.Y - CoordenadaY);
                    Imagen.Center = p1;
                }
                else
                {
                    CoordenadaX = 0;
                    CoordenadaY = 0;
                }
            });
            GestoRotar = new UIRotationGestureRecognizer(() =>
            {
                if ((GestoRotar.State == UIGestureRecognizerState.Began || GestoRotar.State == UIGestureRecognizerState.Changed) &&
                    (GestoRotar.NumberOfTouches == 2))
                {
                    Imagen.Transform = CGAffineTransform.MakeRotation(GestoRotar.Rotation + Rotation);
                }
                else if (GestoRotar.State == UIGestureRecognizerState.Ended)
                {
                    Rotation = GestoRotar.Rotation;
                }
            });
            Imagen.AddGestureRecognizer(Gestomover);
            Imagen.AddGestureRecognizer(GestoRotar);
            Imagen.AddGestureRecognizer(GestoToque);
        }
        private void Pan(UIPanGestureRecognizer gesture)
        {
            var view        = gesture.View;
            var translation = gesture.LocationInView(view);
            var maxSize     = DrawView.Frame.Height;
            var y           = translation.Y;

            if (SelectDrawFigure.SelectedSegment != 2)
            {
                DrawView.MaxSize        = (float)maxSize;
                DrawView.SliderPosition = (float)maxSize - (float)translation.Y;
            }
            else
            {
                DrawView.MaxSize        = 360;
                DrawView.SliderPosition = degree((float)translation.Y, (float)translation.X);
            }
        }
Example #28
0
        private void OnPan(UIPanGestureRecognizer pan, Shared.Calendar calendar)
        {
            if (pan.State == UIGestureRecognizerState.Began)
            {
                var screenWidth       = UIScreen.MainScreen.Bounds.Width;
                var leftEdgeThreshold = screenWidth * 0.15f;

                var staringPoint = pan.LocationInView(null);
                if (staringPoint.X < leftEdgeThreshold)
                {
                    _isSwipingFromLeftEdge = true;
                }
            }

            if (pan.State != UIGestureRecognizerState.Ended)
            {
                return;
            }

            var velocity = pan.VelocityInView(null);

            // going right
            var isSwipingRight = velocity.X > 0;

            // going left
            var isSwipingLeft = velocity.X < 0;

            if (_isSwipingFromLeftEdge)
            {
                PullOutMainMenu();
                _isSwipingFromLeftEdge = false;
                return;
            }

            if (isSwipingRight && calendar != null)
            {
                SwipeFrame(calendar, true);
            }

            if (isSwipingLeft && calendar != null)
            {
                SwipeFrame(calendar, false);
            }
        }
Example #29
0
        private void onPan(UIPanGestureRecognizer gesture)
        {
            var point = gesture.LocationInView(CollectionView);

            switch (gesture.State)
            {
            case UIGestureRecognizerState.Began:
                panBegan(point);
                break;

            case UIGestureRecognizerState.Changed:
                panChanged(point);
                break;

            case UIGestureRecognizerState.Ended:
                panEnded();
                break;
            }
        }
Example #30
0
        void HandlePan(UIPanGestureRecognizer panGestureRecognizer)
        {
            if (_isSwipeEnabled && panGestureRecognizer != null)
            {
                CGPoint point = panGestureRecognizer.LocationInView(this);
                var     navigationController = GetUINavigationController(GetViewController());

                switch (panGestureRecognizer.State)
                {
                case UIGestureRecognizerState.Began:
                    if (navigationController != null)
                    {
                        navigationController.InteractivePopGestureRecognizer.Enabled = false;
                    }

                    HandleTouchInteractions(GestureStatus.Started, point);
                    break;

                case UIGestureRecognizerState.Changed:
                    HandleTouchInteractions(GestureStatus.Running, point);
                    break;

                case UIGestureRecognizerState.Ended:
                    if (navigationController != null)
                    {
                        navigationController.InteractivePopGestureRecognizer.Enabled = true;
                    }

                    HandleTouchInteractions(GestureStatus.Completed, point);
                    break;

                case UIGestureRecognizerState.Cancelled:
                    if (navigationController != null)
                    {
                        navigationController.InteractivePopGestureRecognizer.Enabled = true;
                    }

                    HandleTouchInteractions(GestureStatus.Canceled, point);
                    break;
                }
            }
        }
Example #31
0
        private void Pan(UIPanGestureRecognizer gesture)
        {
            var location = gesture.LocationInView(MainView);

            CAShapeLayer line = Draw(location);

            if (gesture.State == UIGestureRecognizerState.Began)
            {
                currentDrawBatchId = Guid.NewGuid();
            }

            _operations.Add(
                new Operation
            {
                Line        = line,
                DrawBatchId = currentDrawBatchId
            });

            DrawView.Layer.AddSublayer(line);
        }
Example #32
0
        public NodeTouchEvent(NodeUIView parent, UIPanGestureRecognizer pan)
        {
            switch (pan.State) {
            case UIGestureRecognizerState.Began:
                type = TouchType.Down;
                break;
            case UIGestureRecognizerState.Changed:
                type = TouchType.Move;
                break;
            case UIGestureRecognizerState.Ended:
                type = TouchType.Up;
                break;
            case UIGestureRecognizerState.Possible:
            case UIGestureRecognizerState.Cancelled:
            case UIGestureRecognizerState.Failed:
                break;
            }

            var p = pan.LocationInView (parent);
            point = new Point (p.X, p.Y);

            var velo = pan.VelocityInView (parent);
            velocity = new Vec2 (velo.X / 1000, velo.Y / 1000);
        }
Example #33
0
        public void SortingPanGestureUpdated(UIPanGestureRecognizer panGesture)
        {
            switch (panGesture.State)
            {
                case UIGestureRecognizerState.Ended:
                case UIGestureRecognizerState.Cancelled:
                case UIGestureRecognizerState.Failed:
                {
                    autoScrollActive = false;
                    break;
                }
                case UIGestureRecognizerState.Began:
                {
                    autoScrollActive = true;
                    SortingAutoScrollMovementCheck();

                    break;
                }
                case UIGestureRecognizerState.Changed:
                {
                    PointF translation = panGesture.TranslationInView(this);
                    PointF offset = translation;
                    PointF locationInScroll = panGesture.LocationInView(this);
                    sortMovingItem.Transform = CGAffineTransform.MakeTranslation(offset.X, offset.Y);
                    SortingMoveDidContinueToPoint(locationInScroll);

                    break;
                }
                default:
                    break;
            }
        }
        private void dismissingPanGestureRecognizerPanned(UIPanGestureRecognizer panner)
        {
            if (Flags.ScrollViewIsAnimatingAZoom || Flags.IsAnimatingAPresentationOrDismissal) 
                return;

            PointF translation = panner.TranslationInView (panner.View);
            PointF locationInView = panner.LocationInView (panner.View);
            PointF velocity = panner.VelocityInView (panner.View);
            float vectorDistance = (float)Math.Sqrt (Math.Pow (velocity.X, 2) + Math.Pow (velocity.Y, 2));

            if (panner.State == UIGestureRecognizerState.Began) {
                Flags.IsDraggingImage = ImageView.Frame.Contains (locationInView);
                if (Flags.IsDraggingImage)
                    StartImageDragging (locationInView, new UIOffset ());
            } else if (panner.State == UIGestureRecognizerState.Changed) {
                if (Flags.IsDraggingImage) {
                    PointF newAnchor = ImageDragStartingPoint;
                    newAnchor.X += translation.X + ImageDragOffsetFromActualTranslation.Horizontal;
                    newAnchor.Y += translation.Y + ImageDragOffsetFromActualTranslation.Vertical;
                    AttachmentBehavior.AnchorPoint = newAnchor;
                } else {
                    Flags.IsDraggingImage = ImageView.Frame.Contains (locationInView);
                    if (Flags.IsDraggingImage) {
                        UIOffset translationOffset = new UIOffset (-1 * translation.X, -1 * translation.Y);
                        StartImageDragging (locationInView, translationOffset);
                    }
                }
            } else {
                if (vectorDistance > JTSImageViewController.JTSImageViewController_MinimumFlickDismissalVelocity) {
                    if (Flags.IsDraggingImage) {
                        DismissImageWithFlick (velocity);
                    } else {
                        Dismiss (true);
                    }
                } else {
                    CancelCurrentImageDrag (true);
                }
            }
        }
 private void HandlePan(UIPanGestureRecognizer rec)
 {
     if (rec.State == UIGestureRecognizerState.Began)
     {
         HandleTouchesBeganAtLocation(rec.LocationInView(View));
     }
     else if (rec.State == UIGestureRecognizerState.Changed)
     {
         HandleTouchesMovedToLocation(rec.LocationInView(View));
     }
     else if (rec.State == UIGestureRecognizerState.Ended ||
              rec.State == UIGestureRecognizerState.Cancelled ||
              rec.State == UIGestureRecognizerState.Failed)
     {
         float velocity = rec.VelocityInView(View).X;
         if (Math.Abs(velocity) > kLWMinimumVelocityToTriggerSlide)
         {
             if (velocity > 0f)
             {
                 SlideOutSlideNavigationView();
             }
             else
             {
                 SlideInSlideNavigationView();
             }
         }
         else
         {
             HandleTouchesEndedAtLocation(rec.LocationInView(View));
         }
     }
 }
        /// <summary>
        /// Handles the pan gesture.
        /// </summary>
        void HandlePan(UIPanGestureRecognizer panGest)
        {
            var view = this.contentContainerView;

            if(!this.EnablePanGesture)
            {
                return;
            }

            if (panGest.State == UIGestureRecognizerState.Began)
            {
                this.panStartX = panGest.LocationInView(view).X;
            }
            else if (panGest.State == UIGestureRecognizerState.Changed && panStartX < PAN_GESTURE_REC_WIDTH)
            {
                float currentX = panGest.TranslationInView(view).X;
                if (currentX < PAN_GESTURE_THRESHOLD)
                {
                    if (currentX >= 0)
                    {
                        this.RevealMenu(currentX);
                        this.ShowDimView(true, currentX / WIDTH);
                    }
                }
                else
                {
                    // If dragged past threshold, fully show the menu.
                    this.ShowMenu(true);
                }
            }
            else if (panGest.State == UIGestureRecognizerState.Cancelled || panGest.State == UIGestureRecognizerState.Ended || panGest.State == UIGestureRecognizerState.Failed)
            {
                panStartX = 0f;
                if (!this.IsMenuVisible)
                {
                    // Hide if not panned past threshold.
                    this.ShowMenu(false);
                }
            }
        }
Example #37
0
        private void OnPan(UIPanGestureRecognizer recognizer)
        {
            if (recognizer.State == UIGestureRecognizerState.Began || recognizer.State == UIGestureRecognizerState.Changed)
            {
                _isInitialized = true;

                var stepLength = _background.Frame.Width / ((MaxValue - MinValue) / Step);

                var touchPoint = recognizer.LocationInView(this);

                UIView indicator = null;
                UIView touchArea = null;

                //Is this a slide to left or right?
                if (recognizer == _leftIndicatorGesture)
                {
                    indicator = _leftIndicator;
                    touchArea = _leftTouchArea;
                }
                else if (recognizer == _rightIndicatorGesture)
                {
                    indicator = _rightIndicator;
                    touchArea = _rightTouchArena;
                }

                if (recognizer.State == UIGestureRecognizerState.Began)
                {
                    _startX = (float)indicator.Center.X;
                }

                var cumulativeManipulation = touchPoint.X - _startX;
                var deltaManipulation = touchPoint.X - indicator.Center.X;

                if (deltaManipulation > 0 && cumulativeManipulation / stepLength > _lastStep ||
                    deltaManipulation < 0 && cumulativeManipulation / stepLength < _lastStep)
                {
                    if (deltaManipulation > 0)
                    {
                        _lastStep++;
                    }
                    else
                    {
                        _lastStep--;
                    }

                    var numberOfSteps = Math.Ceiling(deltaManipulation / stepLength);
                    var newPosition = new CGPoint(indicator.Center.X + stepLength * numberOfSteps, indicator.Center.Y);

                    var pixelStep = (MaxValue - MinValue) / Frame.Width;

                    if (touchPoint.X >= 0 && touchPoint.X <= _background.Frame.Width-10)
                    {

                        if (recognizer == _leftIndicatorGesture)
                        {

                            var newLeftValue = Round(MinValue + (pixelStep * newPosition.X));

                            if (newLeftValue >= RightValue)
                            {
                                return;
                            }
                        }
                        else if (recognizer == _rightIndicatorGesture)
                        {
                            var newRightValue = Round(MinValue + (pixelStep * newPosition.X));

                            if (newRightValue <= LeftValue)
                            {
                                return;
                            }
                        }

                        if (recognizer == _leftIndicatorGesture)
                        {
                            indicator.Center = newPosition;
                            touchArea.Center = newPosition;
                            var width = _rightIndicator.Center.X - _leftIndicator.Center.X;
                            _range.Frame = new CoreGraphics.CGRect(newPosition.X, _range.Frame.Y, width, _range.Frame.Height);
                        }
                        else if (recognizer == _rightIndicatorGesture)
                        {
                            indicator.Center = newPosition;
                            touchArea.Center = newPosition;
                            var width = _rightIndicator.Center.X - _leftIndicator.Center.X;
                            _range.Frame = new CoreGraphics.CGRect(_range.Frame.X, _range.Frame.Y, width, _range.Frame.Height);
                        }

                        LeftValue = Round(MinValue + (pixelStep * _leftIndicator.Center.X));
                        RightValue = Round(MinValue + (pixelStep * _rightIndicator.Center.X));

                        if (ValueChanging != null)
                        {
                            ValueChanging(this, new EventArgs());
                        }
                    }
                }
            }
            else if (recognizer.State == UIGestureRecognizerState.Ended)
            {
                if (ValueChanged != null)
                {
                    ValueChanged(this, new EventArgs());
                }

                _lastStep = 0;
            }
        }
		public void HandleTouchPan (UIPanGestureRecognizer gestureRecognizer)
		{
			if (gestureRecognizer.State == UIGestureRecognizerState.Ended) {
				GestureDidEnd ();
				return;
			}

			if (gestureRecognizer.State == UIGestureRecognizerState.Began) {
				GestureDidBegin ();
				return;
			}

			if (gestureRecognizer.NumberOfTouches == 2) {
				TiltCamera (gestureRecognizer.TranslationInView (View));
			} else {
				CGPoint p = gestureRecognizer.LocationInView (View);
				HandlePan (p);
			}
		}
		private bool PanGestureInActiveArea(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea) {
			var position = panGesture.LocationInView(ContentViewController.View).X;
			if (menuLocation == MenuLocations.Left)
				return position > gestureActiveArea;
			else
				return position < ContentViewController.View.Bounds.Width - gestureActiveArea;
		}
	//#pragma mark - Input.

	public void _handleHighlightGestureRecognizer( UIPanGestureRecognizer gestureRecognizer ){
		CGPoint point = gestureRecognizer.LocationInView(this);

		if (gestureRecognizer.State == UIGestureRecognizerState.Changed || gestureRecognizer.State == UIGestureRecognizerState.Ended) {
			foreach (UIButton button in this.buttonDictionary.Values) {
				bool  points = button.Frame.Contains( point) && !button.Hidden;

				if (gestureRecognizer.State == UIGestureRecognizerState.Changed) {
					button.Highlighted = points;
				} else {
						button.Highlighted = false;
				}

				if (gestureRecognizer.State == UIGestureRecognizerState.Ended && points) {
						button.SendActionForControlEvents(UIControlEvent.TouchUpInside);
				}
			}
		}
	}
        protected void pan(UIPanGestureRecognizer sender)
        {
            if (IsSigning) {
                _touchLocation = sender.LocationInView (this);
                PointF mid = BezierSignatureView.MidPoint (_touchLocation, _prevTouchLocation);

                switch (sender.State) {
                case UIGestureRecognizerState.Began:
                    {
                        _drawPath.MoveToPoint (_touchLocation);
                        break;
                    }
                case UIGestureRecognizerState.Changed:
                    {
                        _drawPath.AddQuadCurveToPoint (_prevTouchLocation.X, _prevTouchLocation.Y, mid.X, mid.Y);
                        IsSigning = true;
                        break;
                    }
                default:
                    {
                        break; }

                }
                _prevTouchLocation = _touchLocation;
                SetNeedsDisplay ();
            }
        }
Example #42
0
		public void OnPanGesture (UIPanGestureRecognizer sender)
		{
			var location = sender.LocationInView (sender.View);
			var position = GetOffsetPosition (new Vector2 (location.X, location.Y), true);

			var delta = position - _previousPanPosition.GetValueOrDefault (position);

			if (sender.State == UIGestureRecognizerState.Ended ||
			    sender.State == UIGestureRecognizerState.Cancelled ||
			    sender.State == UIGestureRecognizerState.Failed) {
				TouchPanel.GestureList.Enqueue (new GestureSample (
					GestureType.DragComplete, new TimeSpan (DateTime.Now.Ticks),
					position, Vector2.Zero,
					delta, Vector2.Zero));

				_previousPanPosition = null;
			} else {
				TouchPanel.GestureList.Enqueue (new GestureSample (
					GestureType.FreeDrag, new TimeSpan (DateTime.Now.Ticks),
					position, Vector2.Zero,
					delta, Vector2.Zero));
				_previousPanPosition = position;
			}
		}
Example #43
0
 public void PanGestureRecognizer(UIPanGestureRecognizer sender)
 {
     if (sender.State==UIGestureRecognizerState.Ended || sender.State==UIGestureRecognizerState.Cancelled || sender.State==UIGestureRecognizerState.Failed)
         TouchPanel.GestureList.Enqueue(new GestureSample(GestureType.DragComplete, new TimeSpan(_nowUpdate.Ticks), new Vector2 (sender.LocationInView (sender.View)), new Vector2(0,0), new Vector2 (sender.TranslationInView(sender.View)), new Vector2(0,0)));
     else
         TouchPanel.GestureList.Enqueue(new GestureSample(GestureType.FreeDrag, new TimeSpan(_nowUpdate.Ticks), new Vector2 (sender.LocationInView (sender.View)), new Vector2(0,0), new Vector2 (sender.TranslationInView(sender.View)), new Vector2(0,0)));
 }
Example #44
0
 public void PanGestureRecognizer(UIPanGestureRecognizer sender)
 {
     var enabledGestures = TouchPanel.EnabledGestures;
     if ((enabledGestures & GestureType.FreeDrag) != 0)
     {
         TouchPanel.GestureList.Enqueue(new GestureSample(GestureType.FreeDrag, new TimeSpan(_nowUpdate.Ticks), new Vector2 (sender.LocationInView (sender.View)), new Vector2(0,0), new Vector2 (sender.TranslationInView(sender.View)), new Vector2(0,0)));
     }
 }
Example #45
0
		void ResizeRegionOfInterestWithGestureRecognizer (UIPanGestureRecognizer pan)
		{
			var touchLocation = pan.LocationInView (pan.View);
			var oldRegionOfInterest = RegionOfInterest;

			switch (pan.State) {
			case UIGestureRecognizerState.Began:
				// When the gesture begins, save the corner that is closes to
				// the resize region of interest gesture recognizer's touch location.
				currentControlCorner = CornerOfRect (oldRegionOfInterest, touchLocation);
				break;


			case UIGestureRecognizerState.Changed:
				var newRegionOfInterest = oldRegionOfInterest;

				switch (currentControlCorner) {
				case ControlCorner.None:
					// Update the new region of interest with the gesture recognizer's translation.
					var translation = pan.TranslationInView (pan.View);
					// Move the region of interest with the gesture recognizer's translation.
					if (RegionOfInterest.Contains (touchLocation)) {
						newRegionOfInterest.X += translation.X;
						newRegionOfInterest.Y += translation.Y;
					}

					// If the touch location goes outside the preview layer,
					// we will only translate the region of interest in the
					// plane that is not out of bounds.
					var normalizedRect = new CGRect (0, 0, 1, 1);
					if (!normalizedRect.Contains (VideoPreviewLayer.PointForCaptureDevicePointOfInterest (touchLocation))) {
						if (touchLocation.X < RegionOfInterest.GetMinX () || touchLocation.X > RegionOfInterest.GetMaxX ()) {
							newRegionOfInterest.Y += translation.Y;
						} else if (touchLocation.Y < RegionOfInterest.GetMinY () || touchLocation.Y > RegionOfInterest.GetMaxY ()) {
							newRegionOfInterest.X += translation.X;
						}
					}

					// Set the translation to be zero so that the new gesture
					// recognizer's translation is in respect to the region of
					// interest's new position.
					pan.SetTranslation (CGPoint.Empty, pan.View);
					break;

				case ControlCorner.TopLeft:
					newRegionOfInterest = new CGRect (touchLocation.X, touchLocation.Y,
													 oldRegionOfInterest.Width + oldRegionOfInterest.X - touchLocation.X,
													 oldRegionOfInterest.Height + oldRegionOfInterest.Y - touchLocation.Y);
					break;

				case ControlCorner.TopRight:
					newRegionOfInterest = new CGRect (newRegionOfInterest.X,
												 touchLocation.Y,
												 touchLocation.X - newRegionOfInterest.X,
												 oldRegionOfInterest.Height + newRegionOfInterest.Y - touchLocation.Y);
					break;


				case ControlCorner.BottomLeft:
					newRegionOfInterest = new CGRect (touchLocation.X, oldRegionOfInterest.Y,
												 oldRegionOfInterest.Width + oldRegionOfInterest.X - touchLocation.X,
												 touchLocation.Y - oldRegionOfInterest.Y);
					break;

				case ControlCorner.BottomRight:
					newRegionOfInterest = new CGRect (oldRegionOfInterest.X, oldRegionOfInterest.Y,
												 touchLocation.X - oldRegionOfInterest.X,
												 touchLocation.Y - oldRegionOfInterest.Y);
					break;
				}

				// Update the region of intresest with a valid CGRect.
				SetRegionOfInterestWithProposedRegionOfInterest (newRegionOfInterest);
				break;

			case UIGestureRecognizerState.Ended:
				RegionOfInterestDidChange?.Invoke (this, EventArgs.Empty);

				// Reset the current corner reference to none now that the resize.
				// gesture recognizer has ended.
				currentControlCorner = ControlCorner.None;
				break;

			default:
				return;
			}
		}