Dark mode for a bunch of HTML dialogs.

WX_HTML_REPORT_BOX
WX_HTML_REPORT_PANEL
HTML_MESSAGEBOX
DIALOG_DISPLAY_HTML_TEXT

Fixes https://gitlab.com/kicad/code/kicad/issues/9157

Fixes https://gitlab.com/kicad/code/kicad/issues/9156
This commit is contained in:
Jeff Young 2021-09-14 19:26:03 +01:00
parent 666f7ea38c
commit 3aae3c6f65
35 changed files with 217 additions and 98 deletions

View File

@ -158,7 +158,7 @@ set( COMMON_DLG_SRCS
dialogs/dialog_color_picker_base.cpp
dialogs/dialog_configure_paths.cpp
dialogs/dialog_configure_paths_base.cpp
dialogs/dialog_display_info_HTML_base.cpp
dialogs/dialog_display_html_text_base.cpp
dialogs/dialog_edit_library_tables.cpp
dialogs/dialog_global_lib_table_config.cpp
dialogs/dialog_global_lib_table_config_base.cpp
@ -186,7 +186,7 @@ set( COMMON_DLG_SRCS
dialogs/eda_list_dialog_base.cpp
dialogs/eda_view_switcher.cpp
dialogs/eda_view_switcher_base.cpp
dialogs/html_messagebox.cpp
dialogs/html_message_box.cpp
dialogs/panel_color_settings_base.cpp
dialogs/panel_color_settings.cpp
dialogs/panel_common_settings.cpp

View File

@ -26,7 +26,7 @@
#include <wx/richmsgdlg.h>
#include <wx/choicdlg.h>
#include <confirm.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <functional>
#include <unordered_map>

View File

@ -42,7 +42,7 @@
*/
#include <bitmaps.h>
#include <build_version.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <tool/tool_manager.h>
#include "dialog_about.h"

View File

@ -28,7 +28,7 @@
#include <confirm.h>
#include <menus_helpers.h>
#include <validators.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <filename_resolver.h>
#include <env_vars.h>
#include <grid_tricks.h>
@ -621,7 +621,7 @@ void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event )
}
m_helpDialog = new HTML_MESSAGE_BOX( nullptr, _( "Environment Variable Help" ) );
m_helpDialog = new HTML_MESSAGE_BOX( nullptr, this, _( "Environment Variable Help" ) );
m_helpDialog->SetDialogSizeInDU( 400, 250 );
m_helpDialog->AddHTML_Text( msg );

View File

@ -5,7 +5,7 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_display_info_HTML_base.h"
#include "dialogs/dialog_display_html_text_base.h"
///////////////////////////////////////////////////////////////////////////

View File

@ -11,12 +11,12 @@
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_display_info_HTML_base</property>
<property name="file">dialog_display_html_text_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_display_info_HTML</property>
<property name="name">dialog_display_html_text_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
@ -101,7 +101,7 @@
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>

View File

@ -24,13 +24,33 @@
#include <wx/clipbrd.h>
#include <wx/log.h>
#include <wx/textctrl.h>
#include <string_utils.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
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( aParent, wxID_ANY, aTitle, aPosition, aSize )
DIALOG_DISPLAY_HTML_TEXT_BASE( nullptr, wxID_ANY, aTitle, aPosition, aSize ),
m_host( aParent )
{
m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight );
ListClear();
@ -42,6 +62,11 @@ HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle,
Center();
m_sdbSizer1OK->SetDefault();
reload();
Bind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( HTML_MESSAGE_BOX::onThemeChanged ), this );
}
@ -53,9 +78,37 @@ HTML_MESSAGE_BOX::~HTML_MESSAGE_BOX()
}
void HTML_MESSAGE_BOX::reload()
{
// Handle light/dark mode colors...
wxTextCtrl dummy( m_host, wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
m_htmlWindow->SetPage( wxString::Format( wxT( "<html>"
" <body bgcolor='%s' text='%s'>"
" %s"
" </body>"
"</html>" ),
background.GetAsString( wxC2S_HTML_SYNTAX ),
foreground.GetAsString( wxC2S_HTML_SYNTAX ),
m_source ) );
}
void HTML_MESSAGE_BOX::onThemeChanged( wxSysColourChangedEvent &aEvent )
{
reload();
aEvent.Skip();
}
void HTML_MESSAGE_BOX::ListClear()
{
m_htmlWindow->SetPage( wxEmptyString );
m_source.clear();
reload();
}
@ -74,7 +127,8 @@ void HTML_MESSAGE_BOX::ListSet( const wxString& aList )
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
m_source += msg;
reload();
}
@ -90,27 +144,31 @@ void HTML_MESSAGE_BOX::ListSet( const wxArrayString& aList )
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
m_source += msg;
reload();
}
void HTML_MESSAGE_BOX::MessageSet( const wxString& message )
{
wxString message_value = wxString::Format(
wxT( "<b>%s</b><br>" ), message );
wxString message_value = wxString::Format( wxT( "<b>%s</b><br>" ), message );
m_htmlWindow->AppendToPage( message_value );
m_source += message_value;
reload();
}
void HTML_MESSAGE_BOX::AddHTML_Text( const wxString& message )
{
m_htmlWindow->AppendToPage( message );
m_source += message;
reload();
}
void HTML_MESSAGE_BOX::ShowModeless()
{
reload();
m_sdbSizer1->Show( false );
Layout();

View File

@ -21,6 +21,7 @@
#include <math/util.h>
#include <common.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include "wx_html_report_box.h"
@ -30,6 +31,18 @@ WX_HTML_REPORT_BOX::WX_HTML_REPORT_BOX( wxWindow* parent, wxWindowID id, const w
m_units( EDA_UNITS::MILLIMETRES ),
m_immediateMode( false )
{
Flush();
Bind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( WX_HTML_REPORT_BOX::onThemeChanged ), this );
}
void WX_HTML_REPORT_BOX::onThemeChanged( wxSysColourChangedEvent &aEvent )
{
Flush();
aEvent.Skip();
}
@ -62,16 +75,19 @@ void WX_HTML_REPORT_BOX::Flush()
wxString WX_HTML_REPORT_BOX::addHeader( const wxString& aBody )
{
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
// Handle light/dark mode colors...
wxTextCtrl dummy( GetParent(), wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
return wxString::Format( wxT( "<html>"
" <body bgcolor='%s' text='%s'>"
" %s"
" </body>"
"</html>" ),
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
background.GetAsString( wxC2S_HTML_SYNTAX ),
foreground.GetAsString( wxC2S_HTML_SYNTAX ),
aBody );
}

View File

@ -60,6 +60,8 @@ public:
void Clear();
private:
void onThemeChanged( wxSysColourChangedEvent &aEvent );
wxString addHeader( const wxString& aBody );
wxString generateHtml( const wxString& aLine );

View File

@ -32,13 +32,10 @@
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/menu.h>
#include <wx/textctrl.h>
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style ) :
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style ) :
WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
m_reporter( this ),
m_severities( -1 ),
@ -46,10 +43,14 @@ WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
{
syncCheckboxes();
m_htmlView->SetFont( KIUI::GetInfoFont( m_htmlView ) );
m_htmlView->SetPage( addHeader( "" ) );
Flush();
Connect( wxEVT_COMMAND_MENU_SELECTED,
wxMenuEventHandler( WX_HTML_REPORT_PANEL::onMenuEvent ), nullptr, this );
m_htmlView->Bind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( WX_HTML_REPORT_PANEL::onThemeChanged ),
this );
}
@ -58,6 +59,14 @@ WX_HTML_REPORT_PANEL::~WX_HTML_REPORT_PANEL()
}
void WX_HTML_REPORT_PANEL::onThemeChanged( wxSysColourChangedEvent &aEvent )
{
Flush();
aEvent.Skip();
}
void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize( const wxSize& aMinSize )
{
m_fgSizer->SetMinSize( aMinSize );
@ -150,12 +159,19 @@ void WX_HTML_REPORT_PANEL::updateBadges()
wxString WX_HTML_REPORT_PANEL::addHeader( const wxString& aBody )
{
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
// Handle light/dark mode colors...
return wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
wxTextCtrl dummy( GetParent(), wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
return wxString::Format( wxT( "<html>"
" <body bgcolor='%s' text='%s'>"
" %s"
" </body>"
"</html>" ),
background.GetAsString( wxC2S_HTML_SYNTAX ),
foreground.GetAsString( wxC2S_HTML_SYNTAX ),
aBody );
}
@ -211,14 +227,10 @@ wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine )
{
switch( aLine.severity )
{
case RPT_SEVERITY_ERROR:
return _( "Error:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
case RPT_SEVERITY_WARNING:
return _( "Warning:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
case RPT_SEVERITY_INFO:
return _( "Info:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
default:
return aLine.message + wxT( "\n" );
case RPT_SEVERITY_ERROR: return _( "Error:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
case RPT_SEVERITY_WARNING: return _( "Warning:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
case RPT_SEVERITY_INFO: return _( "Info:" ) + wxS( " " ) + aLine.message + wxT( "\n" );
default: return aLine.message + wxT( "\n" );
}
}
@ -420,20 +432,9 @@ void WX_HTML_REPORT_PANEL::SetShowSeverity( SEVERITY aSeverity, bool aValue )
{
switch( aSeverity )
{
case RPT_SEVERITY_INFO:
m_checkBoxShowInfos->SetValue( aValue );
break;
case RPT_SEVERITY_ACTION:
m_checkBoxShowActions->SetValue( aValue );
break;
case RPT_SEVERITY_WARNING:
m_checkBoxShowWarnings->SetValue( aValue );
break;
default:
m_checkBoxShowErrors->SetValue( aValue );
break;
case RPT_SEVERITY_INFO: m_checkBoxShowInfos->SetValue( aValue ); break;
case RPT_SEVERITY_ACTION: m_checkBoxShowActions->SetValue( aValue ); break;
case RPT_SEVERITY_WARNING: m_checkBoxShowWarnings->SetValue( aValue ); break;
default: m_checkBoxShowErrors->SetValue( aValue ); break;
}
}

View File

@ -121,6 +121,8 @@ private:
void onBtnSaveToFile( wxCommandEvent& event ) override;
void onThemeChanged( wxSysColourChangedEvent &aEvent );
private:
WX_HTML_PANEL_REPORTER m_reporter;

View File

@ -30,7 +30,7 @@
#include <footprint_info.h>
#include <fp_lib_table.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <string_utils.h>
#include <kiface_ids.h>
#include <kiway.h>

View File

@ -35,7 +35,7 @@
#include <core/arraydim.h>
#include <geometry/shape_line_chain.h>
#include <render_settings.h>
#include "dialog_display_info_HTML_base.h"
#include "dialogs/dialog_display_html_text_base.h"
/* The graphic shape of markers is a polygon.

View File

@ -25,7 +25,7 @@
#include <confirm.h>
#include <fp_lib_table.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <kiway.h>
#include <lib_id.h>
#include <macros.h>

View File

@ -35,7 +35,7 @@
#include <string_utils.h>
#include <eeschema_settings.h>
#include <gestfich.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <i18n_utility.h> // for _HKI definition used in dialog_bom_help_md.h
#include <invoke_sch_dialog.h>
#include <kiface_i.h>
@ -458,13 +458,13 @@ void DIALOG_BOM::OnHelp( wxCommandEvent& event )
return;
}
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Bill of Material Generation Help" ) );
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, this, _( "Bill of Material Generation Help" ) );
m_helpWindow->SetDialogSizeInDU( 500, 350 );
wxString html_txt;
ConvertMarkdown2Html( wxGetTranslation( s_bomHelpInfo ), html_txt );
m_helpWindow->m_htmlWindow->AppendToPage( html_txt );
m_helpWindow->AddHTML_Text( html_txt );
m_helpWindow->ShowModeless();
}

View File

@ -27,7 +27,7 @@
#include <sch_sheet_pin.h>
#include <sch_validators.h>
#include <dialog_sheet_pin_properties.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <string_utils.h>

View File

@ -33,7 +33,7 @@
#include <sch_symbol.h>
#include <sch_reference_list.h>
#include <schematic.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <dialog_text_and_label_properties.h>
#include <string_utils.h>
#include <tool/actions.h>

View File

@ -32,7 +32,7 @@
#include <executable_names.h>
#include <gestfich.h>
#include <hierarch.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <invoke_sch_dialog.h>
#include <string_utils.h>
#include <kiface_i.h>

View File

@ -42,7 +42,7 @@
#include <default_values.h>
#include <wx/debug.h>
#include <wx/log.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <core/mirror.h>
@ -1728,7 +1728,7 @@ HTML_MESSAGE_BOX* SCH_TEXT::ShowSyntaxHelp( wxWindow* aParentWindow )
#include "sch_text_help_md.h"
;
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
HTML_MESSAGE_BOX* dlg = new HTML_MESSAGE_BOX( nullptr, aParentWindow, _( "Syntax Help" ) );
wxSize sz( 320, 320 );
dlg->SetMinSize( dlg->ConvertDialogToPixels( sz ) );
@ -1736,7 +1736,7 @@ HTML_MESSAGE_BOX* SCH_TEXT::ShowSyntaxHelp( wxWindow* aParentWindow )
wxString html_txt;
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
dlg->m_htmlWindow->AppendToPage( html_txt );
dlg->AddHTML_Text( html_txt );
dlg->ShowModeless();
return dlg;

View File

@ -25,7 +25,7 @@
#include <symbol_library_manager.h>
#include <symbol_library.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <symbol_edit_frame.h>
#include <env_paths.h>
#include <pgm_base.h>

View File

@ -23,7 +23,7 @@
#include <wx/tokenzr.h>
#include <wx/window.h>
#include <widgets/wx_progress_reporters.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <eda_pattern_match.h>
#include <generate_alias_info.h>
#include <lib_symbol.h>

View File

@ -39,11 +39,42 @@
#include <eda_doc.h>
#include <sch_marker.h>
#include <project.h>
#include <dialogs/dialog_display_info_HTML_base.h>
#include <dialogs/dialog_display_html_text_base.h>
#include <dialogs/dialog_erc.h>
#include <math/util.h> // for KiROUND
class DIALOG_DISPLAY_HTML_TEXT : public DIALOG_DISPLAY_HTML_TEXT_BASE
{
public:
DIALOG_DISPLAY_HTML_TEXT( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
const wxPoint& aPos, const wxSize& aSize, long aStyle = 0 ) :
DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, aId, aTitle, aPos, aSize, aStyle )
{ }
~DIALOG_DISPLAY_HTML_TEXT()
{ }
void SetPage( const wxString& message )
{
// Handle light/dark mode colors...
wxTextCtrl dummy( GetParent(), wxID_ANY );
wxColour foreground = dummy.GetForegroundColour();
wxColour background = dummy.GetBackgroundColour();
m_htmlWindow->SetPage( wxString::Format( wxT( "<html>"
" <body bgcolor='%s' text='%s'>"
" %s"
" </body>"
"</html>" ),
background.GetAsString( wxC2S_HTML_SYNTAX ),
foreground.GetAsString( wxC2S_HTML_SYNTAX ),
message ) );
}
};
EE_INSPECTION_TOOL::EE_INSPECTION_TOOL() :
EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.InspectionTool" ),
m_ercDialog( nullptr )
@ -443,15 +474,15 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ) );
for( auto& msgPart : messages )
outmsg += msgPart;
for( const wxString& msg : messages )
outmsg += msg;
outmsg += "</body></html>";
DIALOG_DISPLAY_HTML_TEXT_BASE error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
wxDefaultPosition, wxSize( 700, 350 ) );
DIALOG_DISPLAY_HTML_TEXT error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
wxDefaultPosition, wxSize( 700, 350 ) );
error_display.m_htmlWindow->SetPage( outmsg );
error_display.SetPage( outmsg );
error_display.ShowModal();
}

View File

@ -79,7 +79,7 @@
#include <cmath>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
// A helper function to calculate the arc center of an arc
// known by 2 end points, the radius, and the angle direction (CW or CCW)

View File

@ -26,7 +26,7 @@
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <reporter.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <gerbview_frame.h>
#include <gerbview_id.h>
#include <gerber_file_image.h>

View File

@ -39,7 +39,7 @@
#include <gerbview_frame.h>
#include <reporter.h>
#include <gbr_metadata.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <view/view.h>
#include <wx/filedlg.h>

View File

@ -30,7 +30,7 @@
#include <gerber_file_image_list.h>
#include <view/view.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <macros.h>
#include <wx/msgdlg.h>

View File

@ -32,6 +32,7 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
private:
protected:
wxHtmlWindow* m_htmlWindow;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
@ -40,7 +41,6 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
public:
wxHtmlWindow* m_htmlWindow;
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE();

View File

@ -22,11 +22,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _html_messagebox_
#define _html_messagebox_
#ifndef HTML_MESSAGE_BOX_H
#define HTML_MESSAGE_BOX_H
#include <../common/dialogs/dialog_display_info_HTML_base.h>
#include <dialogs/dialog_display_html_text_base.h>
class HTML_MESSAGE_BOX : public DIALOG_DISPLAY_HTML_TEXT_BASE
@ -35,6 +34,9 @@ public:
HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle = wxEmptyString,
const wxPoint& aPosition = wxDefaultPosition,
const wxSize& aSize = wxDefaultSize );
HTML_MESSAGE_BOX( wxWindow* aParent, wxWindow* aHost, const wxString& aTitle );
~HTML_MESSAGE_BOX() override;
/**
@ -84,7 +86,14 @@ public:
void ShowModeless();
protected:
void reload();
void onThemeChanged( wxSysColourChangedEvent &aEvent );
virtual void OnCharHook( wxKeyEvent& aEvt ) override;
private:
wxWindow* m_host;
wxString m_source;
};
#endif // _html_messagebox_
#endif // HTML_MESSAGE_BOX_H

View File

@ -35,7 +35,7 @@
#include "pl_editor_frame.h"
#include "tools/pl_selection_tool.h"
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ) :
@ -563,7 +563,7 @@ void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
message = "KICAD_VERSION\n";
message << "# " << _( "(sheet number)" ) << "\n";
message << "## " << _( "(sheet count)" ) << "\n";
message << "COMMENT1 COMMENT9\n";
message << "COMMENT1 <EFBFBD> COMMENT9\n";
message << "COMPANY\n";
message << "FILENAME\n";
message << "ISSUE_DATE\n";

View File

@ -31,7 +31,7 @@
#include <wx/valnum.h>
#include <board_commit.h>
#include <pcb_layer_box_selector.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <tool/tool_manager.h>
#include <tool/actions.h>
#include <pcb_shape.h>

View File

@ -24,7 +24,7 @@
#include <project.h>
#include <kiface_i.h>
#include <confirm.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <reporter.h>

View File

@ -36,7 +36,7 @@
#include <geometry/shape_segment.h>
#include <dialog_pad_properties.h>
#include <gal/graphics_abstraction_layer.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <macros.h>
#include <pad.h>
#include <pcb_base_frame.h>

View File

@ -34,7 +34,7 @@
#include <panel_setup_rules.h>
#include <wx_html_report_box.h>
#include <wx/treebook.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <scintilla_tricks.h>
#include <drc/drc_rule_parser.h>
#include <tools/drc_tool.h>
@ -468,12 +468,12 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent )
msg.Replace( "Ctrl+", "Cmd+" );
#endif
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, this, _( "Syntax Help" ) );
m_helpWindow->SetDialogSizeInDU( 320, 320 );
wxString html_txt;
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
m_helpWindow->m_htmlWindow->AppendToPage( html_txt );
m_helpWindow->AddHTML_Text( html_txt );
m_helpWindow->ShowModeless();
}

View File

@ -25,7 +25,7 @@
#include <footprint.h>
#include <footprint_info.h>
#include <fp_lib_table.h>
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include <string_utils.h>
#include <locale_io.h>
#include <kiway.h>

View File

@ -22,7 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dialogs/html_messagebox.h>
#include <dialogs/html_message_box.h>
#include "dialog_import_gfx.h"
#include <kiface_i.h>