Commit d1578e4e authored by Maciej Suminski's avatar Maciej Suminski

Fixed cvpcb build.

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