1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "fctsys.h"
#include "dialog_load_error.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 ) )
{
SetFocus();
ListClear();
}
void DIALOG_LOAD_ERROR::OnCloseButtonClick( wxCommandEvent& event )
{
EndModal(0);
}
void DIALOG_LOAD_ERROR::ListClear(void)
{
m_htmlWindow->SetPage(wxEmptyString);
}
/**
* Function ListSet
* Add a list of items.
* @param aList = a string containing items. Items are separated by '\n'
*/
void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
{
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar('\n') );
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;
}
/**
* Function ListSet
* Add a list of items.
* @param aList = a wxArrayString containing items
*/
void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
{
m_htmlWindow->AppendToPage(wxT("<ul>") );
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
{
m_htmlWindow->AppendToPage(wxT("<li>") );
m_htmlWindow->AppendToPage( aList.Item(ii) );
m_htmlWindow->AppendToPage(wxT("</li>") );
}
m_htmlWindow->AppendToPage(wxT("</ul>") );
}
/**
* Function MessageSet
* Add a message (in bold) to message list.
* @param message = the message
*/
void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
{
wxString message_value;
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
m_htmlWindow->AppendToPage( message_value );
}