Example #1
0
        public void OnTouchStart(ElementEvent e)
        {
            TouchEvent ev = (TouchEvent)(object)e;
            ev.PreventDefault();
            ev.StopPropagation();

              //  Document.Title = "touched by an event ";

            lastX = ev.TargetTouches[0].PageX;
            lastY = ev.TargetTouches[0].PageY;

            if (ev.TargetTouches.Length == 2)
            {
                isPintching = true;
                return;
            }
            else if (uiController != null)
            {

                WWTElementEvent ee = new WWTElementEvent(lastX, lastY);

                if (uiController.MouseDown(this, (ElementEvent)(object)ee))
                {
                    mouseDown = false;
                    dragging = false;
                    return;
                }
            }

            mouseDown = true;
        }
Example #2
0
        public void OnTouchEnd(ElementEvent e)
        {
            //      Document.Title = "touched by an event ";
            TouchEvent ev = (TouchEvent)e;
            ev.PreventDefault();
            ev.StopPropagation();

            rect = new Vector2d[2];

            if (isPintching)
            {
                if (ev.Touches.Length < 2)
                {
                    isPintching = false;
                }
                return;
            }

            if (uiController != null)
            {

                WWTElementEvent ee = new WWTElementEvent(lastX, lastY);

                if (uiController.MouseUp(this, (ElementEvent)(object)ee))
                {
                    mouseDown = false;
                    dragging = false;
                    return;
                }
            }

            mouseDown = false;
            dragging = false;
        }