Inheritance: System.EventArgs
Ejemplo n.º 1
0
 private void MouseMovedActivity(object sender, MouseActivityArgs e)
 {
     if (fDrawing)
     {
         ClientAreaGraphPort.DrawLine(blackPen, fLastDown, new Point(e.X, e.Y));
     }
 }
Ejemplo 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();
	}
Ejemplo 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);
            }
        }
Ejemplo n.º 4
0
    public override void OnMouseHover(MouseActivityArgs e)
    {
        //Console.WriteLine("OnMouseHover");

        // Make the window fully opaque
        SetWindowAlpha(255);
    }
Ejemplo 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();
	}
Ejemplo 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;
            }
        }
Ejemplo 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();
	}
Ejemplo 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());
        }
Ejemplo 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();
        //}
	}
Ejemplo 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());
        }
Ejemplo 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);
     }
 }
Ejemplo 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);

	}
Ejemplo 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();
    }
Ejemplo n.º 14
0
 public virtual void OnMouseEnter(MouseActivityArgs e)
 {
     if (null != MouseEnterEvent)
         MouseEnterEvent(e);
 }
Ejemplo 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");
			}
        }
Ejemplo 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;
            }
        }
Ejemplo 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;
        }
    }
Ejemplo n.º 18
0
 public virtual void OnMouseDown(MouseActivityArgs e)
 {
 }
Ejemplo 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);
		}
Ejemplo n.º 20
0
 public virtual void OnMouseActivity(Object sender, MouseActivityArgs mevent)
 {
     if (null != fReceiver)
         fReceiver.OnMouseActivity(sender, mevent);
 }
Ejemplo n.º 21
0
 public virtual void OnMouseUp(MouseActivityArgs e)
 {
 }
Ejemplo n.º 22
0
 public virtual void OnMouseWheel(MouseActivityArgs e)
 {
     if (null != MouseWheelEvent)
         MouseWheelEvent(e);
 }
Ejemplo n.º 23
0
 public virtual void MouseActivity(Object sender, MouseActivityArgs ma)
 {
     if (null != MouseActivityEvent)
         MouseActivityEvent(this, ma);
 }
Ejemplo n.º 24
0
 public virtual void OnMouseMove(MouseActivityArgs e)
 {
     if (null != MouseMoveEvent)
         MouseMoveEvent(e);
 }
Ejemplo n.º 25
0
 public virtual void OnMouseWheel(MouseActivityArgs e)
 {
 }
Ejemplo 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;
            }
        }
Ejemplo n.º 27
0
 public virtual void OnMouseDown(MouseActivityArgs e)
 {
     if (null != MouseDownEvent)
         MouseDownEvent(e);
 }
Ejemplo n.º 28
0
 public virtual void OnMouseLeave(MouseActivityArgs e)
 {
 }
Ejemplo n.º 29
0
 public virtual void OnMouseActivity(Object sender, MouseActivityArgs mevent)
 {
     if (null != OnMouseActivityEvent)
         OnMouseActivityEvent(sender, mevent);
 }
Ejemplo n.º 30
0
 public virtual void OnMouseHover(MouseActivityArgs e)
 {
 }