Commit 3fe183c4 authored by Maciej Suminski's avatar Maciej Suminski

Tools have possibility to react to GAL switching or model (board) reload.

parent aaf857e8
...@@ -334,16 +334,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title, ...@@ -334,16 +334,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
SetBoard( new BOARD() ); SetBoard( new BOARD() );
if( GetGalCanvas() )
{
ViewReloadBoard( m_Pcb );
// update the tool manager with the new board and its view.
if( m_toolManager )
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
}
// Create the PCB_LAYER_WIDGET *after* SetBoard(): // Create the PCB_LAYER_WIDGET *after* SetBoard():
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
...@@ -543,8 +533,11 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard ) ...@@ -543,8 +533,11 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
// update the tool manager with the new board and its view. // update the tool manager with the new board and its view.
if( m_toolManager ) if( m_toolManager )
{
m_toolManager->SetEnvironment( aBoard, GetGalCanvas()->GetView(), m_toolManager->SetEnvironment( aBoard, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this ); GetGalCanvas()->GetViewControls(), this );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
}
} }
} }
...@@ -749,10 +742,14 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable ) ...@@ -749,10 +742,14 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
{ {
EDA_DRAW_FRAME::UseGalCanvas( aEnable ); EDA_DRAW_FRAME::UseGalCanvas( aEnable );
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
ViewReloadBoard( m_Pcb ); ViewReloadBoard( m_Pcb );
if( aEnable )
{
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
}
} }
......
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