Пример #1
0
        void t_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            FrameworkElement item   = sender as FrameworkElement;
            ILynxControl     ic     = sender as ILynxControl;
            ILynxWindow      iw     = sender as ILynxWindow;
            double           deltaV = e.GetCurrentPoint(null).Position.Y - mouseVerticalPosition;
            double           deltaH = e.GetCurrentPoint(null).Position.X - mouseHorizontalPosition;

            if (item == null)
            {
                return;
            }
            if (!isMouseCaptured)
            {
                return;
            }
            if (ic == null)
            {
                return;
            }
            if (ic.IsMove)
            {
                moveControl(item, deltaV, deltaH);
            }
            if (iw != null)
            {
                if (iw.IsTopChange)
                {
                    // Calculate the current position of the object.
                    TResizeReg(item, deltaV, deltaH);
                    // Update position global variables.
                }
                if (iw.IsBottomChange)
                {
                    // Calculate the current position of the object.
                    BResizeReg(item, deltaV, deltaH);
                    // Update position global variables.
                }
                if (iw.IsLeftChange)
                {
                    // Calculate the current position of the object.
                    LResizeReg(item, deltaV, deltaH);
                    // Update position global variables.
                }
                if (iw.IsRightChange)
                {
                    // Calculate the current position of the object.
                    RResizeReg(item, deltaV, deltaH);
                    // Update position global variables.
                }
                if (iw.IsMove)
                {
                    moveControl(item, deltaV, deltaH);
                }
            }
            mouseVerticalPosition   = e.GetCurrentPoint(null).Position.Y;
            mouseHorizontalPosition = e.GetCurrentPoint(null).Position.X;
        }
Пример #2
0
        void t_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            FrameworkElement item = sender as FrameworkElement;
            ILynxControl     ic   = sender as ILynxControl;
            ILynxWindow      iw   = sender as ILynxWindow;

            //LynxWindow item = sender as LynxWindow;
            isMouseCaptured = false;

            mouseVerticalPosition   = -1;
            mouseHorizontalPosition = -1;
            if (ic != null)
            {
                ic.setClear();
            }
            if (iw != null)
            {
                iw.setClear();
            }
        }
Пример #3
0
        void t_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            FrameworkElement item = sender as FrameworkElement;
            ILynxControl     ic   = sender as ILynxControl;
            ILynxWindow      iw   = sender as ILynxWindow;

            mouseVerticalPosition   = e.GetCurrentPoint(null).Position.Y;
            mouseHorizontalPosition = e.GetCurrentPoint(null).Position.X;
            Point mp = e.GetCurrentPoint(null).Position;

            if (ic != null)
            {
                int x = ic.getPositionStatus(mp.X, mp.Y);

                isMouseCaptured = true;
            }
            if (iw != null)
            {
                int x = iw.getPositionStatus(mp.X, mp.Y);

                isMouseCaptured = true;
            }
        }