Change EESchema library viewer to stay on top of parent not all other windows.

This commit is contained in:
Wayne Stambaugh 2011-04-07 15:30:49 -04:00
parent 0952393413
commit 1016448c02
1 changed files with 14 additions and 4 deletions

View File

@ -83,7 +83,7 @@ static wxAcceleratorEntry accels[] =
LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaphore* semaphore ) :
EDA_DRAW_FRAME( father, VIEWER_FRAME, _( "Library browser" ),
EDA_DRAW_FRAME( father, VIEWER_FRAME, _( "Library Browser" ),
wxDefaultPosition, wxDefaultSize )
{
wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
@ -103,7 +103,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
m_exportToEeschemaCmpName.Empty();
if( m_Semaphore )
SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
SetWindowStyle( GetWindowStyle() | wxFRAME_FLOAT_ON_PARENT );
SetScreen( new SCH_SCREEN() );
GetScreen()->m_Center = true; // Center coordinate origins on screen.
@ -251,6 +251,16 @@ void LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
m_Semaphore->Post();
Destroy();
if( m_Semaphore )
{
// Raise EESchema above all other windows when the library viewer is being used
// to select a component.
wxWindow* parent = GetParent();
if( parent )
parent->Raise();
}
}