| 1 |
// -*- C++ -*- generated by wxGlade 0.3.5.1 on Wed Jun 29 12:57:38 2005 |
// -*- C++ -*- generated by wxGlade 0.3.5.1 on Wed Jun 29 12:57:38 2005 |
| 2 |
|
#include <wx/regex.h> |
| 3 |
#include "mnID.h" |
#include "mnID.h" |
| 4 |
#include "mnDef.h" |
#include "mnDef.h" |
| 5 |
#include "mnFrame.h" |
#include "mnFrame.h" |
| 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); |
| 20 |
wikiPlainTextCtrl = new wxTextCtrl(rightPanel, ID_PlainTextCtrl, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxHSCROLL|wxTE_AUTO_URL); |
wikiPlainTextCtrl = new wxTextCtrl(rightPanel, ID_PlainTextCtrl, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxHSCROLL|wxTE_AUTO_URL); |
| 21 |
wikiHtmlTextCtrl = new wxHtmlWindow(rightPanel, ID_HtmlTextCtrl, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE, wxT("")); |
wikiHtmlTextCtrl = new mnHtmlWindow(rightPanel, ID_HtmlTextCtrl); |
| 22 |
|
|
| 23 |
// begin add by hand |
// begin add by hand |
| 24 |
menuBar = new wxMenuBar(); |
menuBar = new wxMenuBar(); |
| 150 |
|
|
| 151 |
const wxString* fileName = ((WikiData*)(item))->getFileName(); |
const wxString* fileName = ((WikiData*)(item))->getFileName(); |
| 152 |
const wxString* wikiText = ((WikiData*)(item))->getText(); |
const wxString* wikiText = ((WikiData*)(item))->getText(); |
| 153 |
|
wxString htmlText(*wikiText); |
| 154 |
|
|
| 155 |
|
/* [[ ]] */ |
| 156 |
|
wxRegEx exp1(wxT("\\[\\[(..*)\\]\\]")); |
| 157 |
|
exp1.Replace(&htmlText, wxT("<a href=mnlink:\\1>\\1</a>")); |
| 158 |
|
|
| 159 |
|
/* http:// */ |
| 160 |
|
wxRegEx exp2(wxT("(http://..*)")); |
| 161 |
|
exp2.Replace(&htmlText, wxT("<a href=\\1>\\1</a>")); |
| 162 |
|
|
| 163 |
|
/* make HTML document */ |
| 164 |
wxString wikiHtml = wxT("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-JP\"><pre>") + |
wxString wikiHtml = wxT("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-JP\"><pre>") + |
| 165 |
*wikiText + |
htmlText+ |
| 166 |
wxT("</pre>"); |
wxT("</pre>"); |
| 167 |
|
|
| 168 |
wikiHtmlTextCtrl->SetPage(wikiHtml); |
wikiHtmlTextCtrl->SetPage(wikiHtml); |