From 5817a8b5f4424d1a5fc442f2cd0152f1d240ea13 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Mon, 18 Oct 2021 00:29:40 +0100 Subject: [PATCH] Remove unused m_host variable This variable isn't needed anymore after 5f530192908758be9a2dfb26f01ad0bda89270d8 pushed dark mode handling into the HTML window itself. --- common/dialogs/dialog_configure_paths.cpp | 2 +- common/dialogs/html_message_box.cpp | 21 +-------------------- eeschema/dialogs/dialog_bom.cpp | 2 +- eeschema/sch_text.cpp | 2 +- include/dialogs/html_message_box.h | 3 --- pcbnew/dialogs/panel_setup_rules.cpp | 2 +- 6 files changed, 5 insertions(+), 27 deletions(-) diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index ed86ecea79..7ac141ee60 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -621,7 +621,7 @@ void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event ) } - m_helpDialog = new HTML_MESSAGE_BOX( nullptr, this, _( "Environment Variable Help" ) ); + m_helpDialog = new HTML_MESSAGE_BOX( nullptr, _( "Environment Variable Help" ) ); m_helpDialog->SetDialogSizeInDU( 400, 250 ); m_helpDialog->AddHTML_Text( msg ); diff --git a/common/dialogs/html_message_box.cpp b/common/dialogs/html_message_box.cpp index e9b95c3e62..bdc01adf64 100644 --- a/common/dialogs/html_message_box.cpp +++ b/common/dialogs/html_message_box.cpp @@ -29,28 +29,9 @@ #include -HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, wxWindow* aHost, const wxString& aTitle ) : - DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize ), - m_host( aHost ) -{ - m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight ); - ListClear(); - - Center(); - - m_sdbSizer1OK->SetDefault(); - - reload(); - - Bind( wxEVT_SYS_COLOUR_CHANGED, - wxSysColourChangedEventHandler( HTML_MESSAGE_BOX::onThemeChanged ), this ); -} - - HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle, const wxPoint& aPosition, const wxSize& aSize ) : - DIALOG_DISPLAY_HTML_TEXT_BASE( nullptr, wxID_ANY, aTitle, aPosition, aSize ), - m_host( aParent ) + DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, wxID_ANY, aTitle, aPosition, aSize ) { m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight ); ListClear(); diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 8eaca890e8..56804242f6 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -458,7 +458,7 @@ void DIALOG_BOM::OnHelp( wxCommandEvent& event ) return; } - m_helpWindow = new HTML_MESSAGE_BOX( nullptr, this, _( "Bill of Material Generation Help" ) ); + m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Bill of Material Generation Help" ) ); m_helpWindow->SetDialogSizeInDU( 500, 350 ); wxString html_txt; diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 61b24795bf..4506328ae6 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -1721,7 +1721,7 @@ HTML_MESSAGE_BOX* SCH_TEXT::ShowSyntaxHelp( wxWindow* aParentWindow ) #include "sch_text_help_md.h" ; - HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, aParentWindow, _( "Syntax Help" ) ); + HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) ); wxSize sz( 320, 320 ); dlg->SetMinSize( dlg->ConvertDialogToPixels( sz ) ); diff --git a/include/dialogs/html_message_box.h b/include/dialogs/html_message_box.h index bb736bab1f..51e77293c6 100644 --- a/include/dialogs/html_message_box.h +++ b/include/dialogs/html_message_box.h @@ -35,8 +35,6 @@ public: const wxPoint& aPosition = wxDefaultPosition, const wxSize& aSize = wxDefaultSize ); - HTML_MESSAGE_BOX( wxWindow* aParent, wxWindow* aHost, const wxString& aTitle ); - ~HTML_MESSAGE_BOX() override; /** @@ -92,7 +90,6 @@ protected: virtual void OnCharHook( wxKeyEvent& aEvt ) override; private: - wxWindow* m_host; wxString m_source; }; diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index c64566f6fa..3b8567b2d5 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -540,7 +540,7 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent ) msg.Replace( "Ctrl+", "Cmd+" ); #endif - m_helpWindow = new HTML_MESSAGE_BOX( nullptr, this, _( "Syntax Help" ) ); + m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) ); m_helpWindow->SetDialogSizeInDU( 320, 320 ); wxString html_txt;