diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index b45f27b667..36ffb30597 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -17,7 +17,6 @@ set( COMMON_ABOUT_DLG_SRCS
dialogs/dialog_get_component_base.cpp
dialogs/dialog_hotkeys_editor.cpp
dialogs/dialog_hotkeys_editor_base.cpp
- dialogs/dialog_load_error.cpp
dialogs/dialog_page_settings_base.cpp
)
@@ -58,6 +57,7 @@ set(COMMON_SRCS
gr_basic.cpp
hotkeys_basic.cpp
hotkey_grid_table.cpp
+ html_messagebox.cpp
msgpanel.cpp
netlist_keywords.cpp
newstroke_font.cpp
diff --git a/common/dialogs/dialog_load_error.cpp b/common/html_messagebox.cpp
similarity index 63%
rename from common/dialogs/dialog_load_error.cpp
rename to common/html_messagebox.cpp
index f833431770..cf41c0c35c 100644
--- a/common/dialogs/dialog_load_error.cpp
+++ b/common/html_messagebox.cpp
@@ -1,22 +1,22 @@
#include "fctsys.h"
-#include "dialog_load_error.h"
+#include "html_messagebox.h"
#include "macros.h"
-DIALOG_LOAD_ERROR::DIALOG_LOAD_ERROR( wxWindow* parent )
-:
-DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, _("Load Error!"),wxDefaultPosition, wxSize( 450,250 ) )
+HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
+ wxPoint aPos, wxSize aSize)
+ : DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
{
SetFocus();
ListClear();
}
-void DIALOG_LOAD_ERROR::OnCloseButtonClick( wxCommandEvent& event )
+void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
{
EndModal(0);
}
-void DIALOG_LOAD_ERROR::ListClear(void)
+void HTML_MESSAGE_BOX::ListClear(void)
{
m_htmlWindow->SetPage(wxEmptyString);
}
@@ -26,7 +26,7 @@ void DIALOG_LOAD_ERROR::ListClear(void)
* Add a list of items.
* @param aList = a string containing items. Items are separated by '\n'
*/
-void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
+void HTML_MESSAGE_BOX::ListSet(const wxString &aList)
{
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
@@ -48,7 +48,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
* Add a list of items.
* @param aList = a wxArrayString containing items
*/
-void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
+void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
{
wxString msg = wxT("
");
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
@@ -65,10 +65,20 @@ void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
* Add a message (in bold) to message list.
* @param message = the message
*/
-void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
+void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
{
wxString message_value;
message_value.Printf(wxT("%s
"), GetChars( message ) );
m_htmlWindow->AppendToPage( message_value );
}
+/**
+ * Function AddHTML_Text
+ * Add a text to message list.
+ * @param message = the text to add
+ */
+void HTML_MESSAGE_BOX::AddHTML_Text(const wxString &message)
+{
+ m_htmlWindow->AppendToPage( message );
+}
+
diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp
index 9960a0c749..64885bcc22 100644
--- a/cvpcb/cvframe.cpp
+++ b/cvpcb/cvframe.cpp
@@ -17,7 +17,7 @@
#include "dialog_cvpcb_config.h"
#include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h"
-#include "dialog_load_error.h"
+#include "html_messagebox.h"
#include "build_version.h"
@@ -578,7 +578,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
/* Display error messages, if any */
if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
{
- DIALOG_LOAD_ERROR dialog( NULL );
+ HTML_MESSAGE_BOX dialog( this, _("Load Error") );
if( !m_footprints.m_filesNotFound.IsEmpty() )
{
diff --git a/eeschema/eelibs_read_libraryfiles.cpp b/eeschema/eelibs_read_libraryfiles.cpp
index c02572e1a6..9f468fe106 100644
--- a/eeschema/eelibs_read_libraryfiles.cpp
+++ b/eeschema/eelibs_read_libraryfiles.cpp
@@ -11,7 +11,7 @@
#include "general.h"
#include "class_library.h"
-#include "dialog_load_error.h"
+#include "html_messagebox.h"
/**
@@ -94,7 +94,7 @@ void SCH_EDIT_FRAME::LoadLibraries( void )
/* Print the libraries not found */
if( !libraries_not_found.IsEmpty() )
{
- DIALOG_LOAD_ERROR dialog( this );
+ HTML_MESSAGE_BOX dialog( this, _("Files not found") );
dialog.MessageSet( _( "The following libraries could not be found:" ) );
dialog.ListSet( libraries_not_found );
libraries_not_found.empty();
diff --git a/gerbview/excellon_read_drill_file.cpp b/gerbview/excellon_read_drill_file.cpp
index 54ded90428..c316b405bf 100644
--- a/gerbview/excellon_read_drill_file.cpp
+++ b/gerbview/excellon_read_drill_file.cpp
@@ -70,7 +70,7 @@
#include
-#include "dialog_load_error.h"
+#include "html_messagebox.h"
extern int ReadInt( char*& text, bool aSkipSeparator = true );
extern double ReadDouble( char*& text, bool aSkipSeparator = true );
@@ -180,7 +180,7 @@ bool GERBVIEW_FRAME::Read_EXCELLON_File( const wxString& aFullFileName )
// Display errors list
if( m_Messages.size() > 0 )
{
- DIALOG_LOAD_ERROR dlg( this );
+ HTML_MESSAGE_BOX dlg( this, _("Files not found") );
dlg.ListSet( m_Messages );
dlg.ShowModal();
}
diff --git a/gerbview/readgerb.cpp b/gerbview/readgerb.cpp
index b479437c4d..6e41d33d28 100644
--- a/gerbview/readgerb.cpp
+++ b/gerbview/readgerb.cpp
@@ -10,7 +10,7 @@
#include "gerbview.h"
#include "class_GERBER.h"
-#include "dialog_load_error.h"
+#include "html_messagebox.h"
/* Read a gerber file, RS274D or RS274X format.
*/
@@ -156,7 +156,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName,
// Display errors list
if( m_Messages.size() > 0 )
{
- DIALOG_LOAD_ERROR dlg( this );
+ HTML_MESSAGE_BOX dlg( this, _("Errors") );
dlg.ListSet(m_Messages);
dlg.ShowModal();
}
diff --git a/include/dialog_load_error.h b/include/html_messagebox.h
similarity index 57%
rename from include/dialog_load_error.h
rename to include/html_messagebox.h
index 965660d378..5d89965e37 100644
--- a/include/dialog_load_error.h
+++ b/include/html_messagebox.h
@@ -1,5 +1,5 @@
-#ifndef __dialog_load_error_h_
-#define __dialog_load_error_h_
+#ifndef _html_messagebox_
+#define _html_messagebox_
/**
@file
@@ -8,16 +8,18 @@ Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
#include "../common/dialogs/dialog_display_info_HTML_base.h"
-/** Implementing DIALOG_LOAD_ERROR */
-class DIALOG_LOAD_ERROR : public DIALOG_DISPLAY_HTML_TEXT_BASE
+/** Implementing HTML_MESSAGE_BOX */
+class HTML_MESSAGE_BOX : public DIALOG_DISPLAY_HTML_TEXT_BASE
{
protected:
- // Handlers for DIALOG_LOAD_ERROR_BASE events.
+ // Handlers for HTML_MESSAGE_BOX_BASE events.
void OnCloseButtonClick( wxCommandEvent& event );
public:
/** Constructor */
- DIALOG_LOAD_ERROR( wxWindow* parent );
+ HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
+ wxPoint aPos = wxDefaultPosition,
+ wxSize aSize = wxSize( 450,250 ) );
/**
* Function ListSet
@@ -39,6 +41,13 @@ public:
* @param message = the message
*/
void MessageSet(const wxString &message);
+
+ /**
+ * Function AddHTML_Text
+ * Add a html text (without any change) to message list.
+ * @param message = the text to add
+ */
+ void AddHTML_Text(const wxString &message);
};
-#endif // __dialog_load_error_h_
+#endif // _html_messagebox_