Example #1
0
void FalagardActionButton::onMouseMove(MouseEventArgs& e)
{
    FalagardButton::onMouseMove(e);

    if(isDraggingEnabled() && !d_dragging && !isEmpty())
    {
        // get position of mouse as co-ordinates local to this window.
        Point localMousePos = (getMetricsMode() == Relative) ?
                              relativeToAbsolute(screenToWindow(e.position)) :
                              screenToWindow(e.position);

        // if mouse button is down (but we're not yet being dragged)
        if (d_leftMouseDown)
        {
            if (isDraggingThresholdExceeded(localMousePos))
            {
                // Trigger the event
                WindowEventArgs args(this);
                d_dragging = true;
                releaseInput();

                fireEvent(EventDragStarted, e, EventNamespace);
            }
        }
    }
}
Example #2
0
    void DragContainer::onMouseMove(MouseEventArgs& e)
    {
        Window::onMouseMove(e);

        // get position of mouse as co-ordinates local to this window.
        Point localMousePos = (getMetricsMode() == Relative) ? 
            relativeToAbsolute(screenToWindow(e.position)) :
            screenToWindow(e.position);

        // handle dragging
        if (d_dragging)
        {
            doDragging(localMousePos);
       }
        // not dragging
        else
        {
            // if mouse button is down (but we're not yet being dragged)
            if (d_leftMouseDown)
            {
                if (isDraggingThresholdExceeded(localMousePos))
                {
                    // Trigger the event
                    WindowEventArgs args(this);
                    onDragStarted(args);
                }
            }
        }
    }
    void DragContainer::onMouseMove(MouseEventArgs& e)
    {
        Window::onMouseMove(e);

        // get position of mouse as co-ordinates local to this window.
        Vector2 localMousePos = CoordConverter::screenToWindow(*this, e.position);

        // handle dragging
        if (d_dragging)
        {
            doDragging(localMousePos);
       }
        // not dragging
        else
        {
            // if mouse button is down (but we're not yet being dragged)
            if (d_leftMouseDown)
            {
                if (isDraggingThresholdExceeded(localMousePos))
                {
                    // Trigger the event
                    WindowEventArgs args(this);
                    onDragStarted(args);
                }
            }
        }
    }