Exemplo n.º 1
0
        void Ellipse_TouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            if (runHandler)
            {
                /*
                 * this.Vx = 0;
                 * this.Vy = 0;
                 */

                // Capture to the ellipse.
                e.TouchDevice.Capture(sender as Ellipse);
                timer.Start();
                this.IsTouched = true;

                // Remember this contact if a contact has not been remembered already.
                // This contact is then used to move the ellipse around.
                if (ellipseControlTouchDevice == null)
                {
                    ellipseControlTouchDevice = e.TouchDevice;

                    // Remember where this contact took place.
                    lastPoint = ellipseControlTouchDevice.GetTouchPoint(this.mainCanvas).Position;
                }

                enterTouchPoint = ellipseControlTouchDevice.GetTouchPoint(this.mainCanvas).Position;

                // Mark this event as handled.
                // e.Handled = true;
            }
        }
Exemplo n.º 2
0
        private void Canvas_TouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            if (touchdowncounter == 1)
            {
                endTime = DateTime.Now;
                span    = endTime.Subtract(startTime);
            }
            if (touchdowncounter == 0)
            {
                startTime = DateTime.Now;
            }

            touchdowncounter++;
            if (touchdowncounter == 2 && span.Milliseconds <= 145)
            {
                touchdowncounter = 0;
                Storyboard TagHelpText = (Storyboard)FindResource("showcard");

                TagHelpText.Begin(this);
            }


            if (touchdowncounter == 2)
            {
                touchdowncounter = 0;
            }

            Console.WriteLine("First " + span.Milliseconds);
        }
Exemplo n.º 3
0
 private void Button_TouchDown(object sender, TouchEventArgs e)
 {
     e.Handled = true;
  //   e.RoutedEvent.RoutingStrategy = RoutingStrategy.Direct;
     Config.WriteXml(App.config, "config.xml");
     this.NavigationService.GoBack();
 }
Exemplo n.º 4
0
        } //

        public void OnTouchDown(object xSender, TouchEventArgs e)
        {
            Canvas lCanvas = xSender as Canvas;
            if (lCanvas == null) return;

            TouchPoint lTouchPoint = e.GetTouchPoint(lCanvas);
            if (lTouchPoint == null) return;

            myTuple lTuple = _PointA;
            if (lTuple != null)
            {
                if (lTuple.Item1 == e.TouchDevice.Id) return; // this was finger 1, not going to happen anyway as it cannot touchdown twice
                Point lPointA = lTuple.Item2;

                // store second finger; we don't care about its ID, so it could also be finger 3, 4 or 5 ...
                Point lPointB = lTouchPoint.Position;
                _PointB = new myTuple(e.TouchDevice.Id, lPointB);
                RedrawRectangle(lPointA, lPointB);
                return;
            }

            // first finger
            DrawNewRectangle(lCanvas, lTouchPoint.Position, lTouchPoint.TouchDevice.Id);
            return;
        } //
Exemplo n.º 5
0
 private void RecordTouchDown(object sender, TouchEventArgs e)
 {
     _touchPoints++;
     _recordRotation = true;
     System.Windows.Input.TouchPoint touchPoint = e.GetTouchPoint(this);
     System.Windows.Point point = touchPoint.Position;
     _recordY = point.Y;
     if (_touchPoints == 2)
     {
         if (!_isPlaying)
         {
             channel.PlaySample();
             _isPlaying = true;
         }
         else
         {
             channel.StopSample();
             _isPlaying = false;
         }
         _twoTouchLock = true;
     }
     if (_touchPoints == 1)
     {
         if (channel.IsPlaying())
             channel.Pause();
     }
 }
Exemplo n.º 6
0
        private async void LessonContainer_TouchDown(object sender, TouchEventArgs e)
        {
            // Forward touch events to container
            //FrameworkElement control = sender as FrameworkElement;
            //control.CaptureTouch(e.TouchDevice);
            if (LayerStackDC.CurrentState.FingerInkingEnabled)
            {
                LessonContainer.IsContentManipulationEnabled = false;
                return;
            }

            // Saves current touch information
            //touchDevices.Add(e.TouchDevice);
            touchOrigin = e.GetTouchPoint(LessonContainer).Position;

            // Disable manipulation/drawing
            //LessonContainer.IsContentManipulationEnabled = false;
            LayerStackDC.ContainerTouchDown();

            // If touch-and-hold (within 10px radius circle, over 500ms)
            if (await TouchHelper.TouchHold(e, LessonContainer, 500, 10))
            {
                // Opens RadialMenu
                LessonContainer.IsContentManipulationEnabled = false;
                LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(),
                    e.GetTouchPoint(LessonContainer).Position, RadialMenuState.Levels.Main);

                // Un-forward touch events to container
                //control.ReleaseAllTouchCaptures();
            }
        }
        /// <summary>
        /// Handles the PreviewTouchUp event of the ScrollViewer control.
        /// </summary>
        /// <param name="sender">Event source</param>
        /// <param name="e">Event argument</param>
        private void ScrollViewer_PreviewTouchUp(object sender, TouchEventArgs e)
        {
            try
            {
                var touchEnd = e.GetTouchPoint(this);

                var scrollviewer = sender as ScrollViewer;

                double distance = touchEnd.Position.Y - this.touchStartForScrollViewer.Position.Y;

                if (Math.Abs(distance) > ThresholdDistanceForSwipe)
                {
                    if (distance > 0)
                    {
                        if (scrollviewer != null)
                        {
                            scrollviewer.PageUp();
                        }
                    }
                    else
                    {
                        if (scrollviewer != null)
                        {
                            scrollviewer.PageDown();
                        }
                    }
                }

                e.Handled = true;
            }
            catch
            {
                // Do nothing.
            }
        }
Exemplo n.º 8
0
        private void UcPhotoContactTap(object sender, TouchEventArgs e)
        {
            if (Feature is PhotoFeature)
            {
                var pf = (PhotoFeature) Feature;
                var fe = new FloatingElement
                             {
                                 Document = new Document {FileType = FileTypes.image, Location = pf.ImageUrl},
                                 OpacityDragging = 0.5,
                                 OpacityNormal = 1.0,
                                 CanMove = true,
                                 CanRotate = true,
                                 CanScale = true,
                                 StartOrientation = e.Device.GetOrientation(Application.Current.MainWindow) + 90,
                                 Background = Brushes.DarkOrange,
                                 MaxSize = new Size(500, (500.0/pf.Width)*pf.Height),
                                 StartPosition = e.TouchDevice.GetTouchPoint(Application.Current.MainWindow).Position,
                                 StartSize = new Size(200, (200.0/pf.Width)*pf.Height),
                                 MinSize = new Size(100, (100.0/pf.Width)*pf.Height),
                                 ShowsActivationEffects = false,
                                 RemoveOnEdge = true,
                                 Contained = true,
                                 Title = pf.Name,
                                 Foreground = Brushes.White,
                                 DockingStyle = DockingStyles.None,
                             };
                AppStateSettings.Instance.FloatingItems.Add(fe);
                //State.AddFloatingElement(new CoFile() { Location = pf.ImageUrl, Id = pf.Id, Name = pf.Name }, (pf.Width/2), (pf.Height/2));
            }

        }
 private void OnMoreInfoImageTouched(object sender, TouchEventArgs e)
 {
     System.Windows.Controls.Image img = e.OriginalSource as System.Windows.Controls.Image;
     if (img == null) return;
     OpenWithTask.ShowDetail(img);
     e.Handled = true;
 }
Exemplo n.º 10
0
        private void OnTouchMove(object sender, TouchEventArgs e)
        {
            if (!_AlreadySwiped)
            {

                var touch = e.GetTouchPoint(_ParentControl);

                //right now a swipe is 200 pixels

                //Swipe Left
                if (_TouchStart != null && touch.Position.X > (_TouchStart.Position.X + 200))
                {
                    if (OnSwipeLeft != null)
                        OnSwipeLeft(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }

                //Swipe Right
                if (_TouchStart != null && touch.Position.X < (_TouchStart.Position.X - 200))
                {
                    if (OnSwipeRight != null)
                        OnSwipeRight(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }
            }
            //e.Handled = true;
        }
Exemplo n.º 11
0
 protected override void OnPreviewTouchDown(TouchEventArgs e)
 {
     // Release any previous capture
     this.ReleaseCurrentDevice();
     // Capture the new touch
     this.CaptureCurrentDevice(e);
 }
Exemplo n.º 12
0
        private void MotionButton_TouchEnter(object sender, TouchEventArgs e)
        {
            StartTimer();
            _lastTouchDevice = e.Device;

            ScaleDown();
        }
Exemplo n.º 13
0
 protected override void OnTouchDown(TouchEventArgs e)
 {
     this.CaptureTouch(e.TouchDevice);
     card.CardControler.TouchDownCard(this,e);
     e.Handled = true;
     base.OnTouchDown(e);
 }
        /// <summary>
        /// Event triggered when the NoteBubbleGenerator is touch.
        /// Generates a new NoteBubble according to the MostNeeded algorithm.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">TouchEventArgs</param>
        public void touchDown(object sender, TouchEventArgs e)
        {
            if (GlobalVariables.MaxMelodyBubbles > MelodyBubbleVMs.Count)
            {
                List<MelodyBubble> bubblesList = new List<MelodyBubble>();
                foreach (MelodyBubbleViewModel nbvm in MelodyBubbleVMs)
                    bubblesList.Add(nbvm.MelodyBubble);
                MelodyBubble newBubble = MelodyBubbleGenerator.CreateMelodyBubble(bubblesList);
                MelodyBubbleViewModel mbVM = new MelodyBubbleViewModel(newBubble, SessionVM.Bubbles, SessionVM);
                MelodyBubbleVMs.Add(mbVM);
                SessionVM.Bubbles.Items.Add(mbVM.SVItem);
            }
            else
            {
                MelodyBubbleViewModel toRemove = MelodyBubbleVMs.First();
                MelodyBubbleVMs.Remove(toRemove);
                SessionVM.Bubbles.Items.Remove(toRemove.SVItem);
                List<MelodyBubble> bubblesList = new List<MelodyBubble>();
                foreach (MelodyBubbleViewModel nbvm in MelodyBubbleVMs)
                    bubblesList.Add(nbvm.MelodyBubble);
                MelodyBubble newBubble = MelodyBubbleGenerator.CreateMelodyBubble(bubblesList);
                MelodyBubbleViewModel mbVM = new MelodyBubbleViewModel(newBubble, SessionVM.Bubbles, SessionVM);
                MelodyBubbleVMs.Add(mbVM);
                SessionVM.Bubbles.Items.Add(mbVM.SVItem);
            }

            String effect = "pop" + (new Random()).Next(1, 5).ToString();
            AudioController.PlaySoundWithString(effect);
        }
Exemplo n.º 15
0
        protected override void OnTouchUp(TouchEventArgs e)
        {
            _currentAngle = _currentAngle + _angle;

            //Pass the message up
            base.OnTouchUp(e);
        }
 private void ButtonPin_TouchUp(object sender, TouchEventArgs e)
 {
     // TagRemovedBehavior = TagRemovedBehavior.Persist;
     ButtonPin.Visibility = Visibility.Hidden;
     isPinned = true;
     PinButtonClicked(this, e);
 }
Exemplo n.º 17
0
 private void HandleTouch(TouchEventArgs e)
 {
     var visual = GetTouchVisual(e.TouchDevice.Id);
     var point = e.GetTouchPoint(this.fingerCanvas).Position;
     visual.SetValue(Canvas.LeftProperty, point.X);
     visual.SetValue(Canvas.TopProperty, point.Y);
 }
Exemplo n.º 18
0
        private void MriList_PreviewTouchDown(object sender, TouchEventArgs e)
        {
            FrameworkElement findSource = e.OriginalSource as FrameworkElement;
            SurfaceListBoxItem draggedElement = null;

            // Find the touched SurfaceListBoxItem object.
            while (draggedElement == null && findSource != null)
            {
                if ((draggedElement = findSource as SurfaceListBoxItem) == null)
                {
                    findSource = VisualTreeHelper.GetParent(findSource) as FrameworkElement;
                }
            }

            if (draggedElement == null)
            {
                return;
            }

            // Create the cursor visual.
            ContentControl cursorVisual = new ContentControl()
            {
                Content = draggedElement.DataContext,
                Style = FindResource("CursorStyle") as Style
            };

            // Add a handler. This will enable the application to change the visual cues.
            SurfaceDragDrop.AddTargetChangedHandler(cursorVisual, OnTargetChanged);

            // Create a list of input devices. Add the touches that
            // are currently captured within the dragged element and
            // the current touch (if it isn't already in the list).
            List<InputDevice> devices = new List<InputDevice>();
            devices.Add(e.TouchDevice);
            foreach (TouchDevice touch in draggedElement.TouchesCapturedWithin)
            {
                if (touch != e.TouchDevice)
                {
                    devices.Add(touch);
                }
            }

            // Get the drag source object
            ItemsControl dragSource = ItemsControl.ItemsControlFromItemContainer(draggedElement);

            SurfaceDragCursor startDragOkay =
                SurfaceDragDrop.BeginDragDrop(
                  dragSource,                 // The SurfaceListBox object that the cursor is dragged out from.
                  draggedElement,             // The SurfaceListBoxItem object that is dragged from the drag source.
                  cursorVisual,               // The visual element of the cursor.
                  draggedElement.DataContext, // The data associated with the cursor.
                  devices,                    // The input devices that start dragging the cursor.
                  DragDropEffects.Move);      // The allowed drag-and-drop effects of the operation.

            // If the drag began successfully, set e.Handled to true.
            // Otherwise SurfaceListBoxItem captures the touch
            // and causes the drag operation to fail.
            e.Handled = (startDragOkay != null);
        }
Exemplo n.º 19
0
        protected override void OnPreviewTouchDown(TouchEventArgs e)
        {
            //오브젝트 선택
            TouchPoint pt = e.GetTouchPoint(this);
            this.HitTestHelper.SelectItemAt(pt.Position);

            base.OnPreviewTouchDown(e);
        }
Exemplo n.º 20
0
        protected override void OnTouchDown(TouchEventArgs e)
        {
            _touchOrigin = e.TouchDevice.GetTouchPoint(this).Position;
            _angle = 0;

            //Pass the Message Up
            base.OnTouchDown(e);
        }
 bool activity_item_selected(object i, TouchEventArgs e)
 {
     item_generic_v2 item = (item_generic_v2)i;
     string[] activity_item = ("activity;" + item.ToString()).Split(new Char[] { ';' });
     log.WriteInteractionLog(15, "tapped the listbox item: " + item.ToString(), e.TouchDevice);
     window_manager.open_activity_window(activity_item[3], Convert.ToInt32(activity_item[1]), 65, item.PointToScreen(new Point(0, 0)).Y);
     return true;
 }
Exemplo n.º 22
0
 protected override void OnTouchDown(TouchEventArgs e)
 {
     _touchPoints++;
     if (_touchPoints == 2) _twoFingersDown = true;
     isSelected = true;
     //Pass the Message Up
     base.OnTouchDown(e);
 }
Exemplo n.º 23
0
 protected override void OnTouchUp(TouchEventArgs e)
 {
     _touchPoints--;
     _twoFingersDown = false;
     isSelected = false;
     //Pass the message up
     base.OnTouchUp(e);
 }
Exemplo n.º 24
0
        public void layoutRoot_TouchDown(object sender, TouchEventArgs e)
        {
            TouchPoint p = e.GetTouchPoint(GestureFramework.LayoutRoot);
            TouchInfo info = p.ToTouchInfo();
            UIElement source = e.OriginalSource as UIElement;

            base.AddNewTouchPoint(info, source);
        }
Exemplo n.º 25
0
 private void CaptureCurrentDevice(TouchEventArgs e)
 {
     bool gotTouch = this.CaptureTouch(e.TouchDevice);
     if (gotTouch)
     {
         this.currentDevice = e.TouchDevice;
     }
 }
Exemplo n.º 26
0
        public PointerEventArgs(TouchEventArgs touchEventArgs, MouseEventArgs mouseEventArgs)
        {
            if (touchEventArgs == null && mouseEventArgs==null)
                throw new ArgumentNullException();

            _touchEventArgs = touchEventArgs;
            _mouseEventArgs = mouseEventArgs;
        }
Exemplo n.º 27
0
 private void CaptureCurrentDevice(TouchEventArgs e)
 {
     var gotTouch = CaptureTouch(e.TouchDevice);
     if (gotTouch)
     {
         _currentDevice = e.TouchDevice;
     }
 }
Exemplo n.º 28
0
 void btnCancel_TouchUp(object sender, System.Windows.Input.TouchEventArgs e)
 {
     try
     {
         CancelClicked();
     }
     catch { }
 }
Exemplo n.º 29
0
 void btnReset_TouchUp(object sender, System.Windows.Input.TouchEventArgs e)
 {
     try
     {
         ResetClicked();
     }
     catch { }
 }
 /// <summary>
 /// Event wird aufgerufen wenn TouchMove auf Tab.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Eventparameter</param>
 private void NavigationTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
     if (e.TouchDevice == NavigationTouchDevice)
     {
         UpdateNavigationPreview(NavigationTouchDevice.GetTouchPoint(this.NavigationGrid).Position);
     }
     // Mark this event as handled.
     e.Handled = true;
 }
Exemplo n.º 31
0
 protected override void OnTouchUp(TouchEventArgs e)
 {
     base.OnTouchUp(e);
     // Освобождаем захваченное устройство
     canvas.ReleaseTouchCapture(e.TouchDevice);
     // Удаляем изображение с холста и из словаря
     canvas.Children.Remove(fingerprints[e.TouchDevice]);
     fingerprints.Remove(e.TouchDevice);
 }
        public void PreprocessTouchDown(TouchEventArgs e) {
            _currentTapPosition = GetAdjustedPosition(e, _history.VisualComponent.TextView);
            _elapsedSinceLastTap = _doubleTapStopWatch.Elapsed;
            _doubleTapStopWatch.Restart();

            HandleLeftButtonDown(e);

            _lastTapPosition = _currentTapPosition;
        }
 /// <summary>
 /// Event wird aufgerufen bei TouchMove auf Tabs.
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Eventparameter</param>
 private void CategoryTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
     if (e.TouchDevice == CategoryTouchDevice)
     {
         UpdateCategoryPreview(CategoryTouchDevice.GetTouchPoint(this.CategoryGrid).Position);
     }
     // Mark this event as handled.
     e.Handled = true;
 }
Exemplo n.º 34
0
        private void Grid_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            if (e.IsDoubleTap(this, ref _lastTapLocation, _doubleTapStopwatch))
            {
                SendMessage(0xFFFF, 0x112, 0xF170, 2);
            }

            //SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2)
        }
Exemplo n.º 35
0
        private void Slider_TouchDown(object sender, TouchEventArgs e)
        {
            VisualStateManager.GoToState((FrameworkElement)sender, "Pressed", true);

            var slider = (Slider)sender;
            slider.SetPositionByControlPoint(e.GetTouchPoint(slider).Position);
            slider.CaptureTouch(e.TouchDevice);
            e.Handled = true;
        }
Exemplo n.º 36
0
 protected override void OnLostTouchCapture(TouchEventArgs e)
 {
     // Only re-capture if the reference is not null
     // This way we avoid re-capturing after calling ReleaseCurrentDevice()
     if (this.currentDevice != null)
     {
         this.CaptureCurrentDevice(e);
     }
 }
Exemplo n.º 37
0
        private void canvas_TouchMove(object sender, TouchEventArgs e)
        {
            // Get the ellipse that corresponds to the current touch-down.
            Ellipse ellipse = movingEllipses[e.TouchDevice.Id];

            // Move it to the new touch-down point.
            TouchPoint touchPoint = e.GetTouchPoint(canvas);
            Canvas.SetTop(ellipse, touchPoint.Bounds.Top);
            Canvas.SetLeft(ellipse, touchPoint.Bounds.Left);
        }
 private void ScrollViewer_TouchUp(object sender, System.Windows.Input.TouchEventArgs e)
 {
     if (!TouchMoved)
     {
         e.Handled = false;
     }
     else
     {
         e.Handled = true;
     }
 }
Exemplo n.º 39
0
        protected override void OnTouchMove(System.Windows.Input.TouchEventArgs e)
        {
            int        id         = e.TouchDevice.Id;
            TouchPoint touchPoint = e.GetTouchPoint(this);

            System.Diagnostics.Debug.WriteLine(string.Format("id:{0} x:{1} y:{2}", id, touchPoint.Position.X, touchPoint.Position.Y));

            base.OnTouchMove(e);

            e.Handled = true;
        }
Exemplo n.º 40
0
        protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e)
        {
            var releasedPosition = e.TouchDevice.GetTouchPoint(null).Position;

            if (Math.Abs(releasedPosition.X - this.pointerPressedPosition.X) > 5)
            {
                return;
            }
            this.SetCurrentPage();
            base.OnTouchUp(e);
        }
Exemplo n.º 41
0
 private void _internetAccessBrowser_TouchDown(object sender, System.Windows.Input.TouchEventArgs e)
 {
     try
     {
         Control control = (Control)sender;
         e.TouchDevice.Capture(control);
         windowTouchDevice = e.TouchDevice;
         var currentTouchPoint = windowTouchDevice.GetTouchPoint(null);
         var locationOnScreen  = control.PointToScreen(new System.Windows.Point(currentTouchPoint.Position.X, currentTouchPoint.Position.Y));
         lastPoint = locationOnScreen;
     }
     catch { }
 }
        /// <summary>
        /// Event wird aufgerufen bei TouchDown auf Tabs.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Eventparameter</param>
        private void CategoryTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            // Capture to the ScaleButton.
            e.TouchDevice.Capture(this.CategoryGrid);

            // Remember this contact if a contact has not been remembered already.
            // This contact is then used to move the ellipse around.
            if (CategoryTouchDevice == null)
            {
                CategoryTouchDevice = e.TouchDevice;
                UpdateCategoryPreview(CategoryTouchDevice.GetTouchPoint(this.CategoryGrid).Position);
            }
            // Mark this event as handled.
            e.Handled = true;
        }
        /// <summary>
        /// Event wird aufgerufen wenn TouchUp auf Tab.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Eventparameter</param>
        private void NavigationTouchUp(object sender, System.Windows.Input.TouchEventArgs e)
        {
            // If this contact is the one that was remembered
            if (e.TouchDevice == NavigationTouchDevice)
            {
                // Forget about this contact.
                NavigationTouchDevice = null;

                if (CurrentNavigation != PreviewNavigation)
                {
                    SwitchNavigation(PreviewNavigation);
                }
            }
            // Mark this event as handled.
            e.Handled = true;
        }
        /// <summary>
        /// Event wird aufgerufen bei TouchUp auf Tabs.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Eventparameter</param>
        private void CategoryTouchUp(object sender, System.Windows.Input.TouchEventArgs e)
        {
            // If this contact is the one that was remembered
            if (e.TouchDevice == CategoryTouchDevice)
            {
                // Forget about this contact.
                CategoryTouchDevice = null;

                if (_currentCategory != previewCategory)
                {
                    SwitchCategory(previewCategory);
                }
            }
            // Mark this event as handled.
            e.Handled = true;
        }
        private void ShowHideTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            // Capture to the HideShowButton.
            e.TouchDevice.Capture(this.ShowHideButton);
            // Remember this contact if a contact has not been remembered already.
            if (_moveTouchDevice == null)
            {
                _moveTouchDevice = e.TouchDevice;

                // Remember where this contact took place.
                TouchDownPoint = _moveTouchDevice.GetTouchPoint(this.MainGrid).Position;
            }

            // Mark this event as handled.
            e.Handled = true;
        }
Exemplo n.º 46
0
        private void TextEditor_TouchUp(object sender, System.Windows.Input.TouchEventArgs e)
        {
            var endPoint = e.GetTouchPoint(TextEditor);
            int start, length;

            if (endPoint.Position.Y > _startPoint.Position.Y)
            {
                start  = TextEditor.GetCharacterIndexFromPoint(_startPoint.Position, true);
                length = TextEditor.GetCharacterIndexFromPoint(endPoint.Position, true) - start;
            }
            else
            {
                start  = TextEditor.GetCharacterIndexFromPoint(endPoint.Position, true);
                length = TextEditor.GetCharacterIndexFromPoint(_startPoint.Position, true) - start + 1;
            }
            TextEditor.Select(start, length);
        }
Exemplo n.º 47
0
 private void MainWindow_TouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
     if (this.touchDownPoint.HasValue)
     {
         Point pos = e.GetTouchPoint(this).Position;
         if (this.touchDownPoint.Value.X - pos.X >= 200)
         {
             this.DrillUp();
             this.touchDownPoint = null;
         }
         else if (pos.X - this.touchDownPoint.Value.X >= 200)
         {
             this.DrillDown();
             this.touchDownPoint = null;
         }
     }
 }
Exemplo n.º 48
0
        private void _internetAccessBrowser_TouchMove(object sender, System.Windows.Input.TouchEventArgs e)
        {
            try
            {
                Control control = (Control)sender;

                var currentTouchPoint = windowTouchDevice.GetTouchPoint(null);

                var locationOnScreen = control.PointToScreen(new System.Windows.Point(currentTouchPoint.Position.X, currentTouchPoint.Position.Y));

                var deltaX = locationOnScreen.X - lastPoint.X;
                var deltaY = locationOnScreen.Y - lastPoint.Y;

                lastPoint = locationOnScreen;

                _internetAccessBrowser.SendMouseWheelEvent((int)lastPoint.X, (int)lastPoint.Y, (int)deltaX, (int)deltaY, CefEventFlags.None);
            }
            catch { }
        }
        private void ShowHideTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
        {
            //    if (e.TouchDevice == _moveTouchDevice)
            //    {
            //        Point newTouchPoint = e.TouchDevice.GetTouchPoint(this.MainGrid).Position;

            //        if (_isShown)
            //        {
            //            if (newTouchPoint.X - TouchDownPoint.X > 0)
            //            {
            //                HideMoveEvent(this, new MoveAreaAndControlEventArgs(newTouchPoint.X - TouchDownPoint.X));
            //            }
            //        }
            //        else
            //            if (TouchDownPoint.X - newTouchPoint.X > 0)
            //            {
            //                ShowMoveEvent(this, new MoveAreaAndControlEventArgs(newTouchPoint.X - TouchDownPoint.X));
            //            }
            //    }
        }
Exemplo n.º 50
0
        void Ellipse_TouchMove(object sender, System.Windows.Input.TouchEventArgs e)
        {
            if (runHandler)
            {
                if (e.TouchDevice == this.ellipseControlTouchDevice)
                {
                    if (timerReset == 10)
                    {
                        timer.Stop();
                        timer.Start();
                        timerReset = 0;
                    }

                    Ellipse x = sender as Ellipse;

                    timerReset++;

                    // Get the current position of the contact.
                    Point currentTouchPoint = ellipseControlTouchDevice.GetCenterPosition(this.mainCanvas);

                    // Get the change between the controlling contact point and
                    // the changed contact point.
                    deltaX = currentTouchPoint.X - lastPoint.X;
                    deltaY = currentTouchPoint.Y - lastPoint.Y;

                    // Get and then set a new top position and a new left position for the ellipse.
                    this.Position = new Vector(this.Position.X + (int)deltaX, this.Position.Y + (int)deltaY);

                    // Forget the old contact point, and remember the new contact point.
                    lastPoint = currentTouchPoint;

                    // Mark this event as handled.
                    // e.Handled = true;
                    if (!this.affectedByGravity)
                    {
                        this.gravPosition = this.Position;
                    }
                }
            }
        }
Exemplo n.º 51
0
        protected virtual void Ellipse_TouchLeave(object sender, System.Windows.Input.TouchEventArgs e)
        {
            if (runHandler)
            {
                // If this contact is the one that was remembered
                if (e.TouchDevice == this.ellipseControlTouchDevice)
                {
                    // Forget about this contact.
                    ellipseControlTouchDevice = null;

                    this.IsTouched = false;
                }
                releasePoint = e.TouchDevice.GetTouchPoint(this.mainCanvas).Position;
                double deltaTouchDownReleaseX = Math.Abs(releasePoint.X - enterTouchPoint.X);
                double deltaTouchDownReleaseY = Math.Abs(releasePoint.Y - enterTouchPoint.Y);


                if (this.affectedByGravity)
                {
                    this.Velocity = new Vector(deltaX * 3, deltaY * 3);
                }

                if (deltaTouchDownReleaseX < 5 && deltaTouchDownReleaseY < 5)
                {
                    isPressingMovement = true;
                }
                else
                {
                    isPressingMovement = false;
                }

                timer.Stop();

                // Mark this event as handled.
                // e.Handled = true;
            }
        }
 private void ShowHideTouchUp(object sender, System.Windows.Input.TouchEventArgs e)
 {
     if (e.TouchDevice == _moveTouchDevice)
     {
         Point newTouchPoint = e.TouchDevice.GetTouchPoint(this.MainGrid).Position;
         _moveTouchDevice = null;
         if (_isShown)
         {
             if (newTouchPoint.X - TouchDownPoint.X > 50)
             {
                 // pass event to SurfaceWindow1.xaml.cs
                 AnimateMarginEvent(this, new AnimateAreaAndControlEventArgs(false));
                 _isShown = false;
             }
         }
         else
         if (TouchDownPoint.X - newTouchPoint.X > 50)
         {
             // pass event to SurfaceWindow1.xaml.cs
             AnimateMarginEvent(this, new AnimateAreaAndControlEventArgs(true));
             _isShown = true;
         }
     }
 }
 private void ScrollViewer_TouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
     MoverScrollByTouch(e);
 }
Exemplo n.º 54
0
 private static void Input_Up(object sender, System.Windows.Input.TouchEventArgs e)
 {
     ResetAdorner();
 }
Exemplo n.º 55
0
 private void AxisControl_Clicked(object sender, System.Windows.Input.TouchEventArgs e)
 {
     CheckClick(sender, (EventArgs)e);
 }
Exemplo n.º 56
0
 private void Keyboard_TouchDown(object sender, System.Windows.Input.TouchEventArgs e)
 {
     bin_textBox.Focus();
 }
Exemplo n.º 57
0
 private void Home_Click(object sender, System.Windows.Input.TouchEventArgs e)
 {
     Home();
 }
Exemplo n.º 58
0
 private void Go_Click(object sender, System.Windows.Input.TouchEventArgs e)
 {
     Go();
 }
Exemplo n.º 59
0
 private void OnVisualizationAdded(object sender, System.Windows.Input.TouchEventArgs e)
 {
 }
Exemplo n.º 60
0
 private void ShowHideTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
 }