From 746786a110da931a077a60de00746d5a169adf5b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 16:44:23 +0200 Subject: [PATCH] Fixed module editor crash when pcbnew is started from the main launcher. --- pcbnew/moduleframe.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index bd5b92e70a..58dc823b44 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -182,9 +182,9 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : updateTitle(); // Create GAL canvas - EDA_DRAW_FRAME* drawFrame = static_cast( aParent ); + PCB_BASE_FRAME* parentFrame = static_cast( Kiway().Player( FRAME_PCB, true ) ); PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, - drawFrame->GetGalCanvas()->GetBackend() ); + parentFrame->GetGalCanvas()->GetBackend() ); SetGalCanvas( drawPanel ); SetBoard( new BOARD() ); @@ -252,7 +252,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : // Add the layer manager ( most right side of pcbframe ) m_auimgr.AddPane( m_Layers, lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Layer( 2 ) ); // Layers manager is visible and served only in GAL canvas mode. - m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( drawFrame->IsGalCanvasActive() ); + m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( parentFrame->IsGalCanvasActive() ); // The left vertical toolbar (fast acces to display options) m_auimgr.AddPane( m_optionsToolBar, @@ -272,7 +272,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : drawPanel->GetViewControls(), this ); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); - if( drawFrame->IsGalCanvasActive() ) + if( parentFrame->IsGalCanvasActive() ) { drawPanel->SetEventDispatcher( m_toolDispatcher );