#endif
MyFrame() : wxFrame( NULL, -1, _("regextest - wxRegEx Testing App"),
- wxPoint(20,20), wxSize(300,400), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL )
+ wxPoint(20,20), wxSize(300,450), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL )
{
//Set the background to something light gray-ish
SetBackgroundColour(wxColour(150,150,150));
// Button
OkButton.Create(this, OkButtonID, _("OK"), wxPoint(20, 120));
- NumIters.Create(this, -1, _("15000"), wxPoint(100, 120));
+ NumIters.Create(this, -1, _("5000"), wxPoint(100, 120));
+
+ #if wxUSE_STATUSBAR && !defined(__WXWINCE__)
+ // create a status bar just for fun (by default with 1 pane only)
+ CreateStatusBar(1);
+ SetStatusText(_("Enter Some Values and Press the OK Button or Enter"));
+ #endif // wxUSE_STATUSBAR
}
void OnAbout(wxCommandEvent& WXUNUSED(evt))
#ifdef wxUSE_WXREGEX
- wxRegEx Regex;
+ SetStatusText("Testing wxRegEx...");
+
+ wxRegEx Regex;
//Regular Expressions must be compiled before
//you can search a string with them, or
//at least most implementations do.
{
for(i = 0; i < n; ++i)
{
+ SetStatusText(wxString::Format(_("wxRegEx Compile #%i"), i));
Regex.Compile(szPattern, nCompileFlags);
}
}
{
for(i = 0; i < n; ++i)
{
+ SetStatusText(wxString::Format(_("wxRegEx Match #%i"), i));
Regex.Matches(szSearch, nMatchFlags);
}
}
#endif //wxUSE_WXREGEX
#ifdef wxUSE_RNWXRE
+ SetStatusText("Testing RNWXRE...");
+
wxRe Re;
wxRe::wxReError e;
if ((e = Re.Comp(szPattern, nCompileFlags2)) != wxRe::wxRE_OK)
{
for(i = 0; i < n; ++i)
{
+ SetStatusText(wxString::Format(_("RNWXRE Compile #%i"), i));
Re.Comp(szPattern, nCompileFlags2);
}
}
{
for(i = 0; i < n; ++i)
{
+ SetStatusText(wxString::Format(_("RNWXRE Match #%i"), i));
Re.Exec(szSearch, nMatchFlags2);
}
}
#endif //wxUSE_RNWXRE
#ifdef wxUSE_GRETA
+ SetStatusText("Testing GRETA...");
+
std::string stdszPattern(szPattern);
rpattern Greta (stdszPattern,EXTENDED,MODE_MIXED);
match_results r;
//so one can only surmize that it performs
//some kind of optimizations in the constructor
Greta = rpattern(stdszPattern,EXTENDED,MODE_MIXED);
+ SetStatusText(wxString::Format(_("GRETA Compile #%i"), i));
}
}
if (OptionsMenu->IsChecked(MatchID))
for(i = 0; i < n; ++i)
{
Greta.match(stdszSearch, r);
+ SetStatusText(wxString::Format(_("GRETA Match #%i"), i));
}
}
#endif //wxUSE_GRETA
#ifdef wxUSE_PCRE
+ SetStatusText("Testing PCRE...");
+
pcre* pPcre;
const wxChar* szError;
int nErrOff;
for(i = 0; i < n; ++i)
{
pPcre = pcre_compile(szPattern, nCompileFlags4, &szError, &nErrOff, 0);
+ SetStatusText(wxString::Format(_("PCRE Compile #%i"), i));
}
}
if (OptionsMenu->IsChecked(MatchID))
for(i = 0; i < n; ++i)
{
pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize);
+ SetStatusText(wxString::Format(_("PCRE Match #%i"), i));
}
}
);
#endif //wxUSE_PCRE
+ SetStatusText("Regex Run Complete");
+
ResultText.SetLabel(szResult + _("\n\n") + szResult2);
ResultText2.SetLabel(szResult3 + _("\n\n") + szResult4);
}