Peg 3D viewer in front of Footprint Viewer and Wizard.

Fixes: lp:1754741
* https://bugs.launchpad.net/kicad/+bug/1754741
This commit is contained in:
Jeff Young 2018-03-14 19:16:01 +00:00
parent e8df845b3f
commit 8904b2e046
2 changed files with 22 additions and 30 deletions

View File

@ -658,25 +658,21 @@ void FOOTPRINT_VIEWER_FRAME::Show3D_Frame( wxCommandEvent& event )
{ {
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame(); EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
// We can probably remove this for 6.0, but just to be safe we'll stick to
// one 3DFrame at a time for 5.0
if( draw3DFrame ) if( draw3DFrame )
{ draw3DFrame->Close( true );
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( draw3DFrame->IsIconized() )
draw3DFrame->Iconize( false );
draw3DFrame->Raise(); draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
// Raising the window does not set the focus on Linux. This should work on any platform.
if( wxWindow::FindFocus() != draw3DFrame )
draw3DFrame->SetFocus();
return;
}
draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, wxEmptyString );
Update3D_Frame( false ); Update3D_Frame( false );
#ifdef __WXMAC__
// A stronger version of Raise() which promotes the window to its parent's level.
draw3DFrame->ReparentQuasiModal();
#else
draw3DFrame->Raise(); // Needed with some Window Managers draw3DFrame->Raise(); // Needed with some Window Managers
#endif
draw3DFrame->Show( true ); draw3DFrame->Show( true );
} }

View File

@ -609,25 +609,21 @@ void FOOTPRINT_WIZARD_FRAME::Show3D_Frame( wxCommandEvent& event )
{ {
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame(); EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
// We can probably remove this for 6.0, but just to be safe we'll stick to
// one 3DFrame at a time for 5.0
if( draw3DFrame ) if( draw3DFrame )
{ draw3DFrame->Close( true );
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( draw3DFrame->IsIconized() )
draw3DFrame->Iconize( false );
draw3DFrame->Raise(); draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
// Raising the window does not set the focus on Linux. This should work on any platform.
if( wxWindow::FindFocus() != draw3DFrame )
draw3DFrame->SetFocus();
return;
}
draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, wxEmptyString );
Update3D_Frame( false ); Update3D_Frame( false );
#ifdef __WXMAC__
// A stronger version of Raise() which promotes the window to its parent's level.
draw3DFrame->ReparentQuasiModal();
#else
draw3DFrame->Raise(); // Needed with some Window Managers draw3DFrame->Raise(); // Needed with some Window Managers
#endif
draw3DFrame->Show( true ); draw3DFrame->Show( true );
} }