Make sure infobar gets created earlier.

(restoreLastFootprint() might want it.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14922
This commit is contained in:
Jeff Young 2023-06-11 11:36:42 +01:00
parent 4fc6047f91
commit 3159391e28
1 changed files with 11 additions and 6 deletions

View File

@ -128,14 +128,15 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetIcons( icon_bundle ); SetIcons( icon_bundle );
CreateInfoBar();
// Create GAL canvas // Create GAL canvas
m_canvasType = loadCanvasTypeSetting(); m_canvasType = loadCanvasTypeSetting();
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,
GetGalDisplayOptions(), m_canvasType ); GetGalDisplayOptions(), m_canvasType );
SetCanvas( drawPanel ); SetCanvas( drawPanel );
CreateInfoBar();
SetBoard( new BOARD() ); SetBoard( new BOARD() );
// This board will only be used to hold a footprint for editing // This board will only be used to hold a footprint for editing
@ -554,13 +555,17 @@ void FOOTPRINT_EDIT_FRAME::ReloadFootprint( FOOTPRINT* aFootprint )
msg.Printf( _( "Editing %s from board. Saving will update the board only." ), msg.Printf( _( "Editing %s from board. Saving will update the board only." ),
aFootprint->GetReference() ); aFootprint->GetReference() );
GetInfoBar()->RemoveAllButtons(); if( WX_INFOBAR* infobar = GetInfoBar() )
GetInfoBar()->AddCloseButton(); {
GetInfoBar()->ShowMessage( msg, wxICON_INFORMATION ); infobar->RemoveAllButtons();
infobar->AddCloseButton();
infobar->ShowMessage( msg, wxICON_INFORMATION );
}
} }
else else
{ {
GetInfoBar()->Dismiss(); if( WX_INFOBAR* infobar = GetInfoBar() )
infobar->Dismiss();
} }
UpdateMsgPanel(); UpdateMsgPanel();