diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index 221e158f2c..fd907a1ca6 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -47,7 +47,6 @@ #define METRIC_UNIT_LENGTH (1e9) - EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition, const wxSize& aSize, GalType aGalType ) : @@ -91,8 +90,8 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin Connect( wxEVT_KEY_UP, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_KEY_DOWN, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); Connect( wxEVT_ENTER_WINDOW, wxEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), NULL, this ); - Connect( TOOL_DISPATCHER::EVT_REFRESH_MOUSE, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), - NULL, this ); + Connect( KiGfx::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE, + wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ), NULL, this ); m_refreshTimer.SetOwner( this ); Connect( wxEVT_TIMER, wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onRefreshTimer ), NULL, this ); diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index ad3a38c857..638f9d0dd5 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -22,16 +22,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - #include #include #include #include #include -#include +#include #include @@ -42,8 +39,6 @@ using boost::optional; -const wxEventType TOOL_DISPATCHER::EVT_REFRESH_MOUSE = wxNewEventType(); - struct TOOL_DISPATCHER::ButtonState { ButtonState( TOOL_MouseButtons aButton, const wxEventType& aDownEvent, @@ -209,11 +204,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) type == wxEVT_LEFT_DOWN || type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_DOWN || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_DOWN || type == wxEVT_RIGHT_UP || - type == EVT_REFRESH_MOUSE ) + type == KiGfx::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE ) { VECTOR2D screenPos = m_toolMgr->GetViewControls()->GetCursorPosition(); VECTOR2D pos = getView()->ToWorld( screenPos ); - if( pos != m_lastMousePos || type == EVT_REFRESH_MOUSE ) + if( pos != m_lastMousePos || type == KiGfx::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE ) { motion = true; m_lastMousePos = pos; diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 4aa69d2d61..ed6602fb81 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -32,6 +32,8 @@ using namespace KiGfx; +const wxEventType WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE = wxNewEventType(); + WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxWindow* aParentPanel ) : VIEW_CONTROLS( aView ), m_state( IDLE ), @@ -207,7 +209,7 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent ) m_view->SetCenter( m_view->GetCenter() + dir * m_autoPanSpeed ); // Notify tools that the cursor position has changed in the world coordinates - wxCommandEvent moveEvent( TOOL_DISPATCHER::EVT_REFRESH_MOUSE ); + wxCommandEvent moveEvent( EVT_REFRESH_MOUSE ); wxPostEvent( m_parentPanel, moveEvent ); } break; diff --git a/include/tool/tool_dispatcher.h b/include/tool/tool_dispatcher.h index cb3273f744..a95464f38e 100644 --- a/include/tool/tool_dispatcher.h +++ b/include/tool/tool_dispatcher.h @@ -29,7 +29,7 @@ #include -#include +//#include #include class TOOL_MANAGER; @@ -65,9 +65,6 @@ public: virtual void DispatchWxEvent( wxEvent& aEvent ); virtual void DispatchWxCommand( wxCommandEvent& aEvent ); - /// Event that forces mouse move event in the dispatcher - static const wxEventType EVT_REFRESH_MOUSE; - private: static const int MouseButtonCount = 3; static const int DragTimeThreshold = 300; diff --git a/include/view/wx_view_controls.h b/include/view/wx_view_controls.h index 8562afbb82..fd80e90d76 100644 --- a/include/view/wx_view_controls.h +++ b/include/view/wx_view_controls.h @@ -84,6 +84,9 @@ public: /// @copydoc VIEW_CONTROLS::GetCursorPosition() virtual const VECTOR2D GetCursorPosition() const; + /// Event that forces mouse move event in the dispatcher + static const wxEventType EVT_REFRESH_MOUSE; + private: /// Possible states for WX_VIEW_CONTROLS enum State {