本文整理汇总了C++中SearchData::GetFindString方法的典型用法代码示例。如果您正苦于以下问题:C++ SearchData::GetFindString方法的具体用法?C++ SearchData::GetFindString怎么用?C++ SearchData::GetFindString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchData
的用法示例。
在下文中一共展示了SearchData::GetFindString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSearchStart
void FindResultsTab::OnSearchStart(wxCommandEvent& e)
{
m_searchInProgress = true;
SearchData* data = (SearchData*)e.GetClientData();
wxString label = data ? data->GetFindString() : wxT("");
if(e.GetInt() != 0 || m_sci == NULL) {
if(m_book) {
clWindowUpdateLocker locker(this);
MySTC* sci = new MySTC(m_book);
SetStyles(sci);
sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindResultsTab::OnStyleNeeded), NULL, this);
m_book->AddPage(sci, label, true);
#ifdef __WXMAC__
m_book->GetSizer()->Layout();
#endif
size_t where = m_book->GetPageCount() - 1;
// keep the search data used for this tab
wxWindow* tab = m_book->GetPage(where);
if(tab) {
tab->SetClientData(data);
}
m_matchInfo.push_back(MatchInfo());
m_sci = sci;
}
} else if(m_book) {
// using current tab, update the tab title and the search data
int where = m_book->GetPageIndex(m_sci);
if(where != wxNOT_FOUND) {
m_book->SetPageText(where, label);
// delete the old search data
wxWindow* tab = m_book->GetPage(where);
SearchData* oldData = (SearchData*)tab->GetClientData();
if(oldData) {
delete oldData;
}
// set the new search data
tab->SetClientData(data);
}
}
// This is needed in >=wxGTK-2.9, otherwise the 'Search' pane doesn't fully expand
SendSizeEvent(wxSEND_EVENT_POST);
m_recv = m_sci;
Clear();
if(data) {
m_searchData = *data;
wxString message;
message << _("====== Searching for: '") << data->GetFindString() << _("'; Match case: ")
<< (data->IsMatchCase() ? _("true") : _("false")) << _(" ; Match whole word: ")
<< (data->IsMatchWholeWord() ? _("true") : _("false")) << _(" ; Regular expression: ")
<< (data->IsRegularExpression() ? _("true") : _("false")) << wxT(" ======\n");
AppendText(message);
}
}
示例2: OnSearchStart
void FindResultsTab::OnSearchStart(wxCommandEvent& e)
{
m_searchInProgress = true;
Clear();
SetStyles(m_sci);
SearchData* data = (SearchData*)e.GetClientData();
if(data) {
m_searchData = *data;
m_searchTitle = data->GetFindString();
wxString message;
message << _("====== Searching for: '") << data->GetFindString() << _("'; Match case: ")
<< (data->IsMatchCase() ? _("true") : _("false")) << _(" ; Match whole word: ")
<< (data->IsMatchWholeWord() ? _("true") : _("false")) << _(" ; Regular expression: ")
<< (data->IsRegularExpression() ? _("true") : _("false")) << wxT(" ======\n");
AppendText(message);
}
wxDELETE(data);
}
示例3: ProcessRequest
void SearchThread::ProcessRequest(ThreadRequest* req)
{
wxStopWatch sw;
m_summary = SearchSummary();
DoSearchFiles(req);
m_summary.SetElapsedTime(sw.Time());
SearchData* sd = (SearchData*)req;
m_summary.SetFindWhat(sd->GetFindString());
m_summary.SetReplaceWith(sd->GetReplaceWith());
// Send search end event
SendEvent(wxEVT_SEARCH_THREAD_SEARCHEND, sd->GetOwner());
}
示例4: DoSearchFiles
void SearchThread::DoSearchFiles(ThreadRequest *req)
{
SearchData *data = static_cast<SearchData*>(req);
// Get all files
if ( data->GetRootDirs().IsEmpty() )
return;
if ( data->GetFindString().IsEmpty() )
return;
StopSearch(false);
wxArrayString fileList;
GetFiles(data, fileList);
wxStopWatch sw;
// Send startup message to main thread
if ( m_notifiedWindow || data->GetOwner() ) {
wxCommandEvent event(wxEVT_SEARCH_THREAD_SEARCHSTARTED, GetId());
event.SetClientData(new SearchData(*data));
//set the rquested output tab
event.SetInt(data->UseNewTab() ? 1 : 0);
if (data->GetOwner()) {
::wxPostEvent(data->GetOwner(), event);
} else {
// since we are in if ( m_notifiedWindow || data->GetOwner() ) block...
::wxPostEvent(m_notifiedWindow, event);
}
}
for (size_t i=0; i<fileList.Count(); i++) {
m_summary.SetNumFileScanned((int)i+1);
// give user chance to cancel the search ...
if ( TestStopSearch() ) {
// Send cancel event
SendEvent(wxEVT_SEARCH_THREAD_SEARCHCANCELED, data->GetOwner());
StopSearch(false);
break;
}
DoSearchFile(fileList.Item(i), data);
}
}