Make a bunch of help dialogs modeless.

Fixes https://gitlab.com/kicad/code/kicad/issues/5334
This commit is contained in:
Jeff Young 2020-08-24 23:17:14 +01:00
parent b8bbe72e48
commit 15c136ead2
6 changed files with 35 additions and 28 deletions

View File

@ -587,9 +587,9 @@ void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event )
}
HTML_MESSAGE_BOX dlg( GetParent(), _( "Environment Variable Help" ) );
dlg.SetDialogSizeInDU( 400, 250 );
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, _( "Environment Variable Help" ) );
dlg->SetDialogSizeInDU( 400, 250 );
dlg.AddHTML_Text( msg );
dlg.ShowModal();
dlg->AddHTML_Text( msg );
dlg->ShowModeless();
}

View File

@ -121,3 +121,11 @@ void HTML_MESSAGE_BOX::AddHTML_Text( const wxString& message )
m_htmlWindow->AppendToPage( message );
}
void HTML_MESSAGE_BOX::ShowModeless()
{
m_sdbSizer1->Show( false );
Layout();
Show( true );
}

View File

@ -589,13 +589,16 @@ void DIALOG_BOM::OnEditGenerator( wxCommandEvent& event )
void DIALOG_BOM::OnHelp( wxCommandEvent& event )
{
HTML_MESSAGE_BOX help_Dlg( this, _( "Bill of Material Generation Help" ) );
help_Dlg.SetDialogSizeInDU( 500, 350 );
HTML_MESSAGE_BOX* help_Dlg = new HTML_MESSAGE_BOX( nullptr,
_( "Bill of Material Generation Help" ) );
help_Dlg->SetDialogSizeInDU( 500, 350 );
wxString html_txt;
ConvertMarkdown2Html( wxGetTranslation( s_bomHelpInfo ), html_txt );
help_Dlg.m_htmlWindow->AppendToPage( html_txt );
help_Dlg.ShowModal();
help_Dlg->m_htmlWindow->AppendToPage( html_txt );
help_Dlg->ShowModeless();
}

View File

@ -1389,9 +1389,9 @@ void SCH_TEXT::ShowSyntaxHelp( wxWindow* aParentWindow )
" </tr>"
"</table>" );
HTML_MESSAGE_BOX dlg( aParentWindow, _( "Syntax Help" ) );
dlg.SetDialogSizeInDU( 280, 280 );
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( aParentWindow, _( "Syntax Help" ) );
dlg->SetDialogSizeInDU( 280, 280 );
dlg.AddHTML_Text( msg );
dlg.ShowModal();
dlg->AddHTML_Text( msg );
dlg->ShowModeless();
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,12 +26,6 @@
#define _html_messagebox_
/**
* @file include/html_messagebox.h
*
* Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
*/
#include <../common/dialogs/dialog_display_info_HTML_base.h>
@ -51,7 +45,7 @@ public:
~HTML_MESSAGE_BOX() override;
/**
* set the dialog size, using a "logical value.
* set the dialog size, using a "logical" value.
* the physical size in pixel will depend on the display definition
* so a value used here shoul be OK with any display (HDPI for instance)
* @param aWidth is a "logical" value of the dialog width.
@ -81,17 +75,19 @@ public:
/**
* Add a message (in bold) to message list.
*
* @param message = the message
*/
void MessageSet( const wxString& message );
/**
* Add HTML text (without any change) to message list.
*
* @param message = the text to add
*/
void AddHTML_Text( const wxString& message );
/**
* Show a modeless version of the dialog (without an OK button).
*/
void ShowModeless();
};
#endif // _html_messagebox_

View File

@ -406,9 +406,9 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
" (condition \"A.netclass == 'HV' && B.netclass == 'HV'\"))\r"
"</pre>";
HTML_MESSAGE_BOX dlg( m_parent, _( "Syntax Help" ) );
dlg.SetDialogSizeInDU( 320, 320 );
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
dlg->SetDialogSizeInDU( 320, 320 );
dlg.AddHTML_Text( msg );
dlg.ShowModal();
dlg->AddHTML_Text( msg );
dlg->ShowModeless();
}