Commit 0a55a2b6 authored by Maciej Suminski's avatar Maciej Suminski

Fixed wheel scroll event on Windows

parent 1944fea3
......@@ -61,6 +61,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
Connect( wxEVT_LEFT_UP, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
#if defined _WIN32 || defined _WIN64
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
#endif
// Initialize line attributes map
lineCapMap[LINE_CAP_BUTT] = CAIRO_LINE_CAP_BUTT;
......
......@@ -90,6 +90,9 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
Connect( wxEVT_LEFT_UP, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
#if defined _WIN32 || defined _WIN64
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
#endif
}
......
......@@ -46,28 +46,30 @@ WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxWindow* aParentPanel ) :
WX_VIEW_CONTROLS::onButton ), NULL, this );
m_parentPanel->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler(
WX_VIEW_CONTROLS::onButton ), NULL, this );
#if defined _WIN32 || defined _WIN64
m_parentPanel->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler(
WX_VIEW_CONTROLS::onEnter ), NULL, this );
#endif
}
void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& event )
{
VECTOR2D mousePoint( event.GetX(), event.GetY() );
// workaround for wxmsw..
//if( event.Entering() )
//m_parentPanel->SetFocus();
if( event.Dragging() )
if( event.Dragging() && m_isDragPanning )
{
if( m_isDragPanning )
{
VECTOR2D d = m_dragStartPoint - mousePoint;
VECTOR2D delta = m_view->ToWorld( d, false );
VECTOR2D mousePoint( event.GetX(), event.GetY() );
VECTOR2D d = m_dragStartPoint - mousePoint;
VECTOR2D delta = m_view->ToWorld( d, false );
m_view->SetCenter( m_lookStartPoint + delta );
m_parentPanel->Refresh();
}
else
{
event.Skip();
}
m_view->SetCenter( m_lookStartPoint + delta );
m_parentPanel->Refresh();
}
event.Skip();
}
......@@ -117,6 +119,8 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& event )
m_view->SetCenter( m_view->GetCenter() + delta );
m_parentPanel->Refresh();
}
event.Skip();
}
......@@ -135,3 +139,9 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& event )
event.Skip();
}
void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& event )
{
m_parentPanel->SetFocus();
}
......@@ -54,6 +54,7 @@ public:
void onWheel( wxMouseEvent& event );
void onMotion( wxMouseEvent& event );
void onButton( wxMouseEvent& event );
void onEnter( wxMouseEvent& event );
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment