| 17 |
searchLaebl = new wxStaticText(panel, -1, wxT("Search"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); |
searchLaebl = new wxStaticText(panel, -1, wxT("Search"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); |
| 18 |
searchTextCtrl = new wxTextCtrl(this, ID_SearchTextCtrl, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); |
searchTextCtrl = new wxTextCtrl(this, ID_SearchTextCtrl, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); |
| 19 |
searchTree = new wxTreeCtrl(leftPanel, ID_SearchTree, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER|wxTR_EDIT_LABELS); |
searchTree = new wxTreeCtrl(leftPanel, ID_SearchTree, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER|wxTR_EDIT_LABELS); |
|
wikiPlainTextCtrl = new wxTextCtrl(rightPanel, ID_PlainTextCtrl, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxHSCROLL|wxTE_AUTO_URL); |
|
| 20 |
wikiHtmlTextCtrl = new mnHtmlWindow(rightPanel, ID_HtmlTextCtrl); |
wikiHtmlTextCtrl = new mnHtmlWindow(rightPanel, ID_HtmlTextCtrl); |
| 21 |
|
|
| 22 |
// begin add by hand |
// begin add by hand |
| 152 |
wxString htmlText(*wikiText); |
wxString htmlText(*wikiText); |
| 153 |
|
|
| 154 |
/* [[ ]] */ |
/* [[ ]] */ |
| 155 |
wxRegEx exp1(wxT("\\[\\[(..*)\\]\\]")); |
wxRegEx exp1(wxT("\\[\\[(.+)\\]\\]")); |
| 156 |
exp1.Replace(&htmlText, wxT("<a href=mnlink:\\1>\\1</a>")); |
exp1.Replace(&htmlText, wxT("<a href=mnlink:\\1>\\1</a>")); |
| 157 |
|
|
| 158 |
/* http:// */ |
/* http:// */ |
| 159 |
wxRegEx exp2(wxT("(http://..*)")); |
wxRegEx exp2(wxT("(http://[\\.|&|-|%|$|#|=|_|-|~|\\?|/|a-z|A-Z|0-9]+)")); |
| 160 |
exp2.Replace(&htmlText, wxT("<a href=\\1>\\1</a>")); |
exp2.Replace(&htmlText, wxT("<a href=\\1>\\1</a>")); |
| 161 |
|
|
| 162 |
|
/* file:// */ |
| 163 |
|
wxRegEx exp3(wxT("(file://[\\.|&|-|%|$|#|=|_|-|~|\\?|/|a-z|A-Z|0-9]+)")); |
| 164 |
|
exp3.Replace(&htmlText, wxT("<a href=\\1>\\1</a>")); |
| 165 |
|
|
| 166 |
|
/* *XXXX */ |
| 167 |
|
wxRegEx exp4(wxT("^\\*([^\\*]+)"), wxRE_NEWLINE|wxRE_DEFAULT); |
| 168 |
|
exp4.Replace(&htmlText, wxT("<h3>\\1</h3>")); |
| 169 |
|
|
| 170 |
|
/* **XXXX */ |
| 171 |
|
wxRegEx exp5(wxT("^\\*\\*([^\\*]+)"), wxRE_NEWLINE|wxRE_DEFAULT); |
| 172 |
|
exp5.Replace(&htmlText, wxT("<h4>\\1</h4>")); |
| 173 |
|
|
| 174 |
|
/* :''XXXX'': */ |
| 175 |
|
wxRegEx exp6(wxT("^:''(.+)'':(.+)"), wxRE_NEWLINE|wxRE_DEFAULT); |
| 176 |
|
exp6.Replace(&htmlText, wxT("<u><b>\\1:\\2</b></u>")); |
| 177 |
|
|
| 178 |
|
/* ---- */ |
| 179 |
|
wxRegEx exp7(wxT("^----.+"), wxRE_NEWLINE|wxRE_DEFAULT); |
| 180 |
|
exp7.Replace(&htmlText, wxT("<hr>")); |
| 181 |
|
|
| 182 |
/* make HTML document */ |
/* make HTML document */ |
| 183 |
wxString wikiHtml = wxT("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-JP\"><pre>") + |
wxString wikiHtml; |
| 184 |
htmlText+ |
wikiHtml.Append(wxT("<meta http-equiv=\"Content-Type\"content=\"text/html; charset=EUC-JP\"><pre>")); |
| 185 |
wxT("</pre>"); |
wikiHtml.Append(htmlText); |
| 186 |
|
wikiHtml.Append(wxT("</pre>")); |
| 187 |
|
|
| 188 |
|
|
| 189 |
wikiHtmlTextCtrl->SetPage(wikiHtml); |
wikiHtmlTextCtrl->SetPage(wikiHtml); |
| 190 |
} |
} |