Inheritance: System.EventArgs
Esempio n. 1
0
 private void MouseMovedActivity(object sender, MouseActivityArgs e)
 {
     if (fDrawing)
     {
         ClientAreaGraphPort.DrawLine(blackPen, fLastDown, new Point(e.X, e.Y));
     }
 }
Esempio n. 2
0
	/// <summary>
	/// OnMouseEnter
	/// 
	/// This gets called whenever the pointing device enters our frame.
	/// We want to do interesting things here like change the cursor shape
	/// to be whatever we require.
	/// </summary>
	/// <param name="e"></param>
	public override void OnMouseEnter(MouseActivityArgs e)
	{
		//Console.WriteLine("ActiveArea.OnMouseEnter: {0}", e.ToString());

		// Possibly Draw Myself Immediately
		//Invalidate();
	}
Esempio n. 3
0
        public override void OnMouseWheel(MouseActivityArgs e)
        {
            int min = int.MinValue;
            int max = int.MaxValue;
            int step = 0;
            int defaultValue = 0;
            int currentValue = 0;
            CameraControlFlags camFlags = CameraControlFlags.None;
            IAMCameraControl camControl = m_CaptureDevice.GetCameraControl();

            // Delta > 0 ==> Zoom In (rolling towards the screen)
            // Delta < 0 ==> Zoom Out (rolling away from the screen)
            if (e.Delta > 0)
            {
                camControl.GetRange(CameraControlProperty.Zoom, out min, out max, out step, out defaultValue, out camFlags);
                camControl.Get(CameraControlProperty.Zoom, out currentValue, out camFlags);
                if (currentValue < max)
                    currentValue += step;
                camControl.Set(CameraControlProperty.Zoom, currentValue, camFlags);

                Console.WriteLine("Zoom: {0}", currentValue);
            }
            else
            {
                camControl.GetRange(CameraControlProperty.Zoom, out min, out max, out step, out defaultValue, out camFlags);
                camControl.Get(CameraControlProperty.Zoom, out currentValue, out camFlags);
                if (currentValue > min)
                    currentValue -= step;
                camControl.Set(CameraControlProperty.Zoom, currentValue, camFlags);

                Console.WriteLine("Zoom: {0}", currentValue);
            }
        }
Esempio n. 4
0
    public override void OnMouseHover(MouseActivityArgs e)
    {
        //Console.WriteLine("OnMouseHover");

        // Make the window fully opaque
        SetWindowAlpha(255);
    }
Esempio n. 5
0
    public override void OnMouseMove(MouseActivityArgs e)
	{
		//Console.WriteLine("ActiveArea.OnMouseMove: {0}", e.ToString());
		if (MouseMoveEvent != null)
			MouseMoveEvent(this, e);

		// Possibly Draw Myself Immediately
		//Invalidate();
	}
Esempio n. 6
0
        public virtual void ReceiveChunk(BufferChunk aRecord)
        {
            // First read out the record type
            int recordType = aRecord.NextInt32();

            // Then deserialize the rest from there
            switch ((UserIOCommand)recordType)
            {
                case UserIOCommand.HideCursor:
                    HideCursor();
                    break;

                case UserIOCommand.Showcursor:
                    ShowCursor();
                    break;

                case UserIOCommand.MoveCursor:
                    {
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();

                        MoveCursor(x, y);
                    }
                    break;

                case UserIOCommand.KeyboardActivity:
                    {
                        KeyActivityType kEvent = (KeyActivityType)aRecord.NextInt32();
                        VirtualKeyCodes vk = (VirtualKeyCodes)aRecord.NextInt32();

                        KeyboardActivityArgs kbda = new KeyboardActivityArgs(kEvent, vk);
                        KeyboardActivity(this, kbda); 
                    }
                    break;

                case UserIOCommand.MouseActivity:
                    {
                        MouseActivityType maType = MouseActivityType.None;
                        MouseButtonActivity mbActivity = (MouseButtonActivity)aRecord.NextInt32();
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int clicks = aRecord.NextInt32();
                        short delta = aRecord.NextInt16();
                        int keyflags = 0;

                        MouseActivityArgs ma = new MouseActivityArgs(null, maType, mbActivity, 
                            MouseCoordinateSpace.Desktop, MouseMovementType.Absolute, IntPtr.Zero, 
                            x, y, delta, clicks, keyflags);

                        MouseActivity(this, ma);
                    }
                    break;

                default:
                    break;
            }
        }
Esempio n. 7
0
    public override void OnMouseLeave(MouseActivityArgs e)
	{
		//Console.WriteLine("ActiveArea.OnMouseLeave: {0}", e.ToString());
		//fTracking = false;
		//fIsDepressed = false;

		// Draw Myself Immediately
		// WAA - Maybe not because it may not be necessary
		//Invalidate();
	}
Esempio n. 8
0
        private void MouseDownActivity(object sender, MouseActivityArgs e)
        {
            if (fDrawing)
            {
                fLastDown.X = e.X;
                fLastDown.Y = e.Y;

                GraphPort.SetPixel(e.X, e.Y, Color.White);
            }
            //Console.WriteLine("MouseTestWindow.MouseDownActivity: {0}", e.ToString());
        }
Esempio n. 9
0
    public override void OnMouseMove(MouseActivityArgs e)
	{
		// WAA - temporary disable due to scaling issues
		return ;

        //if (this.Window != null)
        //{
        //    Graphics grfx = this.Window.CreateGraphics();
        //    grfx.PageUnit = GraphicsUnit;

        //    Animate(grfx);
        //    grfx.Dispose();
        //}
	}
Esempio n. 10
0
        private void MouseUpActivity(object sender, MouseActivityArgs e)
        {
            if (fDrawing)
            {
                fDrawing = false;

            }
            else
            {
                fDrawing = true;
                //GDI.MoveToEx(GraphPort.DeviceContext, e.X, e.Y, IntPtr.Zero);
            }
            //Console.WriteLine("MouseTestWindow.MouseUpActivity: {0}", e.ToString());
        }
Esempio n. 11
0
 public virtual void OnMouseDown(MouseActivityArgs e)
 {
     if (e.Clicks > 1)
     {
         if (fPLCView == fPLCSoftwareView)
             SwitchToView(fPLCHardwareView);
         else if (fPLCView == fPLCHardwareView)
         {
             if (null != fPLCITView)
                 SwitchToView(fPLCITView);
             else
                 SwitchToView(fPLCSoftwareView);
         }
         else
             SwitchToView(fPLCSoftwareView);
     }
 }
Esempio n. 12
0
	// Reacting to the mouse
	public override void OnMouseDown(MouseActivityArgs e)
	{

		float x = e.X;
		float y = e.Y;

		//ScreenToLocal(ref x, ref y);

		//Console.WriteLine("ActiveArea.OnMouseDown: {0} {1} - BEGIN \n", e.X, e.Y);


		// Draw myself Immediately
		//DrawInto(LastGraphDevice);

		if (MouseDownEvent != null)
			MouseDownEvent(this, e);

	}
Esempio n. 13
0
    public override void OnMouseDown(MouseActivityArgs e)
    {
        if (e.ButtonActivity == MouseButtonActivity.RightButtonDown)
        {
            fHaveImage = false;
            Opacity = 0.5;
        }

        if (e.ButtonActivity == MouseButtonActivity.LeftButtonDown)
        {
            if (e.Clicks > 1)
            {
                this.Hide();
                POINT origin = new POINT(0, 0);
                User32.ClientToScreen(Handle, ref origin);
                fScreenImage = fSnapper.SnapAPicture(new Rectangle(origin.X, origin.Y, ClientRectangle.Width, ClientRectangle.Height));
                fHaveImage = true;
                CopyToClipboard();
                this.Show();
            }
        }
        Invalidate();
    }
Esempio n. 14
0
 public virtual void OnMouseEnter(MouseActivityArgs e)
 {
     if (null != MouseEnterEvent)
         MouseEnterEvent(e);
 }
Esempio n. 15
0
        public override void OnMouseUp(MouseActivityArgs e) 
		{
			//Console.WriteLine("GraphicWindow.OnMouseUp - {0}", e.ToString());

			if (fActiveGraphic != null)
					fActiveGraphic.OnNext(e);
			else
			{
				//Console.WriteLine("GraphicWindow.OnMouseUp - no tracker found");
			}
        }
Esempio n. 16
0
        public virtual void OnNext(MouseActivityArgs e)
        {
            switch (e.ActivityType)
            {
                case MouseActivityType.MouseDown:
                    OnMouseDown(e);
                    break;

                case MouseActivityType.MouseMove:
                    OnMouseMove(e);
                    break;

                case MouseActivityType.MouseUp:
                    OnMouseUp(e);
                    break;

                case MouseActivityType.MouseEnter:
                    OnMouseEnter(e);
                    break;

                case MouseActivityType.MouseHover:
                    OnMouseHover(e);
                    break;

                case MouseActivityType.MouseLeave:
                    OnMouseLeave(e);
                    break;

                case MouseActivityType.MouseWheel:
                    OnMouseWheel(e);
                    break;
            }
        }
Esempio n. 17
0
    public override void OnMouseActivity(Object sender, MouseActivityArgs mea)
    {
        switch (mea.ButtonActivity)
        {
            case MouseButtonActivity.LeftButtonDown:
                if (setupMethod == POINTER)
                {
                    setupMethod = INTERLEAVED;
                    setupInterleave();
                }
                else if (setupMethod == INTERLEAVED)
                {
                    setupMethod = POINTER;
                    setupPointers();
                }
                break;

            case MouseButtonActivity.MiddleButtonDown:
            case MouseButtonActivity.RightButtonDown:
                if (derefMethod == DRAWARRAY)
                    derefMethod = ARRAYELEMENT;
                else if (derefMethod == ARRAYELEMENT)
                    derefMethod = DRAWELEMENTS;
                else if (derefMethod == DRAWELEMENTS)
                    derefMethod = DRAWARRAY;
                break;

            default:
                break;
        }
    }
Esempio n. 18
0
 public virtual void OnMouseDown(MouseActivityArgs e)
 {
 }
Esempio n. 19
0
		public override void OnMouseMove(MouseActivityArgs e)
		{
			if (Tracking && Depressed)
			{
				SetPositionBy(e.X, e.Y, true);

/*
			int diffX = 0;
			int diffY = 0;
				diffX = e.X - LastMouseX;
				diffY = e.Y - LastMouseY;
				if ((Math.Abs(diffX) > 0) || (Math.Abs(diffY)>0))
					SetPositionBy(e.X, e.Y, true);
	
				LastMouseX = e.X;
				LastMouseY = e.Y;
*/
			}

			//Console.WriteLine("TrackSlider.OnMouseMove: {0}", e.ToString());
			//if (MouseMoveEvent != null)
			//	MouseMoveEvent(this, e);
		}
Esempio n. 20
0
 public virtual void OnMouseActivity(Object sender, MouseActivityArgs mevent)
 {
     if (null != fReceiver)
         fReceiver.OnMouseActivity(sender, mevent);
 }
Esempio n. 21
0
 public virtual void OnMouseUp(MouseActivityArgs e)
 {
 }
Esempio n. 22
0
 public virtual void OnMouseWheel(MouseActivityArgs e)
 {
     if (null != MouseWheelEvent)
         MouseWheelEvent(e);
 }
Esempio n. 23
0
 public virtual void MouseActivity(Object sender, MouseActivityArgs ma)
 {
     if (null != MouseActivityEvent)
         MouseActivityEvent(this, ma);
 }
Esempio n. 24
0
 public virtual void OnMouseMove(MouseActivityArgs e)
 {
     if (null != MouseMoveEvent)
         MouseMoveEvent(e);
 }
Esempio n. 25
0
 public virtual void OnMouseWheel(MouseActivityArgs e)
 {
 }
Esempio n. 26
0
        public override void OnMouseUp(MouseActivityArgs e)
        {
            Console.WriteLine("{0}: {1},{2} ", e.ButtonActivity.ToString(), e.X, e.Y);

            if (e.ButtonActivity == MouseButtonActivity.LeftButtonUp)
            {
                Win32Caret.Current.FocusWindow = this.Window;
                fFontSize = fFont.MeasureString("W");
                Win32Caret.Current.SetShape(1, fFontSize.Height);
                Win32Caret.Current.MoveTo(e.X, e.Y);
                Win32Caret.Current.Show();
                fCaretPosition.X = e.X;
                fCaretPosition.Y = e.Y;
            }
            else if (e.ButtonActivity == MouseButtonActivity.RightButtonUp)
            {
                Win32Caret.Current.FocusWindow = null;
            }
        }
Esempio n. 27
0
 public virtual void OnMouseDown(MouseActivityArgs e)
 {
     if (null != MouseDownEvent)
         MouseDownEvent(e);
 }
Esempio n. 28
0
 public virtual void OnMouseLeave(MouseActivityArgs e)
 {
 }
Esempio n. 29
0
 public virtual void OnMouseActivity(Object sender, MouseActivityArgs mevent)
 {
     if (null != OnMouseActivityEvent)
         OnMouseActivityEvent(sender, mevent);
 }
Esempio n. 30
0
 public virtual void OnMouseHover(MouseActivityArgs e)
 {
 }