From 4eece522df02593a6709a2eeddd0ada7c8d0a591 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 8 Sep 2018 21:24:29 -0700 Subject: [PATCH] kicad: keep KIDIALOG boxes above other windows Until answered, dialog boxes should remain at the front. This flag only works for MSW and GTK. --- common/confirm.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/confirm.cpp b/common/confirm.cpp index 2f4e7a63d3..43ff1df114 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -44,7 +44,8 @@ static std::unordered_map doNotShowAgainDlgs; KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString& aCaption, long aStyle ) - : wxRichMessageDialog( aParent, aMessage, aCaption, aStyle | wxCENTRE ) + : wxRichMessageDialog( aParent, aMessage, aCaption, aStyle | wxCENTRE | wxSTAY_ON_TOP ), + m_hash( 0 ) { } @@ -136,7 +137,7 @@ wxString KIDIALOG::getCaption( KD_TYPE aType, const wxString& aCaption ) long KIDIALOG::getStyle( KD_TYPE aType ) { - long style = wxOK | wxCENTRE; + long style = wxOK | wxCENTRE | wxSTAY_ON_TOP; switch( aType ) { @@ -235,7 +236,7 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) int icon = displaytime > 0 ? wxICON_INFORMATION : wxICON_ERROR; dialog = new wxMessageDialog( parent, text, _( "Warning" ), - wxOK | wxCENTRE | wxRESIZE_BORDER | icon ); + wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP ); dialog->ShowModal(); dialog->Destroy(); @@ -247,7 +248,8 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri wxRichMessageDialog* dlg; dlg = new wxRichMessageDialog( aParent, aText, _( "Error" ), - wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR ); + wxOK | wxCENTRE | wxRESIZE_BORDER | + wxICON_ERROR | wxSTAY_ON_TOP ); if( !aExtraInfo.IsEmpty() ) { @@ -264,7 +266,8 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt wxRichMessageDialog* dlg; dlg = new wxRichMessageDialog( aParent, aMessage, _( "Info" ), - wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_INFORMATION ); + wxOK | wxCENTRE | wxRESIZE_BORDER | + wxICON_INFORMATION | wxSTAY_ON_TOP ); if( !aExtraInfo.IsEmpty() ) {