当前位置: 首页>>代码示例>>C++>>正文


C++ IEditor类代码示例

本文整理汇总了C++中IEditor的典型用法代码示例。如果您正苦于以下问题:C++ IEditor类的具体用法?C++ IEditor怎么用?C++ IEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnEditorClosed

void SFTP::OnEditorClosed(wxCommandEvent& e)
{
    e.Skip();
    IEditor* editor = (IEditor*)e.GetClientData();
    if(editor) {
        wxString localFile = editor->GetFileName().GetFullPath();
        if(m_remoteFiles.count(localFile)) {

            wxLogNull noLog;

            // Remove the file from our cache
            ::wxRemoveFile(localFile);
            m_remoteFiles.erase(localFile);
        }
    }
}
开发者ID:Jactry,项目名称:codelite,代码行数:16,代码来源:sftp.cpp

示例2: DestroyTooltip

void LLDBPlugin::DestroyTooltip()
{
    if(m_tooltip) {
        m_tooltip->Destroy();
        m_tooltip = NULL;

        // Raise codelite back
        EventNotifier::Get()->TopFrame()->Raise();

        // If we destroyed the tooltip, set the focus back to the active editor
        IEditor* editor = m_mgr->GetActiveEditor();
        if(editor) {
            editor->SetActive();
        }
    }
}
开发者ID:raresp,项目名称:codelite,代码行数:16,代码来源:LLDBPlugin.cpp

示例3: activateEvent

void OpenResourceDialog::OpenSelection(const OpenResourceDialogItemData& selection, IManager* manager)
{
    // send event to the plugins to see if they want
    // to open this file
    wxString file_path = selection.m_file;
    clCommandEvent activateEvent(wxEVT_TREE_ITEM_FILE_ACTIVATED);
    activateEvent.SetFileName(file_path);
    if(EventNotifier::Get()->ProcessEvent(activateEvent)) return;

    if(manager && manager->OpenFile(selection.m_file, wxEmptyString, selection.m_line - 1)) {
        IEditor* editor = manager->GetActiveEditor();
        if(editor && !selection.m_name.IsEmpty() && !selection.m_pattern.IsEmpty()) {
            editor->FindAndSelectV(selection.m_pattern, selection.m_name);
        }
    }
}
开发者ID:stahta01,项目名称:codelite,代码行数:16,代码来源:open_resource_dialog.cpp

示例4: OnFilesTagged

void OutlineTab::OnFilesTagged(wxCommandEvent& e)
{
    e.Skip();
    IEditor* editor = m_mgr->GetActiveEditor();
    if( editor ) {
        m_tree->BuildTree( editor->GetFileName() );
        
        if(editor->GetSTC()) {
            // make sure we dont steal the focus from the editor...
            editor->GetSTC()->SetFocus();
        }
        
    } else {
        m_tree->Clear();
    }
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:16,代码来源:outline_tab.cpp

示例5: reInclude

bool PHPEditorContextMenu::IsIncludeOrRequireStatement(wxString& includeWhat)
{
    // Do a basic check to see whether this line is include statement or not.
    // Don't bother in full parsing the file since it can be a quite an expensive operation
    // (include|require_once|require|include_once)[ \t\\(]*(.*?)[\\) \t)]*;
    static wxRegEx reInclude(wxT("(include|require_once|require|include_once)[ \t\\(]*(.*?)[\\) \t]*;"), wxRE_ADVANCED);

    IEditor* editor = m_manager->GetActiveEditor();
    if(!editor) return false;

    wxString line = editor->GetCtrl()->GetLine(editor->GetCurrentLine());
    if(reInclude.IsValid() && reInclude.Matches(line)) {
        includeWhat = reInclude.GetMatch(line, 2);
        return true;
    }
    return false;
}
开发者ID:MaartenBent,项目名称:codelite,代码行数:17,代码来源:php_editor_context_menu.cpp

示例6: time

void WebTools::OnTimer(wxTimerEvent& event)
{
    event.Skip();

    time_t curtime = time(NULL);
    if((curtime - m_lastColourUpdate) < 5) return;
    IEditor* editor = m_mgr->GetActiveEditor();

    // Sanity
    CHECK_PTR_RET(editor);
    CHECK_PTR_RET(editor->IsModified());
    if(!IsJavaScriptFile(editor->GetFileName())) return;

    // This file is a modified JS file
    m_lastColourUpdate = time(NULL);
    m_jsColourThread->QueueBuffer(editor->GetFileName().GetFullPath(), editor->GetTextRange(0, editor->GetLength()));
}
开发者ID:capturePointer,项目名称:codelite,代码行数:17,代码来源:webtools.cpp

示例7: clGetManager

void ZoomText::OnIdle(wxIdleEvent& event)
{
    event.Skip();
    // sanity
    if(!m_classes.IsEmpty() || IsEmpty()) return;
    
    IEditor* editor = clGetManager()->GetActiveEditor();
    if(!editor) return;

    if(m_classes.IsEmpty() && !editor->GetKeywordClasses().IsEmpty() &&
       (editor->GetFileName().GetFullPath() == m_filename)) {
        // Sync between the keywords
        SetKeyWords(1, editor->GetKeywordClasses()); // classes
        SetKeyWords(3, editor->GetKeywordLocals());  // locals
        Colourise(0, GetLength());
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:17,代码来源:zoomtext.cpp

示例8: fn

void LanguageServerCluster::OnSymbolFound(LSPEvent& event)
{
    const LSP::Location& location = event.GetLocation();
    wxFileName fn(location.GetUri());
    clDEBUG() << "LSP: Opening file:" << fn << "(" << location.GetRange().GetStart().GetLine() << ":"
              << location.GetRange().GetStart().GetCharacter() << ")";

    // Manage the browser (BACK and FORWARD) ourself
    BrowseRecord from;
    IEditor* oldEditor = clGetManager()->GetActiveEditor();
    if(oldEditor) { from = oldEditor->CreateBrowseRecord(); }
    IEditor* editor = clGetManager()->OpenFile(fn.GetFullPath(), "", wxNOT_FOUND, OF_None);
    if(editor) {
        editor->SelectRange(location.GetRange());
        if(oldEditor) { NavMgr::Get()->AddJump(from, editor->CreateBrowseRecord()); }
    }
}
开发者ID:eranif,项目名称:codelite,代码行数:17,代码来源:LanguageServerCluster.cpp

示例9: CHECK_PTR_RET

void PHPOutlineTree::ItemSelected(const wxTreeItemId& item, bool focusEditor)
{
    QItemData* itemData = dynamic_cast<QItemData*>(GetItemData(item));
    CHECK_PTR_RET(itemData);

    IEditor* editor = m_manager->GetActiveEditor();
    CHECK_PTR_RET(editor);

    // Define the pattern to search

    editor->FindAndSelect(itemData->m_entry->GetShortName(), itemData->m_entry->GetShortName(),
                          editor->PosFromLine(itemData->m_entry->GetLine()), NavMgr::Get());
    // set the focus to the editor
    if(focusEditor) {
        CallAfter(&PHPOutlineTree::SetEditorActive, editor);
    }
}
开发者ID:lpc1996,项目名称:codelite,代码行数:17,代码来源:PHPOutlineTree.cpp

示例10: DoDeleteBreakpoint

void XDebugManager::OnDeleteBreakpoint(PHPEvent& e)
{
    e.Skip();
    wxString filename = e.GetFileName();
    int line = e.GetLineNumber();
    int bpid = e.GetInt();
    
    if ( bpid != wxNOT_FOUND ) {
        // breakpoint was applied
        DoDeleteBreakpoint(bpid);
    }
    IEditor * editor = m_plugin->GetManager()->FindEditor( filename );
    if ( editor ) {
        editor->GetSTC()->MarkerDelete(line-1, smt_breakpoint);
    }
    m_breakpointsMgr.DeleteBreakpoint(filename, line);
}
开发者ID:gahr,项目名称:codelite,代码行数:17,代码来源:XDebugManager.cpp

示例11: OnFindSymbol

void PHPCodeCompletion::OnFindSymbol(clCodeCompletionEvent& e)
{
    if(PHPWorkspace::Get()->IsOpen()) {
        if(!CanCodeComplete(e)) return;

        IEditor* editor = dynamic_cast<IEditor*>(e.GetEditor());
        if(editor) {
            PHPEntityBase::Ptr_t resolved = GetPHPEntryUnderTheAtPos(editor, editor->GetCurrentPosition());
            if(resolved) {
                m_manager->OpenFile(resolved->GetFilename().GetFullPath(), "", resolved->GetLine());
            }
        }

    } else {
        e.Skip();
    }
}
开发者ID:bugparty,项目名称:codelite,代码行数:17,代码来源:php_code_completion.cpp

示例12: clLogMessage

void CppCheckPlugin::OnCheckFileEditorItem(wxCommandEvent& e)
{
    if(m_cppcheckProcess) {
        clLogMessage(_("CppCheckPlugin: CppCheck is currently busy please wait for it to complete the current check"));
        return;
    }

    ProjectPtr proj;
    IEditor* editor = m_mgr->GetActiveEditor();
    if(editor) {
        wxString projectName = editor->GetProjectName();
        if(!projectName.IsEmpty()) { proj = clCxxWorkspaceST::Get()->GetProject(projectName); }
        m_filelist.Add(editor->GetFileName().GetFullPath());
    }

    DoStartTest();
}
开发者ID:eranif,项目名称:codelite,代码行数:17,代码来源:cppchecker.cpp

示例13: entryInfo

QList<FilterEntry> FileSystemFilter::matchesFor(const QString &entry)
{
    QList<FilterEntry> value;
    QFileInfo entryInfo(entry);
    QString name = entryInfo.fileName();
    QString directory = entryInfo.path();
    QString filePath = entryInfo.filePath();
    if (entryInfo.isRelative()) {
        if (filePath.startsWith("~/")) {
            directory.replace(0, 1, QDir::homePath());
        } else {
            IEditor *editor = m_editorManager->currentEditor();
            if (editor && !editor->file()->fileName().isEmpty()) {
                QFileInfo info(editor->file()->fileName());
                directory.prepend(info.absolutePath()+"/");
            }
        }
    }
    QDir dirInfo(directory);
    QDir::Filters dirFilter = QDir::Dirs|QDir::Drives;
    QDir::Filters fileFilter = QDir::Files;
    if (m_includeHidden) {
        dirFilter |= QDir::Hidden;
        fileFilter |= QDir::Hidden;
    }
    QStringList dirs = dirInfo.entryList(dirFilter,
                                      QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
    QStringList files = dirInfo.entryList(fileFilter,
                                      QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
    foreach (const QString &dir, dirs) {
        if (dir != "." && (name.isEmpty() || dir.startsWith(name, Qt::CaseInsensitive))) {
            FilterEntry entry(this, dir, dirInfo.filePath(dir));
            entry.resolveFileIcon = true;
            value.append(entry);
        }
    }
    foreach (const QString &file, files) {
        if (name.isEmpty() || file.startsWith(name, Qt::CaseInsensitive)) {
            const QString fullPath = dirInfo.filePath(file);
            FilterEntry entry(this, file, fullPath);
            entry.resolveFileIcon = true;
            value.append(entry);
        }
    }
    return value;
}
开发者ID:asokolov,项目名称:ananas-creator,代码行数:46,代码来源:filesystemfilter.cpp

示例14: fn

void CscopeTab::DoItemActivated(const wxDataViewItem& item )
{
    CscopeTabClientData *data = dynamic_cast<CscopeTabClientData*>(m_dataviewModel->GetClientObject(item));
    if (data) {
        wxString wsp_path = clCxxWorkspaceST::Get()->GetPrivateFolder();
        //a single entry was activated, open the file
        //convert the file path to absolut path. We do it here, to improve performance
        wxFileName fn(data->GetEntry().GetFile());

        if ( !fn.MakeAbsolute(wsp_path) ) {
            wxLogMessage(wxT("failed to convert file to absolute path"));
        }

        if(m_mgr->OpenFile(fn.GetFullPath(), wxEmptyString, data->GetEntry().GetLine()-1)) {
            IEditor *editor = m_mgr->GetActiveEditor();
            if( editor && editor->GetFileName().GetFullPath() == fn.GetFullPath() && !GetFindWhat().IsEmpty()) {
                // We can't use data->GetEntry().GetPattern() as the line to search for as any appended comments have been truncated
                // For some reason LEditor::DoFindAndSelect checks it against the whole current line
                // and won't believe a match unless their lengths are the same
                int line = data->GetEntry().GetLine() - 1;
                int start = editor->PosFromLine(line);	// PosFromLine() returns the line start position
                int end = editor->LineEnd(line);
                wxString searchline(editor->GetTextRange(start, end));
                // Find and select the entry in the file
                editor->FindAndSelectV(searchline, GetFindWhat(), start); // The async version of FindAndSelect()
                editor->DelayedSetActive(); // We need to SetActive() editor. At least in wxGTK, this won't work synchronously
            }
        }
    } else {
        // Parent item, expand it
        m_dataview->Expand( item );
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:33,代码来源:cscopetab.cpp

示例15: OnPreviewClicked

void ZoomNavigator::OnPreviewClicked(wxMouseEvent& e)
{
    IEditor* curEditor = m_mgr->GetActiveEditor();

    // user clicked on the preview
    CHECK_CONDITION(m_startupCompleted);
    CHECK_CONDITION(curEditor);
    CHECK_CONDITION(m_enabled);

    // the first line is taken from the preview
    int pos = m_text->PositionFromPoint(e.GetPosition());
    if(pos == wxSTC_INVALID_POSITION) {
        return;
    }
    int first = m_text->LineFromPosition(pos);
    int nLinesOnScreen = curEditor->GetCtrl()->LinesOnScreen();
    first -= (nLinesOnScreen / 2);
    if(first < 0) first = 0;

    // however, the last line is set according to the actual editor
    int last = nLinesOnScreen + first;

    PatchUpHighlights(first, last);
    curEditor->GetCtrl()->SetFirstVisibleLine(first);
    curEditor->SetCaretAt(curEditor->PosFromLine(first + (nLinesOnScreen / 2)));

    // reset the from/last members to avoid unwanted movements in the 'OnTimer' function
    m_markerFirstLine = curEditor->GetCtrl()->GetFirstVisibleLine();
    m_markerLastLine = m_markerFirstLine + curEditor->GetCtrl()->LinesOnScreen();
}
开发者ID:huan5765,项目名称:codelite-translate2chinese,代码行数:30,代码来源:zoomnavigator.cpp


注:本文中的IEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。