コード例 #1
0
        private void OnTargetPanel_PointerWheelChanged(object sender, PointerRoutedEventArgs e)
        {
            if (m_painter == null)
            {
                return;
            }
            if (!m_hasFocus)
            {
                return;
            }

            // Track mouse/pointer state
            PointerPoint           currentPoint    = e.GetCurrentPoint(m_painter.TargetPanel);
            PointerPointProperties pointProperties = currentPoint.Properties;
            int wheelDelta = pointProperties.MouseWheelDelta;

            if (pointProperties.IsPrimary)
            {
                m_stateMouseOrPointer.NotifyButtonStates(
                    pointProperties.IsLeftButtonPressed,
                    pointProperties.IsMiddleButtonPressed,
                    pointProperties.IsRightButtonPressed,
                    pointProperties.IsXButton1Pressed,
                    pointProperties.IsXButton2Pressed);
                m_stateMouseOrPointer.NotifyMouseWheel(wheelDelta);
            }
        }
コード例 #2
0
        /// <summary>
        /// Called when user uses the mouse wheel for zooming.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnRendererElement_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            if (m_rendererElement == null)
            {
                return;
            }

            m_stateMouseOrPointer.NotifyMouseWheel(e.Delta);
        }
コード例 #3
0
        /// <summary>
        /// Called when mouse wheel is used.
        /// </summary>
        private void OnMouseWheel(object sender, MouseEventArgs e)
        {
            if (m_currentControl == null)
            {
                return;
            }

            if (m_isMouseInside)
            {
                m_stateMouseOrPointer.NotifyMouseWheel(e.Delta);
            }
        }
コード例 #4
0
        private void OnTargetPanel_PointerWheelChanged(CoreWindow sender, PointerEventArgs e)
        {
            if (m_painter == null)
            {
                return;
            }

            // Track mouse/pointer state
            PointerPointProperties pointProperties = e.CurrentPoint.Properties;
            int wheelDelta = pointProperties.MouseWheelDelta;

            if (pointProperties.IsPrimary)
            {
                m_stateMouseOrPointer.NotifyButtonStates(
                    pointProperties.IsLeftButtonPressed,
                    pointProperties.IsMiddleButtonPressed,
                    pointProperties.IsRightButtonPressed,
                    pointProperties.IsXButton1Pressed,
                    pointProperties.IsXButton2Pressed);
                m_stateMouseOrPointer.NotifyMouseWheel(wheelDelta);
            }
        }