*) Change FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE*, const wxString*)

To use multiple working threads.  This entailed adding KiCad typedefs:
*) Add typedefs for MUTEX and MUTLOCK which mask the actual choices for the project.
*) Add FOOTPRINT_LIST::DisplayErrors( wxWindow* ) which is a single strategy for
   showing aggregated load errors.  Although what's there is only scaffolding
   and needs a volunteer who knows HTML pretty well.
*) Ensure all callers of ReadFootprintFiles() use the new DisplayErrors() function.   
*) Push utf8.cpp and utf8.h into common library for open use.
This commit is contained in:
Dick Hollenbeck
2013-12-09 12:09:58 -06:00
parent 7717aa9279
commit dba4fccec9
22 changed files with 848 additions and 470 deletions
+40 -45
View File
@@ -1,83 +1,78 @@
#include <fctsys.h>
#include <html_messagebox.h>
#include <macros.h>
#include <common.h>
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 )
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 )
{
ListClear();
Center();
}
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
{
EndModal(0);
EndModal( 0 );
}
void HTML_MESSAGE_BOX::ListClear(void)
void HTML_MESSAGE_BOX::ListClear()
{
m_htmlWindow->SetPage(wxEmptyString);
m_htmlWindow->SetPage( wxEmptyString );
}
/**
* Function ListSet
* Add a list of items.
* @param aList = a string containing items. Items are separated by '\n'
*/
void HTML_MESSAGE_BOX::ListSet(const wxString &aList)
{
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar('\n') );
wxString msg = wxT("<ul>");
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii ++ )
void HTML_MESSAGE_BOX::ListSet( const wxString& aList )
{
// wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar( '\n' ) );
wxString msg = wxT( "<ul>" );
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii++ )
{
msg += wxT("<li>");
msg += strings_list->Item(ii) + wxT("</li>");
msg += wxT( "<li>" );
msg += strings_list->Item( ii ) + wxT( "</li>" );
}
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
delete strings_list;
}
/**
* Function ListSet
* Add a list of items.
* @param aList = a wxArrayString containing items
*/
void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
void HTML_MESSAGE_BOX::ListSet( const wxArrayString& aList )
{
wxString msg = wxT("<ul>");
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
wxString msg = wxT( "<ul>" );
for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{
msg += wxT("<li>");
msg += aList.Item(ii) + wxT("</li>");
msg += wxT( "<li>" );
msg += aList.Item( ii ) + wxT( "</li>" );
}
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
}
/**
* Function MessageSet
* Add a message (in bold) to message list.
* @param message = the message
*/
void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
void HTML_MESSAGE_BOX::MessageSet( const wxString& message )
{
wxString message_value;
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
wxString message_value = wxString::Format(
wxT( "<b>%s</b><br>" ), 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)
void HTML_MESSAGE_BOX::AddHTML_Text( const wxString& message )
{
m_htmlWindow->AppendToPage( message );
}