Ejemplo n.º 1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            Point p = e.GetPosition(this);

            if (m_clickedElement != null && e.LeftButton == MouseButtonState.Pressed) {
                m_clickedElement.MouseMove(p, true);
            } else {
                TimelineElement element = GetHitTest(p);
                if (element != null) {
                    element.MouseMove(p, e.LeftButton == MouseButtonState.Pressed);
                }
                if (element != m_hoveredElement) {
                    if (m_hoveredElement != null) {
                        m_hoveredElement.MouseLeave();
                    }
                    m_hoveredElement = element;
                    if (m_hoveredElement != null) {
                        m_hoveredElement.MouseEnter();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);

            ReleaseMouseCapture();

            Point p = e.GetPosition(this);

            if (m_clickedElement != null) {
                m_clickedElement.MouseUp(p);
                m_clickedElement = null;
            } else {
                TimelineElement element = GetHitTest(p);
                if (element != null) {
                    element.MouseUp(p);
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            base.OnMouseDown(e);

            CaptureMouse();

            Point p = e.GetPosition(this);
            m_clickedElement = GetHitTest(p);
            if (m_clickedElement != null) {
                m_clickedElement.MouseDown(p);
            }
        }