Exemple #1
0
void ViewCanvas::OnMouseDown( wxMouseEvent& e )
{
    if (!m_Focused)
    {
        // focus and eat the event
        SetFocus();
    }
    else
    {
        // if any key is down
        if (e.LeftIsDown() || e.MiddleIsDown() || e.RightIsDown())
        {
            // and we don't already own the mouse
            if (GetCapture() != this)
            {
                // capture it
                CaptureMouse();
            }
        }

        Helium::MouseButtonInput input;
        Helium::ConvertEvent( e, input );
        m_Viewport.MouseDown( input );
        e.Skip( input.GetSkipped() );
    }

    Refresh();
    Update();
}
Exemple #2
0
///////////////////////////////////////////////////////////////////////////////
// Stop tracking mouse movement for moving the camera.
// 
void RenderWindow::OnMouseUp( wxMouseEvent& args )
{
    args.Skip();
    if ( HasCapture() )
    {
        ReleaseMouse();
    }

    Helium::MouseButtonInput input;
    Helium::ConvertEvent( args, input );
    m_Camera.MouseUp( input );
    args.Skip( input.GetSkipped() );
}
Exemple #3
0
void ViewCanvas::OnMouseUp(wxMouseEvent& e)
{
    if (!e.LeftIsDown() && !e.MiddleIsDown() && !e.RightIsDown())
    {
        if (GetCapture() == this)
        {
            ReleaseMouse();
        }
    }

    Helium::MouseButtonInput input;
    Helium::ConvertEvent( e, input );
    m_Viewport.MouseUp( input );
    e.Skip( input.GetSkipped() );

    Refresh();
    Update();
}
Exemple #4
0
///////////////////////////////////////////////////////////////////////////////
// Start tracking mouse movement for moving the camera.
// 
void RenderWindow::OnMouseDown( wxMouseEvent& args )
{
    args.Skip();

    bool modifier = args.ControlDown() || args.MetaDown() || args.ShiftDown() || args.AltDown();
    // Right-click with no modifier keys means to show a context menu
    if ( args.RightDown() && !modifier )
    {
        ShowContextMenu( args.GetPosition() );
    }
    else
    {
        CaptureMouse();

        Helium::MouseButtonInput input;
        Helium::ConvertEvent( args, input );
        m_Camera.MouseDown( input );
        args.Skip( input.GetSkipped() );
    }
}