Fix another case of 413ff4525b
.
This commit is contained in:
parent
86b631b31e
commit
78129aabeb
|
@ -174,9 +174,11 @@ void BOM_CFG_PARSER::parseGenerator()
|
||||||
class DIALOG_BOM : public DIALOG_BOM_BASE
|
class DIALOG_BOM : public DIALOG_BOM_BASE
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SCH_EDIT_FRAME* m_parent;
|
SCH_EDIT_FRAME* m_parent;
|
||||||
BOM_GENERATOR_ARRAY m_generators;
|
BOM_GENERATOR_ARRAY m_generators;
|
||||||
bool m_initialized;
|
bool m_initialized;
|
||||||
|
|
||||||
|
HTML_MESSAGE_BOX* m_helpWindow;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DIALOG_BOM( SCH_EDIT_FRAME* parent );
|
DIALOG_BOM( SCH_EDIT_FRAME* parent );
|
||||||
|
@ -224,11 +226,11 @@ int InvokeDialogCreateBOM( SCH_EDIT_FRAME* aCaller )
|
||||||
|
|
||||||
|
|
||||||
DIALOG_BOM::DIALOG_BOM( SCH_EDIT_FRAME* parent ) :
|
DIALOG_BOM::DIALOG_BOM( SCH_EDIT_FRAME* parent ) :
|
||||||
DIALOG_BOM_BASE( parent )
|
DIALOG_BOM_BASE( parent ),
|
||||||
|
m_parent( parent ),
|
||||||
|
m_initialized( false ),
|
||||||
|
m_helpWindow( nullptr )
|
||||||
{
|
{
|
||||||
m_parent = parent;
|
|
||||||
m_initialized = false;
|
|
||||||
|
|
||||||
m_buttonAddGenerator->SetBitmap( KiBitmap( small_plus_xpm ) );
|
m_buttonAddGenerator->SetBitmap( KiBitmap( small_plus_xpm ) );
|
||||||
m_buttonDelGenerator->SetBitmap( KiBitmap( trash_xpm ) );
|
m_buttonDelGenerator->SetBitmap( KiBitmap( trash_xpm ) );
|
||||||
m_buttonEdit->SetBitmap( KiBitmap( small_edit_xpm ) );
|
m_buttonEdit->SetBitmap( KiBitmap( small_edit_xpm ) );
|
||||||
|
@ -252,6 +254,9 @@ DIALOG_BOM::DIALOG_BOM( SCH_EDIT_FRAME* parent ) :
|
||||||
|
|
||||||
DIALOG_BOM::~DIALOG_BOM()
|
DIALOG_BOM::~DIALOG_BOM()
|
||||||
{
|
{
|
||||||
|
if( m_helpWindow )
|
||||||
|
m_helpWindow->Destroy();
|
||||||
|
|
||||||
// TODO(JE) maybe unpack this into JSON instead of sexpr
|
// TODO(JE) maybe unpack this into JSON instead of sexpr
|
||||||
|
|
||||||
// Save the plugin descriptions in config.
|
// Save the plugin descriptions in config.
|
||||||
|
@ -593,16 +598,20 @@ void DIALOG_BOM::OnEditGenerator( wxCommandEvent& event )
|
||||||
|
|
||||||
void DIALOG_BOM::OnHelp( wxCommandEvent& event )
|
void DIALOG_BOM::OnHelp( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
HTML_MESSAGE_BOX* help_Dlg = new HTML_MESSAGE_BOX( nullptr,
|
if( m_helpWindow )
|
||||||
_( "Bill of Material Generation Help" ) );
|
{
|
||||||
|
m_helpWindow->ShowModeless();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
help_Dlg->SetDialogSizeInDU( 500, 350 );
|
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Bill of Material Generation Help" ) );
|
||||||
|
m_helpWindow->SetDialogSizeInDU( 500, 350 );
|
||||||
|
|
||||||
wxString html_txt;
|
wxString html_txt;
|
||||||
ConvertMarkdown2Html( wxGetTranslation( s_bomHelpInfo ), html_txt );
|
ConvertMarkdown2Html( wxGetTranslation( s_bomHelpInfo ), html_txt );
|
||||||
|
|
||||||
help_Dlg->m_htmlWindow->AppendToPage( html_txt );
|
m_helpWindow->m_htmlWindow->AppendToPage( html_txt );
|
||||||
help_Dlg->ShowModeless();
|
m_helpWindow->ShowModeless();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ PANEL_SETUP_RULES::PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFr
|
||||||
m_Parent( aParent ),
|
m_Parent( aParent ),
|
||||||
m_frame( aFrame ),
|
m_frame( aFrame ),
|
||||||
m_scintillaTricks( nullptr ),
|
m_scintillaTricks( nullptr ),
|
||||||
m_helpDialog( nullptr )
|
m_helpWindow( nullptr )
|
||||||
{
|
{
|
||||||
m_scintillaTricks = new SCINTILLA_TRICKS( m_textEditor, wxT( "()" ) );
|
m_scintillaTricks = new SCINTILLA_TRICKS( m_textEditor, wxT( "()" ) );
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ PANEL_SETUP_RULES::~PANEL_SETUP_RULES( )
|
||||||
{
|
{
|
||||||
delete m_scintillaTricks;
|
delete m_scintillaTricks;
|
||||||
|
|
||||||
if( m_helpDialog )
|
if( m_helpWindow )
|
||||||
m_helpDialog->Destroy();
|
m_helpWindow->Destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,6 +438,12 @@ bool PANEL_SETUP_RULES::TransferDataFromWindow()
|
||||||
|
|
||||||
void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
|
void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
|
||||||
{
|
{
|
||||||
|
if( m_helpWindow )
|
||||||
|
{
|
||||||
|
m_helpWindow->ShowModeless();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wxString msg =
|
wxString msg =
|
||||||
#include "dialogs/panel_setup_rules_help_md.h"
|
#include "dialogs/panel_setup_rules_help_md.h"
|
||||||
;
|
;
|
||||||
|
@ -446,12 +452,12 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
|
||||||
msg.Replace( "Ctrl+", "Cmd+" );
|
msg.Replace( "Ctrl+", "Cmd+" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_helpDialog = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
|
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
|
||||||
m_helpDialog->SetDialogSizeInDU( 320, 320 );
|
m_helpWindow->SetDialogSizeInDU( 320, 320 );
|
||||||
|
|
||||||
wxString html_txt;
|
wxString html_txt;
|
||||||
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
|
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
|
||||||
m_helpDialog->m_htmlWindow->AppendToPage( html_txt );
|
m_helpWindow->m_htmlWindow->AppendToPage( html_txt );
|
||||||
|
|
||||||
m_helpDialog->ShowModeless();
|
m_helpWindow->ShowModeless();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ private:
|
||||||
wxRegEx m_netClassRegex;
|
wxRegEx m_netClassRegex;
|
||||||
wxRegEx m_netNameRegex;
|
wxRegEx m_netNameRegex;
|
||||||
|
|
||||||
HTML_MESSAGE_BOX* m_helpDialog;
|
HTML_MESSAGE_BOX* m_helpWindow;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame );
|
PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame );
|
||||||
|
|
Loading…
Reference in New Issue