Commit 1016448c authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

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

parent 09523934
Loading
Loading
Loading
Loading
+14 −4
Original line number Original line Diff line number Diff line
@@ -83,7 +83,7 @@ static wxAcceleratorEntry accels[] =




LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaphore* semaphore ) :
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 )
                    wxDefaultPosition, wxDefaultSize )
{
{
    wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
    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();
    m_exportToEeschemaCmpName.Empty();


    if( m_Semaphore )
    if( m_Semaphore )
        SetWindowStyle( GetWindowStyle() | wxSTAY_ON_TOP );
        SetWindowStyle( GetWindowStyle() | wxFRAME_FLOAT_ON_PARENT );


    SetScreen( new SCH_SCREEN() );
    SetScreen( new SCH_SCREEN() );
    GetScreen()->m_Center = true;      // Center coordinate origins on screen.
    GetScreen()->m_Center = true;      // Center coordinate origins on screen.
@@ -251,6 +251,16 @@ void LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
        m_Semaphore->Post();
        m_Semaphore->Post();


    Destroy();
    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();
    }
}
}