Minor fixes. In stand alone show the frame as soon as possible.

Especially when running Pcbnew to open a complex board the frame is shown faster.
Add also a busy cursor when loading files and building the data.
This commit is contained in:
jean-pierre charras 2020-12-21 17:44:10 +01:00
parent 96c935673e
commit eb7dc6ddd9
4 changed files with 17 additions and 3 deletions

View File

@ -391,6 +391,14 @@ bool PGM_SINGLE_TOP::OnPgmInit()
App().SetTopWindow( frame ); // wxApp gets a face. App().SetTopWindow( frame ); // wxApp gets a face.
// Allocate a slice of time to show the frame and update wxWidgets widgets
// (especially setting valid sizes) after creating frame and before calling
// OpenProjectFiles() that can update/use some widgets.
// The 2 calls to wxSafeYield are needed on wxGTK for best results.
wxSafeYield();
frame->Show();
wxSafeYield();
// Individual frames may provide additional option/switch processing, but for compatibility, // Individual frames may provide additional option/switch processing, but for compatibility,
// any positional arguments are treated as a list of files to pass to OpenProjectFiles // any positional arguments are treated as a list of files to pass to OpenProjectFiles
frame->ParseArgs( parser ); frame->ParseArgs( parser );
@ -448,7 +456,5 @@ bool PGM_SINGLE_TOP::OnPgmInit()
} }
} }
frame->Show();
return true; return true;
} }

View File

@ -157,7 +157,7 @@ void WX_INFOBAR::Dismiss()
void WX_INFOBAR::onSize( wxSizeEvent& aEvent ) void WX_INFOBAR::onSize( wxSizeEvent& aEvent )
{ {
int barWidth = GetSize().GetWidth(); int barWidth = GetSize().GetWidth();
int parentWidth = m_parent->GetSize().GetWidth(); int parentWidth = m_parent->GetClientSize().GetWidth();
if( barWidth != parentWidth ) if( barWidth != parentWidth )
SetSize( parentWidth, GetSize().GetHeight() ); SetSize( parentWidth, GetSize().GetHeight() );

View File

@ -277,6 +277,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false; return false;
} }
// Loading a complex project and build data can be time
// consumming, so display a busy cursor
wxBusyCursor dummy;
// unload current project file before loading new // unload current project file before loading new
{ {
SetScreen( nullptr ); SetScreen( nullptr );

View File

@ -575,6 +575,10 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false; return false;
} }
// Loading a complex project and build data can be time
// consumming, so display a busy cursor
wxBusyCursor dummy;
// Unlink the old project if needed // Unlink the old project if needed
GetBoard()->ClearProject(); GetBoard()->ClearProject();