Code refinement for commit 80371134d7
This commit is contained in:
parent
a208ba6566
commit
83169af988
|
@ -194,15 +194,20 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
|
|
||||||
// See for an existing board editor frame opened
|
// See for an existing board editor frame opened
|
||||||
// (we need it just to know some settings )
|
// (we need it just to know some settings )
|
||||||
|
// TODO: find a better way to retrieve these settings)
|
||||||
bool isBordEditorRunning = Kiway().Player( FRAME_PCB, false ) != nullptr;
|
bool isBordEditorRunning = Kiway().Player( FRAME_PCB, false ) != nullptr;
|
||||||
|
PCB_BASE_FRAME* pcbEditorFrame = static_cast<PCB_BASE_FRAME*>( Kiway().Player( FRAME_PCB, true ) );
|
||||||
PCB_BASE_FRAME* parentFrame = static_cast<PCB_BASE_FRAME*>( Kiway().Player( FRAME_PCB, true ) );
|
|
||||||
|
|
||||||
// Create GAL canvas
|
// Create GAL canvas
|
||||||
PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||||
parentFrame->GetGalDisplayOptions(),
|
pcbEditorFrame->GetGalDisplayOptions(),
|
||||||
parentFrame->GetGalCanvas()->GetBackend() );
|
pcbEditorFrame->GetGalCanvas()->GetBackend() );
|
||||||
SetGalCanvas( drawPanel );
|
SetGalCanvas( drawPanel );
|
||||||
|
bool switchToGalCanvas = pcbEditorFrame->IsGalCanvasActive();
|
||||||
|
|
||||||
|
// delete pcbEditorFrame if it was not yet in use:
|
||||||
|
if( !isBordEditorRunning )
|
||||||
|
pcbEditorFrame->Destroy();
|
||||||
|
|
||||||
// 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;
|
||||||
|
@ -295,10 +300,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UseGalCanvas( parentFrame->IsGalCanvasActive() );
|
UseGalCanvas( switchToGalCanvas );
|
||||||
|
|
||||||
if( !isBordEditorRunning && IsModal() )
|
|
||||||
parentFrame->Destroy();
|
|
||||||
|
|
||||||
if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
|
if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue