private static int RouteExec(IInputElement routing, ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     return(RouteExec(
                (args, command) => command.CanExecute(args, routing),
                (args, command) => command.Execute(args, routing),
                ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
 }
Esempio n. 2
0
            public ToolStripBinding(ToolStripItem item,
                                    System.Windows.Input.RoutedCommand command,
                                    System.Windows.IInputElement input)
            {
                _item    = item;
                _command = command;
                _input   = input;

                _item.Click += Invoke;
                _command.CanExecuteChanged += EnableChanged;
            }
Esempio n. 3
0
 public static void DisplayContextMenu(Guid menuGroup, int contextMenuId, IInputElement routing)
 {
     Point position = Mouse.GetPosition(Application.Current.MainWindow);
     Point point2 = Application.Current.MainWindow.PointToScreen(position);
     ContextMenuRouter pCmdTrgtActive = new ContextMenuRouter(routing);
     IVsUIShell service = ServiceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell;
     POINTS[] pos = new POINTS[1];
     pos[0].x = (short)point2.X;
     pos[0].y = (short)point2.Y;
     Guid rclsidActive = menuGroup;
     service.ShowContextMenu(0, ref rclsidActive, contextMenuId, pos, pCmdTrgtActive);
 }
        public static void DisplayContextMenu(Guid menuGroup, int contextMenuId, IInputElement routing)
        {
            Point             position       = Mouse.GetPosition(Application.Current.MainWindow);
            Point             point2         = Application.Current.MainWindow.PointToScreen(position);
            ContextMenuRouter pCmdTrgtActive = new ContextMenuRouter(routing);
            IVsUIShell        service        = ServiceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell;

            POINTS[] pos = new POINTS[1];
            pos[0].x = (short)point2.X;
            pos[0].y = (short)point2.Y;
            Guid rclsidActive = menuGroup;

            service.ShowContextMenu(0, ref rclsidActive, contextMenuId, pos, pCmdTrgtActive);
        }
Esempio n. 5
0
 private static int RouteExec(IInputElement routing, ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     return RouteExec(
         (args, command) => command.CanExecute(args, routing),
         (args, command) => command.Execute(args, routing),
         ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
 }
 System.Windows.Point System.Windows.Input.IManipulator.GetPosition(System.Windows.IInputElement relativeTo)
 {
     return(default(System.Windows.Point));
 }
 public StylusPointCollection GetStylusPoints(System.Windows.IInputElement relativeTo, StylusPointDescription subsetToReformatTo)
 {
     return(default(StylusPointCollection));
 }
Esempio n. 8
0
        public void OnMouseUp(System.Windows.IInputElement sender, MouseButtonEventArgs e)
        {
            Point p = new Point((int)e.GetPosition(sender).X, (int)e.GetPosition(sender).Y);

            if (e.ChangedButton == MouseButton.Left)
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    return;
                }
                switch (CurrentMode)
                {
                case CurrentAction3d.CurAction3d_Nothing:
                    if (p.X == myXmin && p.Y == myYmin)
                    {
                        myXmax = p.X;
                        myYmax = p.Y;
                        if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
                        {
                            View.ShiftSelect();
                        }
                        else
                        {
                            View.Select();
                        }
                    }
                    else
                    {
                        myXmax = p.X;
                        myYmax = p.Y;
                        if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
                        {
                            MultiDragEvent(myXmax, myYmax, 1);
                        }
                        else
                        {
                            DragEvent(myXmax, myYmax, 1);
                        }
                    }
                    break;

                case CurrentAction3d.CurAction3d_DynamicZooming:
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_WindowZooming:
                    myXmax = p.X;
                    myYmax = p.Y;
                    int ValZWMin = 1;
                    if (Math.Abs(myXmax - myXmin) > ValZWMin &&
                        Math.Abs(myXmax - myYmax) > ValZWMin)
                    {
                        View.WindowFitAll(myXmin, myYmin, myXmax, myYmax);
                    }
                    RaiseZoomingFinished();
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_DynamicPanning:
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_GlobalPanning:
                    View.Place(p.X, p.Y, myCurZoom);
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    break;

                case CurrentAction3d.CurAction3d_DynamicRotation:
                    CurrentMode = CurrentAction3d.CurAction3d_Nothing;
                    if (!DegenerateMode)
                    {
                        View.SetDegenerateModeOff();
                    }
                    else
                    {
                        View.SetDegenerateModeOn();
                    }
                    break;

                default:
                    break;
                }
            }
            else if (e.ChangedButton == MouseButton.Right)
            {
                if (!DegenerateMode)
                {
                    View.SetDegenerateModeOff();
                }
                else
                {
                    View.SetDegenerateModeOn();
                }
            }

            SelectionChanged();
        }
Esempio n. 9
0
 private static int RouteQueryStatus(IInputElement routing, ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
 {
     return RouteQueryStatus((args, command) => command.CanExecute(args, routing), ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
 }
 public System.Windows.Point GetPosition(System.Windows.IInputElement relativeTo)
 {
     return(default(System.Windows.Point));
 }
 public TouchPointCollection GetTouchPoints(System.Windows.IInputElement relativeTo)
 {
     return(default(TouchPointCollection));
 }
 protected virtual new void OnCapture(System.Windows.IInputElement element, CaptureMode captureMode)
 {
 }
 public static void Unregister(string key, System.Windows.IInputElement element)
 {
 }
Esempio n. 14
0
 public ContextMenuRouter(IInputElement route)
 {
     this._route = route;
 }
 void AssociatedObject_PreviewTouchDown(object sender, TouchEventArgs e)
 {
     System.Windows.IInputElement s = sender as System.Windows.IInputElement;
     originalDistance = e.GetTouchPoint(s).Position.Y;
 }
 public TextComposition(InputManager inputManager, System.Windows.IInputElement source, string resultText, TextCompositionAutoComplete autoComplete)
 {
 }
 public KeyboardFocusChangedEventArgs(KeyboardDevice keyboard, int timestamp, System.Windows.IInputElement oldFocus, System.Windows.IInputElement newFocus) : base(default(KeyboardDevice), default(int))
 {
 }
 public abstract TouchPointCollection GetIntermediateTouchPoints(System.Windows.IInputElement relativeTo);
Esempio n. 19
0
 public void Execute(Object parameter, System.Windows.IInputElement target)
 {
 }
 public abstract TouchPoint GetTouchPoint(System.Windows.IInputElement relativeTo);
Esempio n. 21
0
 public static int GetIntermediatePoints(System.Windows.IInputElement relativeTo, System.Windows.Point[] points)
 {
     return(default(int));
 }
 public TouchPoint GetPrimaryTouchPoint(System.Windows.IInputElement relativeTo)
 {
     return(default(TouchPoint));
 }
Esempio n. 23
0
 public ContextMenuRouter(IInputElement route)
 {
     this._route = route;
 }
Esempio n. 24
0
 public bool CanExecute(Object parameter, System.Windows.IInputElement target)
 {
     return(default(bool));
 }
Esempio n. 25
0
 private static int RouteQueryStatus(IInputElement routing, ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
 {
     return(RouteQueryStatus((args, command) => command.CanExecute(args, routing), ref pguidCmdGroup, cCmds, prgCmds, pCmdText));
 }
Esempio n. 26
0
 public static bool Capture(System.Windows.IInputElement element, CaptureMode captureMode)
 {
     return(default(bool));
 }
Esempio n. 27
0
      public ToolStripBinding(ToolStripItem item,
        System.Windows.Input.RoutedCommand command,
        System.Windows.IInputElement input)
      {
        _item = item;
        _command = command;
        _input = input;

        _item.Click += Invoke;
        _command.CanExecuteChanged += EnableChanged;
      }
 public bool Capture(System.Windows.IInputElement element)
 {
     return(default(bool));
 }
 public static void SetFocusedElement(System.Windows.DependencyObject element, System.Windows.IInputElement value)
 {
 }
 public StylusPointCollection GetStylusPoints(System.Windows.IInputElement relativeTo)
 {
     return(default(StylusPointCollection));
 }
 public static void SetManipulationContainer(System.Windows.UIElement element, System.Windows.IInputElement container)
 {
 }
Esempio n. 32
0
        public void OnMouseDown(System.Windows.IInputElement sender, MouseButtonEventArgs e)
        {
            System.Windows.Controls.TabControl aTabControl = sender as System.Windows.Controls.TabControl;
            System.Windows.Controls.Grid       aGrid       = aTabControl.SelectedContent as System.Windows.Controls.Grid;

            Point p = new Point((int)e.GetPosition(aGrid).X, (int)e.GetPosition(aGrid).Y);

            // to avoid the context menu opening
            aTabControl.ContextMenu.Visibility = System.Windows.Visibility.Collapsed;
            aTabControl.ContextMenu.IsOpen     = false;

            if (e.LeftButton == MouseButtonState.Pressed)
            {
                myXmin = p.X;
                myXmax = p.X;
                myYmin = p.Y;
                myYmax = p.Y;

                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    // start the dinamic zooming....
                    CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
                }
                else
                {
                    switch (CurrentMode)
                    {
                    case CurrentAction3d.CurAction3d_Nothing:
                        if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
                        {
                            MultiDragEvent(myXmax, myYmax, -1);
                        }
                        else
                        {
                            DragEvent(myXmax, myYmax, -1);
                        }
                        break;

                    case CurrentAction3d.CurAction3d_DynamicRotation:
                        if (!DegenerateMode)
                        {
                            View.SetDegenerateModeOn();
                        }
                        View.StartRotation(p.X, p.Y);
                        break;

                    default:
                        break;
                    }
                }
            }
            else if (e.RightButton == MouseButtonState.Pressed)
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    if (!DegenerateMode)
                    {
                        View.SetDegenerateModeOn();
                    }
                    View.StartRotation(p.X, p.Y);
                }
                else
                {
                    // show context menu only in this case
                    aTabControl.ContextMenu.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }
 public static System.Windows.IInputElement Focus(System.Windows.IInputElement element)
 {
     return(default(System.Windows.IInputElement));
 }
Esempio n. 34
0
        public void OnMouseMove(System.Windows.IInputElement sender, System.Windows.Input.MouseEventArgs e)
        {
            Point p = new Point((int)e.GetPosition(sender).X, (int)e.GetPosition(sender).Y);

            if (e.LeftButton == MouseButtonState.Pressed) //left button is pressed
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    View.Zoom(myXmax, myYmax, p.X, p.Y);
                    myXmax = p.X;
                    myYmax = p.Y;
                }
                else
                {
                    switch (CurrentMode)
                    {
                    case CurrentAction3d.CurAction3d_Nothing:
                        myXmax = p.X;
                        myYmax = p.Y;
                        break;

                    case CurrentAction3d.CurAction3d_DynamicZooming:
                        View.Zoom(myXmax, myYmax, p.X, p.Y);
                        myXmax = p.X;
                        myYmax = p.Y;
                        break;

                    case CurrentAction3d.CurAction3d_WindowZooming:
                        myXmax = p.X;
                        myYmax = p.Y;
                        break;

                    case CurrentAction3d.CurAction3d_DynamicPanning:
                        View.Pan(p.X - myXmax, myYmax - p.Y);
                        myXmax = p.X;
                        myYmax = p.Y;
                        break;

                    case CurrentAction3d.CurAction3d_GlobalPanning:
                        break;

                    case CurrentAction3d.CurAction3d_DynamicRotation:
                        View.Rotation(p.X, p.Y);
                        View.RedrawView();
                        break;

                    default:
                        break;
                    }
                }
            }
            else if (e.MiddleButton == MouseButtonState.Pressed) //middle button is pressed
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    View.Pan(p.X - myXmax, myYmax - p.Y);
                    myXmax = p.X;
                    myYmax = p.Y;
                }
            }
            else if (e.RightButton == MouseButtonState.Pressed) //right button is pressed
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    View.Rotation(p.X, p.Y);
                }
            }
            else // no buttons are pressed
            {
                myXmax = p.X;
                myYmax = p.Y;
                View.MoveTo(p.X, p.Y);
            }
        }
Esempio n. 35
0
 public ViewModel(System.Windows.IInputElement displayArea_)
 {
     displayArea = displayArea_;
 }