Commit f5325f8d authored by Maciej Suminski's avatar Maciej Suminski

Removed a redundant pointer to EDA_EDIT_FRAME.

parent e46c5cb7
...@@ -88,8 +88,8 @@ struct TOOL_DISPATCHER::BUTTON_STATE ...@@ -88,8 +88,8 @@ struct TOOL_DISPATCHER::BUTTON_STATE
}; };
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, PCB_BASE_FRAME* aEditFrame ) : TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr ) :
m_toolMgr( aToolMgr ), m_editFrame( aEditFrame ) m_toolMgr( aToolMgr )
{ {
m_buttons.push_back( new BUTTON_STATE( BUT_LEFT, wxEVT_LEFT_DOWN, m_buttons.push_back( new BUTTON_STATE( BUT_LEFT, wxEVT_LEFT_DOWN,
wxEVT_LEFT_UP, wxEVT_LEFT_DCLICK ) ); wxEVT_LEFT_UP, wxEVT_LEFT_DCLICK ) );
...@@ -118,7 +118,7 @@ void TOOL_DISPATCHER::ResetState() ...@@ -118,7 +118,7 @@ void TOOL_DISPATCHER::ResetState()
KIGFX::VIEW* TOOL_DISPATCHER::getView() KIGFX::VIEW* TOOL_DISPATCHER::getView()
{ {
return m_editFrame->GetGalCanvas()->GetView(); return static_cast<PCB_BASE_FRAME*>( m_toolMgr->GetEditFrame() )->GetGalCanvas()->GetView();
} }
...@@ -229,7 +229,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) ...@@ -229,7 +229,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
{ {
motion = true; motion = true;
m_lastMousePos = pos; m_lastMousePos = pos;
m_editFrame->UpdateStatusBar(); static_cast<PCB_BASE_FRAME*>( m_toolMgr->GetEditFrame() )->UpdateStatusBar();
} }
for( unsigned int i = 0; i < m_buttons.size(); i++ ) for( unsigned int i = 0; i < m_buttons.size(); i++ )
...@@ -245,7 +245,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) ...@@ -245,7 +245,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
// TODO That's a big ugly workaround, somehow DRAWPANEL_GAL loses focus // TODO That's a big ugly workaround, somehow DRAWPANEL_GAL loses focus
// after second LMB click and currently I have no means to do better debugging // after second LMB click and currently I have no means to do better debugging
if( type == wxEVT_LEFT_UP ) if( type == wxEVT_LEFT_UP )
m_editFrame->GetGalCanvas()->SetFocus(); static_cast<PCB_BASE_FRAME*>( m_toolMgr->GetEditFrame() )->GetGalCanvas()->SetFocus();
#endif /* __APPLE__ */ #endif /* __APPLE__ */
} }
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
* @param aToolMgr: tool manager instance the events will be sent to * @param aToolMgr: tool manager instance the events will be sent to
* @param aEditFrame: the frame wx events come from * @param aEditFrame: the frame wx events come from
*/ */
TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr, PCB_BASE_FRAME* aEditFrame ); TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr );
virtual ~TOOL_DISPATCHER(); virtual ~TOOL_DISPATCHER();
/** /**
...@@ -128,9 +128,6 @@ private: ...@@ -128,9 +128,6 @@ private:
///> Instance of tool manager that cooperates with the dispatcher. ///> Instance of tool manager that cooperates with the dispatcher.
TOOL_MANAGER* m_toolMgr; TOOL_MANAGER* m_toolMgr;
///> Instance of wxFrame that is the source of UI events.
PCB_BASE_FRAME* m_editFrame;
}; };
#endif #endif
...@@ -47,7 +47,7 @@ void PCB_EDIT_FRAME::setupTools() ...@@ -47,7 +47,7 @@ void PCB_EDIT_FRAME::setupTools()
{ {
// Create the manager and dispatcher & route draw panel events to the dispatcher // Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager = new TOOL_MANAGER; m_toolManager = new TOOL_MANAGER;
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, this ); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
GetGalCanvas()->SetEventDispatcher( m_toolDispatcher ); GetGalCanvas()->SetEventDispatcher( m_toolDispatcher );
// Connect handlers to toolbar buttons // Connect handlers to toolbar buttons
......
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