Esempio n. 1
0
void ViewCanvas::OnMouseMove(wxMouseEvent& e)
{
    // Grab focus on mouse move if our top level window is active
    if ( !m_Focused )
    {
        wxWindow* parent = GetParent();
        while ( !parent->IsTopLevel() )
            parent = parent->GetParent();

        wxTopLevelWindow* topLevel = reinterpret_cast< wxTopLevelWindow* >( parent );
        if ( topLevel->IsActive() )
        {
            SetFocus();
        }
    }

    if (m_Focused)
    {
        Helium::MouseMoveInput input;
        Helium::ConvertEvent( e, input );
        m_Viewport.MouseMove( input );
        e.Skip( input.GetSkipped() );

        Refresh();
        Update();
    }
}
Esempio n. 2
0
///////////////////////////////////////////////////////////////////////////////
// Move the camera.
// 
void RenderWindow::OnMouseMove( wxMouseEvent& args )
{
    args.Skip();

    if ( HasCapture() )
    {
        Helium::MouseMoveInput input;
        Helium::ConvertEvent( args, input );
        m_Camera.MouseMove( input );
        args.Skip( input.GetSkipped() );

        Refresh();
    }
}