示例#1
1
        void mouseZone_MouseMove(object sender, MouseEventArgs e)
        {
            if (IsActive)
            {
                _viewport.Cursor = Cursors.None;

                var centerOfViewport = _viewport.PointToScreen(new Point(_viewport.ActualWidth / 2, _viewport.ActualHeight / 2));
                var relativePos = e.MouseDevice.GetPosition(_viewport);
                var actualRelativePos = new Point(relativePos.X - _viewport.ActualWidth / 2, _viewport.ActualHeight / 2 - relativePos.Y);
                var dx = actualRelativePos.X;
                var dy = actualRelativePos.Y;
                _yaw += dx;
                _pitch += dy;
                
                // Rotate
                Rotation = QuaternionHelper.EulerAnglesInDegToQuaternion(_pitch * Sensitivity * 0.1, _yaw * Sensitivity * 0.1, 0);
                
                // Set mouse position back to the center of the viewport in screen coordinates
                MouseUtilities.SetPosition(centerOfViewport);
            }
            else
            {
                _viewport.Cursor = Cursors.Arrow;
            }
        }
        ITextViewLine GetTextViewLineUnderPoint(MouseEventArgs e)
        {
            Point viewPoint = RelativeToView(e.GetPosition(view.VisualElement));

            return view.TextViewLines.GetTextViewLineContainingYCoordinate(
                viewPoint.Y);
        }
示例#3
0
        private void btnSpinner_MouseEnter(object sender, MouseEventArgs e)
        {
            if (!isSpinning)
            {
                isSpinning = true;

                // Make a double animation object, and register
                // with the Completed event.
                DoubleAnimation dblAnim = new DoubleAnimation();
                dblAnim.Completed += (o, s) => { isSpinning = false; };

                // Button has 4 seconds to finish the spin!
                dblAnim.Duration = new Duration(TimeSpan.FromSeconds(4));

                // Set the start value and end value.
                dblAnim.From = 0;
                dblAnim.To = 360;

                // Now, create a RotateTransform object, and set
                // it to the RenderTransform property of our
                // button
                RotateTransform rt = new RotateTransform();
                btnSpinner.RenderTransform = rt;

                // Now, animation the RotateTransform object.
                rt.BeginAnimation(RotateTransform.AngleProperty, dblAnim);
            }
        }
 private void PART_LAYOUT2_MouseEnter(object sender, MouseEventArgs e)
 {
     if(PART_DOCKING_RIGHT_BTN1.Visibility == Visibility.Visible)
     {
         PART_LAYOUT1.Visibility = Visibility.Collapsed;
     }
 }
示例#5
0
 private void Slider_OnMouseMove(object sender, MouseEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         ui.ViewModel.WorkspaceViewModel.HasUnsavedChanges = true;
     }
 }
        public LegendMouseEventArgs(MouseEventArgs e)
        {   
            DataPoint = null;
            DataSeries = null;
            MouseEventArgs = e;

            // Set the DataPoint or DataSeries reference from ElementData
            if (e != null)
            {
                ElementData elementData = (e.OriginalSource as FrameworkElement).Tag as ElementData;

                if (elementData != null && elementData.Element != null)
                {
                    Type elementType = elementData.Element.GetType();

                    if (elementType.Equals(typeof(DataSeries)))
                    {
                        // Set DataSeries reference
                        DataSeries = (DataSeries)elementData.Element;
                    }
                    else if (elementType.Equals(typeof(DataPoint)))
                    {
                        // Set DataPoint reference
                        DataPoint = (DataPoint)elementData.Element;
                    }
                }
            }
        }
示例#7
0
 /// <summary>
 /// Handle the MouseMove event for the UIElement to update the drag operation
 /// </summary>
 private void TargetElement_MouseMove(object sender, MouseEventArgs e)
 {
     if (_draggingActive)
     {
         OnDragDelta(e);
     }
 }
示例#8
0
 public void ListViewItem_MouseLeave(object sender, MouseEventArgs e)
 {
     ListViewItem listViewItem = (ListViewItem)sender;
     MoveScore moveScore = (MoveScore)listViewItem.Content;
     var viewModel = DataContext as MainViewModel;
     viewModel.UnhighlightMove(moveScore.Move);
 }
示例#9
0
		void OnMiddleMouseMove(object sender, MouseEventArgs e)
		{
			if (e.MiddleButton == MouseButtonState.Pressed)
			{
				MiddleButtonScrollHelper.UpdateScrolling(e);
			}
		}
示例#10
0
		void OnMiddleMouseLeave(object sender, MouseEventArgs e)
		{
			if (e.MiddleButton == MouseButtonState.Pressed)
			{
				MiddleButtonScrollHelper.StopScrolling();
			}
		}
 private void picture_MouseEnter(object sender, MouseEventArgs e)
 {
     Image image = sender as Image;
     if (image.Source == null)
         return;
     bigPic.Source = image.Source;
 }
        public void DoubleClickHandler(object sender, MouseEventArgs e)
        {
            var selectedTraining = sender as ListBoxItem;
            var training = (Training)selectedTraining.DataContext;

            trainingSelectedEvent(training);
        }
示例#13
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            if (downPoint != null)
            {
                Point dragPoint = e.GetPosition(this);

                if (dragPoint.Y > downPoint.Value.Y)
                {
                    this.SetIsDraggingUp(true);
                    this.SetIsDraggingDown(false);
                }
                else
                {
                    this.SetIsDraggingUp(false);
                    this.SetIsDraggingDown(true);
                }

                if (dragPoint.Y - downPoint.Value.Y > this.DragThreshold)
                {
                    downPoint = dragPoint;
                    Next();

                }

                else if (dragPoint.Y - downPoint.Value.Y < (this.DragThreshold * -1))
                {
                    downPoint = dragPoint;
                    Previous();
                }
            }

            base.OnMouseMove(e);
        }
 /// <summary>
 /// Raises the ThrottledMouseMove event
 /// </summary>
 protected void OnThrottledMouseMove(MouseEventArgs args)
 {
   if (ThrottledMouseMove != null)
   {
     ThrottledMouseMove(_element, args);
   }
 }
示例#15
0
 private void txbConcurso_MouseEnter(object sender, MouseEventArgs e)
 {
     _descripcion =
         "Inicia el concurso actual con los parámetros previamente definidos en las configuraciones generales.";
     txbDescripcion.Text = _descripcion;
     //imgPreview.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\admin_pantallas.png"));
 }
示例#16
0
 private void txbConfig_MouseEnter(object sender, MouseEventArgs e)
 {
     _descripcion =
         "Cambia el nombre de concurso, las cápsulas informativas, carga los equipos a concursar y las preguntas a usar; la cantidad de tiempo por pregunta y el número de ellas por ronda";
     txbDescripcion.Text = _descripcion;
     //imgPreview.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\config.png"));
 }
        /// <summary>
        /// Handles OnMouseMove to auto-select the item that's being moused over
        /// </summary>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            var window = this.GetWindow();

            // If the cursor is currently hidden, don't bother reacting to it
            if (Cursor == Cursors.None || window.Cursor == Cursors.None)
            {
                return;
            }

            // Store the last position for comparison purposes
            // Even if the mouse is not moving this event will fire as elements are showing and hiding
            var pos = e.GetPosition(window);

            if (!_lastMouseMovePoint.HasValue)
            {
                _lastMouseMovePoint = pos;
                return;
            }

            if (pos == _lastMouseMovePoint)
            {
                return;
            }

            _lastMouseMovePoint = pos;

            Focus();
        }
示例#18
0
        private void txbPreguntas_MouseEnter(object sender, MouseEventArgs e)
        {
            _descripcion = "Captura las preguntas que serán usadas en el concurso";
            txbDescripcion.Text = _descripcion;

            //imgPreview.Source = new BitmapImage(new Uri("admin_preguntas.png"));
        }
示例#19
0
 private void btn_MouseLeave(object sender, MouseEventArgs e)
 {
     tb.Visibility = Visibility.Hidden;
     tb.Text = sPlaceHolder;
     pb.Visibility = Visibility.Visible;
     pb.Focus();
 }
        private void ChartMouseMove(object sender, MouseEventArgs e)
        {
            var point = Chart.ConvertToChartValues(e.GetPosition(Chart));

            X.Text = point.X.ToString("N");
            Y.Text = point.Y.ToString("N");
        }
 private void Boat1_MouseEnter(object sender, MouseEventArgs e)
 {
     if (playerProfile.CampaignProgress >=1)
     {
         StoryBlock.Text = "Fight the frost giants back!";
     }
 }
示例#22
0
 private void MenuPanel_MouseLeave(object sender, MouseEventArgs e)
 {
     if (!IsActive)
     {
         VisualStateManager.GoToState(this, "MouseOut", true);
     }
 }
示例#23
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            // if mouse button is not pressed we have no drag operation, ...
            if (e.LeftButton != MouseButtonState.Pressed)
                this.rubberbandSelectionStartPoint = null;

            // ... but if mouse button is pressed and start
            // point value is set we do have one
            if (this.rubberbandSelectionStartPoint.HasValue)
            {
                // create rubberband adorner
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    RubberbandAdorner adorner = new RubberbandAdorner(this, rubberbandSelectionStartPoint);
                    if (adorner != null)
                    {
                        adornerLayer.Add(adorner);
                    }
                }
            }
            e.Handled = true;
        }
示例#24
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (e.LeftButton != MouseButtonState.Pressed)
                this.dragStartPoint = null;

            if (this.dragStartPoint.HasValue)
            {
                // XamlWriter.Save() has limitations in exactly what is serialized,
                // see SDK documentation; short term solution only;
                string xamlString = XamlWriter.Save(this.Content);
                DragObject dataObject = new DragObject();
                dataObject.Xaml = xamlString;

                WrapPanel panel = VisualTreeHelper.GetParent(this) as WrapPanel;
                if (panel != null)
                {
                    // desired size for DesignerCanvas is the stretched Toolbox item size
                    double scale = 1.3;
                    dataObject.DesiredSize = new Size(panel.ItemWidth * scale, panel.ItemHeight * scale);
                }

                DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Copy);

                e.Handled = true;
            }
        }
示例#25
0
 private void myPath_MouseDown(object sender, MouseEventArgs e)
 {
     mouseVerticalPosition = e.GetPosition(scene).Y;
     mouseHorizontalPosition = e.GetPosition(scene).X;
     isDragging = true;
     ((Path)sender).CaptureMouse();
 }
        private void OnGridPreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (CheckIgnoreGridMove.IsChecked == true && !IsButton1Source(e)) return;

            ShowStatus(nameof(OnGridPreviewMouseMove), e);
            e.Handled = CheckStopPreview.IsChecked == true;
        }
示例#27
0
 private void Grip_MouseMove(object sender, MouseEventArgs e)
 {
     if (Grip.IsMouseCaptured)
     {
         this.Height = e.GetPosition(this).Y;
     }
 }
        public void OpenOperationEditWindow(object sender, MouseEventArgs args)
        {
            if (OperationStopwatch != null && OperationStopwatch.ElapsedMilliseconds > 600)
            {
                operationCount = 0;
            }
            if (operationCount == 0)
            {
                OperationStopwatch = Stopwatch.StartNew();
                operationCount++;
            }
            else if (operationCount == 1)
            {
                int elapsedMilliseconds = (int)OperationStopwatch.ElapsedMilliseconds;
                operationCount = 0;
                if (elapsedMilliseconds <= (int)GetDoubleClickTime())
                {
                    TextBlock textBlock = sender as TextBlock;
                    ITestItemViewModel testItemViewModel = textBlock.DataContext as ITestItemViewModel;
                    ICommand editOperationCommand = testItemViewModel.EditOperationCommand;
                    editOperationCommand.Execute(null);

                }
            }
        }
        private void contentView_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            var senderObj = sender as ScoreboardControl;

            if (senderObj == null)
            {
                // This shouldn't happen.
                return;
            }

            // Get the current mouse position
            Point mousePos = e.GetPosition(null);
            Vector diff = this.startPoint - mousePos;

            if (e.LeftButton == MouseButtonState.Pressed &&
                (Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
                Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance))
            {
                string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "starboard.xbs");

               if (File.Exists(path) == false)
               {
                   return;
               }

                var strCol = new StringCollection { path };

                var o = new DataObject(DataFormats.FileDrop, strCol);
                o.SetFileDropList(strCol);
                DragDrop.DoDragDrop(senderObj, o, DragDropEffects.Copy);
            }
        }
示例#30
0
 private void Button_MouseEnter(object sender, MouseEventArgs e)
 {
     if (((Button)sender).Content != null)
     {
         ((Button)sender).Background = App.Current.Resources["PhoneBorderBrush"] as SolidColorBrush;
     }
 }
 private void sliderAngle_LostMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
 {
     captureMode = 1;
 }
示例#32
0
 private void imageRight_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     imageRight.Effect = null;
 }
示例#33
0
 private void SliderStereo_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     Txb_File_Text       = Txb_File.Text;
     Txb_File.Text       = "balance: " + (int)(mediaPlayer.Balance * 100);
     insideBalanceSlider = true;
 }
示例#34
0
 private void Slider_Vol_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     Txb_File.Text      = Txb_File_Text;
     insideVolumeSlider = false;
 }
示例#35
0
 private void Slider_Vol_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     Txb_File_Text      = Txb_File.Text;
     Txb_File.Text      = "volume: " + (int)(mediaPlayer.Volume * 100);
     insideVolumeSlider = true;
 }
示例#36
0
 private void EnemyTemLeft_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     TemTraitsGrid.Visibility = Visibility.Collapsed;
 }
        private void textBlock_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            if (mDraged)
            {
                var screenPos = new ResourceLibrary.Win32.POINT();
                ResourceLibrary.Win32.GetCursorPos(ref screenPos);
                if (screenPos.Y <= mMouseDownScreenRect.Top)
                {
                    screenPos.Y = mMouseDownScreenRect.Bottom - 1;
                    ResourceLibrary.Win32.SetCursorPos(screenPos.X, screenPos.Y);
                    mScreenHeightCount--;
                }
                else if (screenPos.Y >= mMouseDownScreenRect.Bottom)
                {
                    screenPos.Y = mMouseDownScreenRect.Top + 1;
                    ResourceLibrary.Win32.SetCursorPos(screenPos.X, screenPos.Y);
                    mScreenHeightCount++;
                }

                var pos = e.GetPosition((UIElement)sender);
                pos.Y += mScreenHeightCount * mMouseDownScreenRect.Height;
                if (mMouseMoved == false)
                {
                    var length = pos.Y - mMouseLeftButtonDownPoint.Y;
                    if (System.Math.Abs(length) > 0)
                    {
                        mMouseMoved = true;
                    }
                }

                var delta = mMouseLeftButtonDownPoint.Y - pos.Y;

                Attribute attr = null;
                if (BindProperty != null)
                {
                    attr = BindProperty.Attributes[typeof(EngineNS.Editor.Editor_MultipleOfTwoAttribute)] as EngineNS.Editor.Editor_MultipleOfTwoAttribute;
                }
                if (attr != null)
                {
                    if (System.Math.Abs(delta) > 10)
                    {
                        if (NumericObject.GetType() == typeof(SByte))
                        {
                            if (delta > 0)
                            {
                                var value = (SByte)NumericObject;
                                NumericObject = (SByte)(value * 2);
                            }
                            else
                            {
                                var value = (SByte)NumericObject;
                                NumericObject = (SByte)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Int16))
                        {
                            if (delta > 0)
                            {
                                var value = (Int16)NumericObject;
                                NumericObject = (Int16)(value * 2);
                            }
                            else
                            {
                                var value = (Int16)NumericObject;
                                NumericObject = (Int16)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Int32))
                        {
                            if (delta > 0)
                            {
                                var value = (Int32)NumericObject;
                                NumericObject = (Int32)(value * 2);
                            }
                            else
                            {
                                var value = (Int32)NumericObject;
                                NumericObject = (Int32)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Int64))
                        {
                            if (delta > 0)
                            {
                                var value = (Int64)NumericObject;
                                NumericObject = (Int64)(value * 2);
                            }
                            else
                            {
                                var value = (Int64)NumericObject;
                                NumericObject = (Int64)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Byte))
                        {
                            if (delta > 0)
                            {
                                var value = (Byte)NumericObject;
                                NumericObject = (Byte)(value * 2);
                            }
                            else
                            {
                                var value = (Byte)NumericObject;
                                NumericObject = (Byte)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(UInt16))
                        {
                            if (delta > 0)
                            {
                                var value = (UInt16)NumericObject;
                                NumericObject = (UInt16)(value * 2);
                            }
                            else
                            {
                                var value = (UInt16)NumericObject;
                                NumericObject = (UInt16)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(UInt32))
                        {
                            if (delta > 0)
                            {
                                var value = (UInt32)NumericObject;
                                NumericObject = (UInt32)(value * 2);
                            }
                            else
                            {
                                var value = (UInt32)NumericObject;
                                NumericObject = (UInt32)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(UInt64))
                        {
                            if (delta > 0)
                            {
                                var value = (UInt64)NumericObject;
                                NumericObject = (UInt64)(value * 2);
                            }
                            else
                            {
                                var value = (UInt64)NumericObject;
                                NumericObject = (UInt64)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Single))
                        {
                            if (delta > 0)
                            {
                                var value = (Single)NumericObject;
                                NumericObject = (Single)(value * 2);
                            }
                            else
                            {
                                var value = (Single)NumericObject;
                                NumericObject = (Single)(value / 2);
                            }
                        }
                        else if (NumericObject.GetType() == typeof(Double))
                        {
                            if (delta > 0)
                            {
                                var value = (Double)NumericObject;
                                NumericObject = (Double)(value * 2);
                            }
                            else
                            {
                                var value = (Double)NumericObject;
                                NumericObject = (Double)(value / 2);
                            }
                        }

                        mMouseLeftButtonDownPoint = pos;
                    }
                }
                else
                {
                    //if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
                    //    delta *= 2;
                    if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                    {
                        delta /= 20;
                    }

                    if (NumericObject.GetType() == typeof(SByte))
                    {
                        SByte value = (SByte)mValueStore;
                        value += (SByte)delta;
                        if (IsShiftDown)
                        {
                            value = (SByte)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Int16))
                    {
                        Int16 value = (Int16)mValueStore;
                        value += (Int16)delta;
                        if (IsShiftDown)
                        {
                            value = (Int16)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Int32))
                    {
                        Int32 value = (Int32)mValueStore;
                        value += (Int32)delta;
                        if (IsShiftDown)
                        {
                            value = (Int32)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Int64))
                    {
                        Int64 value = (Int64)mValueStore;
                        value += (Int64)delta;
                        if (IsShiftDown)
                        {
                            value = (Int64)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Byte))
                    {
                        Byte value = (Byte)mValueStore;
                        value += (Byte)delta;
                        if (IsShiftDown)
                        {
                            value = (Byte)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(UInt16))
                    {
                        UInt16 value = (UInt16)mValueStore;
                        value += (UInt16)delta;
                        if (IsShiftDown)
                        {
                            value = (UInt16)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(UInt32))
                    {
                        UInt32 value = (UInt32)mValueStore;
                        value += (UInt32)delta;
                        if (IsShiftDown)
                        {
                            value = (UInt32)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(UInt64))
                    {
                        UInt64 value = (UInt64)mValueStore;
                        value += (UInt64)delta;
                        if (IsShiftDown)
                        {
                            value = (UInt64)(value / 5 * 5);
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Single))
                    {
                        Single value = (Single)mValueStore;
                        value += (Single)delta;
                        if (IsShiftDown)
                        {
                            value = (int)value / 5 * 5;
                        }
                        NumericObject = value;
                    }
                    else if (NumericObject.GetType() == typeof(Double))
                    {
                        Double value = (Double)mValueStore;
                        value += delta;
                        if (IsShiftDown)
                        {
                            value = (int)value / 5 * 5;
                        }
                        NumericObject = value;
                    }
                }

                e.Handled = true;
            }
        }
示例#38
0
 private void MainCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     MoveLines(e);
 }
 private void GuiCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     Y = ConvertPointToPoint(e.GetPosition(this));
     RefreshRectangleSelection();
 }
示例#40
0
 private void imageRight_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     imageRight.Effect = new DropShadowEffect();
 }
        private void canvas_MouseMove(object sender, MouseEventArgs e)
        {
            Point position = e.GetPosition(canvas);

            label.Content = position.X.ToString() + " , " + position.Y.ToString();
        }
示例#42
0
 private void DrawNumber(object sender, System.Windows.Input.MouseEventArgs e)
 {
     textField.Foreground = NextColor();
     textField.Text       = rand.Next(1, 101).ToString();
 }
示例#43
0
 private void can_Show_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     this.glow.Opacity = 1;
 }
示例#44
0
 private void can_Delete_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     this.glow1.Opacity = 0;
 }
示例#45
0
 private void cv_MouseLeave(object sender, MouseEventArgs e)
 {
 }
示例#46
0
 private void MatrixImage_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     //    DrawPixel();
 }
示例#47
0
        //public void SetGotMouseFocusHandler(Action action)
        //{
        //    GotMouseFocusHandler = action;
        //    this.MouseEnter += GnosisCalendarWPF_MouseEnter;
        //}



        private void GnosisCalendarWPF_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            //GotMouseFocusHandler.Invoke();
            HasMouseFocus = true;
        }
示例#48
0
        //public void SetLostMouseFocusHandler(Action action)
        //{
        //    LostMouseFocusHandler = action;
        //    this.MouseLeave += GnosisCalendarWPF_MouseLeave;
        //}

        private void GnosisCalendarWPF_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            //LostMouseFocusHandler.Invoke();
            HasMouseFocus = false;
        }
示例#49
0
        //private void overlayForm_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    System.Windows.Forms.Cursor.Show();
        //}

        //private void overlayForm_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    System.Windows.Forms.Cursor.Hide();
        //}

        private void overlayForm_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            System.Windows.Point pos = e.GetPosition(this.overlayForm);
            MouseMove((int)(pos.X / this.scaleX), (int)(pos.Y / this.scaleY));
        }
 protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e)
 {
     base.OnMouseLeave(e);
     _isMouseDown = false;
 }
示例#51
0
 public override void _presenter_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (pressedMouseLeftButtonDown)
     {
         Point       cur     = e.GetPosition(_inkCanvas);
         StylusPoint current = new StylusPoint(cur.X, cur.Y);
         double      dist1   = MathTool.getInstance().distanceP2P(center, current);
         double      dist2   = MathTool.getInstance().distanceP2P(center, _prepoint);
         if (dist2 == 0)
         {
             dist2 = 1;
         }
         double scaling = dist1 / dist2;
         if (selectedStrokes.Count > 0)   //笔迹处理
         {
             foreach (MyStroke myStroke in selectedStrokes)
             {
                 ZoomCommand zc = new ZoomCommand(myStroke, scaling);
                 zc.execute();
             }
         }
         if (selectedImages.Count > 0)    //图片处理
         {
             foreach (MyImage image in selectedImages)
             {
                 ImageZoomCommand izc = new ImageZoomCommand(image, scaling);
                 izc.execute();
                 image.adjustBound();
                 foreach (ImageConnector connector in image.ConnectorCollection)
                 {
                     connector.adjustConnector();
                 }
             }
         }
         if (selectedButtons.Count > 0)    //button处理
         {
             foreach (MyButton myButton in selectedButtons)
             {
                 ButtonZoomCommand bzc = new ButtonZoomCommand(myButton, scaling, _inkCollector, 1);
                 bzc.execute();
             }
         }
         //piemenu移动
         double dist3 = MathTool.getInstance().distanceP2P(center, current);
         double dist4 = MathTool.getInstance().distanceP2P(center, _startPoint);
         if (dist4 == 0)
         {
             dist4 = 1;
         }
         double scaling2 = dist3 / dist4;
         _inkCollector._mainPage.OperatePieMenu.Margin = new System.Windows.Thickness(_inkCollector.BoundSelect.Margin.Left + _inkCollector.BoundSelect.Width * scaling2, _inkCollector._mainPage.OperatePieMenu.Margin.Top, 0, 0);
         if (_inkCollector._mainPage.OperatePieMenu.Margin.Top < _inkCanvas.Margin.Top)       //上面
         {
             _inkCollector._mainPage.OperatePieMenu.Margin = new Thickness(_inkCollector._mainPage.OperatePieMenu.Margin.Left, 10, 0, 0);
         }
         //右边
         if (_inkCollector._mainPage.OperatePieMenu.Margin.Left > _inkCanvas.Margin.Left + _inkCanvas.ActualWidth - _inkCollector._mainPage.OperatePieMenu.ActualWidth)
         {
             _inkCollector._mainPage.OperatePieMenu.Margin = new Thickness(_inkCanvas.Margin.Left + _inkCanvas.ActualWidth - _inkCollector._mainPage.OperatePieMenu.ActualWidth, _inkCollector._mainPage.OperatePieMenu.Margin.Top, 0, 0);
         }
         _prepoint = current;
     }
 }
示例#52
0
 void d2Cursor_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     e.Handled = true;
 }
示例#53
0
 private void SliderStereo_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     Txb_File.Text       = Txb_File_Text;
     insideBalanceSlider = false;
 }
        private void _resizer_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            UIElement dragElement = sender as UIElement;

            if (dragElement.IsMouseCaptured)
            {
                Point       ptMoveDrag      = e.GetPosition(dragElement);
                AnchorStyle CorrectedAnchor = Anchor;

                if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft)
                {
                    CorrectedAnchor = AnchorStyle.Right;
                }
                else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft)
                {
                    CorrectedAnchor = AnchorStyle.Left;
                }

                double deltaX = FlowDirection == FlowDirection.LeftToRight ? ptMoveDrag.X - ptStartDrag.X : ptStartDrag.X - ptMoveDrag.X;

                double newWidth  = Width;
                double newHeight = Height;

                double newLeft = Left;
                double newTop  = Top;

                if (CorrectedAnchor == AnchorStyle.Left)
                {
                    if (newWidth + deltaX < 4.0)
                    {
                        newWidth = 4.0;
                    }
                    else
                    {
                        newWidth += deltaX;
                    }
                }
                else if (CorrectedAnchor == AnchorStyle.Top)
                {
                    if (newHeight + (ptMoveDrag.Y - ptStartDrag.Y) < 4.0)
                    {
                        newHeight = 4.0;
                    }
                    else
                    {
                        newHeight += ptMoveDrag.Y - ptStartDrag.Y;
                    }
                }
                else if (CorrectedAnchor == AnchorStyle.Right)
                {
                    if (newWidth - (deltaX) < 4)
                    {
                        newLeft  = originalLeft + originalWidth - 4;
                        newWidth = 4;
                    }
                    else
                    {
                        newLeft  += deltaX;
                        newWidth -= deltaX;
                    }
                }
                else if (CorrectedAnchor == AnchorStyle.Bottom)
                {
                    if (newHeight - (ptMoveDrag.Y - ptStartDrag.Y) < 4)
                    {
                        newTop    = originalTop + originalHeight - 4;
                        newHeight = 4;
                    }
                    else
                    {
                        newTop    += ptMoveDrag.Y - ptStartDrag.Y;
                        newHeight -= ptMoveDrag.Y - ptStartDrag.Y;
                    }
                }

                //ResizingPanel.SetResizeHeight(ReferencedPane, ReferencedPane.ActualHeight);
                //ResizingPanel.SetResizeWidth(ReferencedPane, ReferencedPane.ActualWidth);

                Width  = Math.Min(newWidth, MaxWidth);
                Height = Math.Min(newHeight, MaxHeight);

                Left = Math.Max(newLeft, MinLeft);
                Top  = Math.Max(newTop, MinTop);

                ApplyRegion(new Rect(0, 0, this.Width, this.Height));
            }
        }
示例#55
0
 private void StartNumberTextBox_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     StatusLabel.Text = applicationMessage;
 }
示例#56
0
 private void GridStats_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     GridStats.Background = new SolidColorBrush(Color.FromArgb(0x10, 0xb0, 0xb0, 0xb0));
 }
示例#57
0
 private void StartNumberTextBox_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     StatusLabel.Text = StartNumberTextBox.Tag.ToString();
 }
示例#58
0
 private void GridStats_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     GridStats.Background = new SolidColorBrush(Colors.Transparent);
 }
示例#59
0
 private void MailButton_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     StatusLabel.Text = applicationMessage;
 }
 private void Ellipse_MouseEnter(object sender, MouseEventArgs e)
 {
     myMediaElement.Stop();
 }