Develop and Download Open Source Software

Browse CVS Repository

Diff of /malonnote/mnFrame.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6 by maloninc, Sun Jul 31 22:22:14 2005 UTC revision 1.7 by maloninc, Mon Aug 1 10:46:20 2005 UTC
# Line 1  Line 1 
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"
# Line 18  mnFrame::mnFrame(wxWindow* parent, int i Line 18  mnFrame::mnFrame(wxWindow* parent, int i
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();
# Line 150  void mnFrame::showSelectedItemText(wxTre Line 150  void mnFrame::showSelectedItemText(wxTre
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);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26