本文整理汇总了C++中IEditor::AppendText方法的典型用法代码示例。如果您正苦于以下问题:C++ IEditor::AppendText方法的具体用法?C++ IEditor::AppendText怎么用?C++ IEditor::AppendText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEditor
的用法示例。
在下文中一共展示了IEditor::AppendText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
void TagsOptionsDlg::Parse()
{
// Prepate list of files to work on
wxArrayString files = wxStringTokenize(m_textCtrlFilesList->GetValue(), wxT(" \t"), wxTOKEN_STRTOK);
wxArrayString searchPaths = GetCTagsSearchPaths();
wxArrayString fullpathsArr;
for(size_t i = 0; i < files.size(); i++) {
wxString file = files[i].Trim().Trim(false);
if(file.IsEmpty()) continue;
for(size_t xx = 0; xx < searchPaths.size(); xx++) {
wxString fullpath;
fullpath << searchPaths.Item(xx) << wxFileName::GetPathSeparator() << file;
wxFileName fn(fullpath);
if(fn.FileExists()) {
fullpathsArr.Add(fn.GetFullPath());
break;
}
}
}
// Clear the PreProcessor table
PPTable::Instance()->Clear();
for(size_t i = 0; i < fullpathsArr.size(); i++)
PPScan(fullpathsArr.Item(i), true);
// Open an editor and print out the results
IEditor* editor = PluginManager::Get()->NewEditor();
if(editor) {
editor->AppendText(PPTable::Instance()->Export());
CopyData();
EndModal(wxID_OK);
}
}
示例2: Process
void SvnDiffHandler::Process(const wxString& output)
{
// Open the changes inside the editor only if we are not using an external
// diff viewer
if(GetPlugin()->GetSettings().GetFlags() & SvnUseExternalDiff)
return;
IEditor *editor = GetPlugin()->GetManager()->NewEditor();
if(editor) {
// Set the lexer name to 'Diff'
editor->SetLexerName(wxT("Diff"));
editor->AppendText(output);
}
}
示例3: SuppressErrors
void MemCheckOutputView::SuppressErrors(unsigned int mode, wxDataViewItem* dvItem)
{
if(m_mgr->OpenFile(m_choiceSuppFile->GetStringSelection())) {
IEditor* editor = m_mgr->GetActiveEditor();
if(editor) {
editor->GetCtrl()->DocumentEnd();
editor->GetCtrl()->Home();
int posStart = editor->GetCtrl()->GetCurrentPos();
editor->AppendText(wxString::Format("\n# Added %s", wxDateTime::Now().Format("%F %T")));
switch(mode) {
case SUPPRESS_CLICKED: {
MemCheckErrorReferrer* errorRef =
dynamic_cast<MemCheckErrorReferrer*>(m_dataViewCtrlErrorsModel->GetClientObject(*dvItem));
// TODO ? print error message?
if(!errorRef) break;
editor->AppendText(wxString::Format("\n%s", errorRef->Get().getSuppression()));
errorRef->Get().suppressed = true;
} break;
case SUPPRESS_CHECKED: {
wxVariant variant;
wxDataViewItemArray items;
m_dataViewCtrlErrorsModel->GetChildren(wxDataViewItem(0), items);
int supColumn = GetColumnByName(_("Suppress"));
if(supColumn == wxNOT_FOUND) {
return;
}
MemCheckErrorReferrer* errorRef;
for(wxDataViewItemArray::iterator it = items.begin(); it != items.end(); ++it) {
m_dataViewCtrlErrorsModel->GetValue(variant, *it, supColumn);
if(variant.GetBool()) {
errorRef =
dynamic_cast<MemCheckErrorReferrer*>(m_dataViewCtrlErrorsModel->GetClientObject(*it));
editor->AppendText(wxString::Format("\n%s", errorRef->Get().getSuppression()));
errorRef->Get().suppressed = true;
}
}
} break;
case SUPPRESS_ALL:
for(size_t item = 0; item < m_filterResults.size(); ++item) {
editor->AppendText(wxString::Format("\n%s", m_filterResults[item]->getSuppression()));
m_filterResults[item]->suppressed = true;
}
break;
case SUPPRESS_SELECTED:
long item = -1;
for(;;) {
item = m_listCtrlErrors->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if(item == -1) break;
editor->AppendText(wxString::Format("\n%s", m_filterResults[item]->getSuppression()));
m_filterResults[item]->suppressed = true;
}
break;
}
editor->AppendText(wxT("\n"));
editor->GetCtrl()->DocumentEnd();
int textLen = editor->GetCtrl()->GetCurrentPos() - posStart;
editor->SelectText(posStart, textLen);
wxCommandEvent saveEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("save_file"));
m_mgr->GetTheApp()->GetTopWindow()->GetEventHandler()->ProcessEvent(saveEvent);
// reload pages after suppression
if(m_plugin->GetSettings()->GetOmitSuppressed()) {
switch(mode) {
case SUPPRESS_CLICKED:
case SUPPRESS_CHECKED:
ResetItemsView();
ShowPageView(m_currentPage);
itemsInvalidSupp = true;
break;
case SUPPRESS_ALL:
case SUPPRESS_SELECTED:
ResetItemsSupp();
ApplyFilterSupp(FILTER_STRING);
itemsInvalidView = true;
break;
}
}
}
}
}