Commit d1578e4e authored by Maciej Suminski's avatar Maciej Suminski

Fixed cvpcb build.

parent 16243207
......@@ -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 );
......
......@@ -22,16 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <wx/event.h>
#include <wxPcbStruct.h>
#include <wxBasePcbFrame.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <view/wx_view_controls.h>
#include <class_drawpanel_gal.h>
......@@ -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;
......
......@@ -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;
......
......@@ -29,7 +29,7 @@
#include <tool/tool_event.h>
#include <wx/event.h>
//#include <wx/event.h>
#include <wx/kbdstate.h>
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;
......
......@@ -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 {
......
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