Пример #1
0
 internal MouseButtonEventArgs(OpenTK.Input.MouseButtonEventArgs e)
 {
     Button    = (Mouse.Button)e.Button;
     IsPressed = e.IsPressed;
     Position  = new Vector2(e.X, e.Y);
     Mouse     = new Mouse(e.Mouse);
 }
Пример #2
0
 protected override void OnMouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (!this.mundo.clickedPolygon(e.X, e.Y))
     {
         this.mundo.AddVertex(e.X, e.Y, 1);
     }
 }
Пример #3
0
        public override void OnDoubleClick(OpenTK.Input.MouseButtonEventArgs e)
        {
            if (e.Button != OpenTK.Input.MouseButton.Left)
            {
                return;
            }

            if (PointCatched != null)
            {
                if (!bMouseDownFlag)
                {
                    return;
                }
            }
            else
            {
                if (LastMouseDownWasItem)                   // Yeah, das geht gut.
                {
                    return;
                }

                bool bControlPressed = ModifierKeys.ControlPressed;
                if ((EditMode == PlotterEditModes.editMove || EditMode == PlotterEditModes.editErase) && !bControlPressed)
                {
                    AddPoint(e.X - Bounds.Left, e.Y - Bounds.Top);

                    // this causes problems with doubleclick
                    //m_PointCatched = AddPoint (e.X - Bounds.Left, e.Y - Bounds.Top);
                    //Invalidate ();
                }
            }
        }
Пример #4
0
 static public void InvokeOnMouseUp(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (OnMouseUp != null)
     {
         OnMouseUp.Invoke(null, e);
     }
 }
Пример #5
0
 void GL_Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (engine != null)
     {
         engine.processMouseDown(e);
     }
 }
Пример #6
0
 protected override void OnMouseUp(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (e.Mouse.IsButtonUp(OpenTK.Input.MouseButton.Left))
     {
         camera.IsPressed = false;
     }
 }
Пример #7
0
 void Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs otk_e)
 {
     if (!CrowInterface.ProcessMouseButtonDown((int)otk_e.Button))
     {
         MouseButtonDown.Raise(sender, otk_e);
     }
 }
Пример #8
0
 void myMinusButton_Click(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (myParent.DecreaseAttrib(myAttrib, Value))
     {
         Value -= 5;
     }
 }
Пример #9
0
 public override void OnMouseUp(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnMouseUp(e);
     bMouseMoving = false;
     UpdateCursor();
     //this.Cursor = Cursors.Cross;
 }
Пример #10
0
        private void OnInternalMouseUp(object sender, OpenTK.Input.MouseButtonEventArgs e)
        {
            var args = new MouseButtonEventArgs(e);

            OnMouseUp(this, args);
            MouseUp?.Invoke(this, args);
        }
Пример #11
0
 void Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (e.Button == OpenTK.Input.MouseButton.Right)
     {
         Cursor.Show();
     }
 }
Пример #12
0
        private void Window_MouseDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
        {
            var mp = new Vector2((float)e.X / Window.Width, (float)e.Y / Window.Height);

            mp   -= Vector2.One * .5f;
            mp.X *= zoom;
            var rez = (float)Window.Height / Window.Width;

            mp.Y *= zoom * rez;

            var x = (int)Math.Floor(Funcs.Map(mp.X, -1.5f, 1.5f, 0, 3));
            var y = (int)Math.Floor(Funcs.Map(mp.Y, -1.5f, 1.5f, 3, 0));

            if (x >= 0 && x < 3 && y >= 0 && y < 3)
            {
                var i = board[x, y];
                if (i == ' ')
                {
                    board[x, y] = turn;

                    if (CheckForWin())
                    {
                        Console.WriteLine(turn + " won the game");
                        ResetGame();
                    }

                    ToggleTurn();
                }
            }
        }
Пример #13
0
        void Window_MouseDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
        {
            camera.mouseDown(e.X, e.Y);

            byte[] pixel = new byte[4];
            GL.ReadPixels(e.X, Window.Height - e.Y, 1, 1, PixelFormat.Rgba, PixelType.UnsignedByte, pixel);
            Console.WriteLine(string.Format("{0}, {1}, {2}, {3}", pixel[0], pixel[1], pixel[2], pixel[3]));
        }
Пример #14
0
 public override void OnMouseUp(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnMouseUp(e);
     if (e.Button == OpenTK.Input.MouseButton.Left)
     {
         _grabbed = false;
     }
 }
Пример #15
0
 public override void OnMouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnMouseDown(e);
     if (IsScrollable() && e.Button == OpenTK.Input.MouseButton.Left)
     {
         _grabbed = true;
     }
 }
Пример #16
0
 public override void OnClick(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnClick(e);
     if (IsVisibleEnabled)
     {
         OpenURL();
     }
 }
Пример #17
0
 void Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     --ButtonsDown;
     if (MouseButtons[(int)e.Button] != e.IsPressed)
     {
         MouseButtons[(int)e.Button] = e.IsPressed;
     }
 }
Пример #18
0
        void Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
        {
            Vector2 pos = new Vector2(e.Position.X, e.Position.Y);
            pos -= new Vector2(this.Width, this.Height) / 2f;
            pos = view.ToWorld(pos);

            view.SetPosition(pos, TweenType.QuarticOut, 60);
        }
Пример #19
0
 public override void OnClick(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (IsToggleButton)
     {
         Checked = !Checked;
     }
     base.OnClick(e);
 }
Пример #20
0
 void Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (e.Button == OpenTK.Input.MouseButton.Right)
     {
         Cursor.Position = PointToScreen(new System.Drawing.Point(ClientSize.Width / 2, ClientSize.Height / 2));
         Cursor.Hide();
     }
 }
Пример #21
0
 public override void OnClick(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (!Checked)
     {
         Checked = true;
         Invalidate();
     }
     base.OnClick(e);
 }
Пример #22
0
 protected override void OnMouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (e.Mouse.IsButtonDown(OpenTK.Input.MouseButton.Left))
     {
         camera.LastX     = e.Mouse.X;
         camera.LastY     = e.Mouse.Y;
         camera.IsPressed = true;
     }
 }
        protected virtual void Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs e)
        {
            if (FocusedElement != null)
            {
                FocusedElement.MouseUp(e);
            }

            //Mouse_Move(sender, new OpenTK.Input.MouseMoveEventArgs(e.X, e.Y, 0, 0));
        }
Пример #24
0
 public override void OnClick(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnClick(e);
     if (m_CanCollapse)
     {
         m_Collapsed = !m_Collapsed;
         OnCollapsedChanged();
     }
 }
Пример #25
0
 public override void MouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     if (Status != WidgetStatus.Disabled)
     {
         if (e.Button == OpenTK.Input.MouseButton.Left)
         {
             Status = WidgetStatus.Active;
         }
     }
 }
Пример #26
0
        public override void MouseUp(OpenTK.Input.MouseButtonEventArgs e)
        {
            base.MouseUp(e);

            if (Status != WidgetStatus.Disabled && IsDraggable)
            {
                Status     = WidgetStatus.Hover;
                _isDragged = false;
            }
        }
Пример #27
0
        public override void MouseDown(OpenTK.Input.MouseButtonEventArgs e)
        {
            base.MouseDown(e);

            if (Status != WidgetStatus.Disabled && IsDraggable)
            {
                Status     = WidgetStatus.Active;
                _isDragged = true;
            }
        }
Пример #28
0
 private void Test_MouseDown(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (e.Mouse.LeftButton == OpenTK.Input.ButtonState.Pressed)
     {
         list.Add(new Point2D(e.Mouse.X, e.Mouse.Y));
         if (list.Count == 4)
         {
             GeometryTool.AddQuat(list);
         }
     }
 }
Пример #29
0
 public override void OnMouseDown(OpenTK.Input.MouseButtonEventArgs e)
 {
     base.OnMouseDown(e);
     if (e.Button == OpenTK.Input.MouseButton.Left)
     {
         if (!BodySelectable())
         {
             _droppedDown = false;
         }
     }
 }
 void Panel_Click(object sender, OpenTK.Input.MouseButtonEventArgs e)
 {
     if (DiagnoseMode == DiagnoseModes.AbsoluteInterval)
     {
         DiagnoseMode = DiagnoseModes.RelativeFrameDelay;
     }
     else
     {
         DiagnoseMode = DiagnoseModes.AbsoluteInterval;
     }
 }