2009-10-13 11:49:08 +00:00
|
|
|
#include "fctsys.h"
|
2009-07-12 18:27:30 +00:00
|
|
|
#include "dialog_load_error.h"
|
2009-10-13 11:49:08 +00:00
|
|
|
#include "macros.h"
|
2009-07-12 18:27:30 +00:00
|
|
|
|
|
|
|
DIALOG_LOAD_ERROR::DIALOG_LOAD_ERROR( wxWindow* parent )
|
|
|
|
:
|
2009-07-13 06:20:18 +00:00
|
|
|
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, _("Load Error!"),wxDefaultPosition, wxSize( 450,250 ) )
|
2009-07-12 18:27:30 +00:00
|
|
|
{
|
2009-07-13 06:20:18 +00:00
|
|
|
SetFocus();
|
|
|
|
ListClear();
|
2009-07-12 18:27:30 +00:00
|
|
|
}
|
|
|
|
|
2009-07-13 06:20:18 +00:00
|
|
|
void DIALOG_LOAD_ERROR::OnCloseButtonClick( wxCommandEvent& event )
|
2009-07-12 18:27:30 +00:00
|
|
|
{
|
2009-07-13 07:01:57 +00:00
|
|
|
EndModal(0);
|
2009-07-12 18:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_LOAD_ERROR::ListClear(void)
|
|
|
|
{
|
2009-07-13 06:20:18 +00:00
|
|
|
m_htmlWindow->SetPage(wxEmptyString);
|
2009-07-12 18:27:30 +00:00
|
|
|
}
|
|
|
|
|
2009-07-13 06:20:18 +00:00
|
|
|
/** Function ListSet
|
|
|
|
* Add a list of items.
|
2009-07-13 15:25:41 +00:00
|
|
|
* @param list = a string containing items. Items are separated by '\n'
|
2009-07-13 06:20:18 +00:00
|
|
|
*/
|
2009-07-13 07:01:57 +00:00
|
|
|
void DIALOG_LOAD_ERROR::ListSet(const wxString &list)
|
2009-07-12 18:27:30 +00:00
|
|
|
{
|
2009-07-13 06:20:18 +00:00
|
|
|
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
|
|
|
|
|
2009-07-13 07:01:57 +00:00
|
|
|
wxArrayString* strings_list = wxStringSplit( list, wxChar('\n') );
|
2009-07-13 06:20:18 +00:00
|
|
|
m_htmlWindow->AppendToPage(wxT("<ul>") );
|
|
|
|
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii ++ )
|
|
|
|
{
|
|
|
|
m_htmlWindow->AppendToPage(wxT("<li>") );
|
|
|
|
m_htmlWindow->AppendToPage( strings_list->Item(ii) );
|
|
|
|
m_htmlWindow->AppendToPage(wxT("</li>") );
|
|
|
|
}
|
|
|
|
m_htmlWindow->AppendToPage(wxT("</ul>") );
|
|
|
|
|
|
|
|
delete strings_list;
|
2009-07-12 18:27:30 +00:00
|
|
|
}
|
|
|
|
|
2009-07-13 06:20:18 +00:00
|
|
|
/** Function MessageSet
|
|
|
|
* Add a message (in bold) to message list.
|
2009-07-13 15:25:41 +00:00
|
|
|
* @param message = the message
|
2009-07-13 06:20:18 +00:00
|
|
|
*/
|
2009-07-13 07:01:57 +00:00
|
|
|
void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
|
2009-07-12 18:27:30 +00:00
|
|
|
{
|
2009-07-13 06:20:18 +00:00
|
|
|
wxString message_value;
|
2009-10-13 09:00:46 +00:00
|
|
|
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
|
2009-07-13 06:20:18 +00:00
|
|
|
m_htmlWindow->AppendToPage( message_value );
|
2009-07-12 18:27:30 +00:00
|
|
|
}
|
|
|
|
|