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(); }
/////////////////////////////////////////////////////////////////////////////// // 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() ); }
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(); }
/////////////////////////////////////////////////////////////////////////////// // 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() ); } }