Exemple #1
0
void PluginManager::FindAndSelect(const wxString& pattern, const wxString& name, int pos)
{
    LEditor *editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if (editor) {
        editor->FindAndSelect(pattern, name, pos, NavMgr::Get());
        editor->SetActive();
    }
}
bool CodeCompletionManager::DoCtagsGotoDecl(LEditor* editor)
{
    TagEntryPtr tag = editor->GetContext()->GetTagAtCaret(true, false);
    if (tag) {
        LEditor *editor = clMainFrame::Get()->GetMainBook()->OpenFile(tag->GetFile(), wxEmptyString, tag->GetLine()-1);
        if(!editor) {
            return false;
        }
        editor->FindAndSelect(tag->GetPattern(), tag->GetName());
        return true;
    }
    return false;
}
Exemple #3
0
void NavBar::OnFunction(wxCommandEvent& e)
{
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(!editor) return;

    size_t sel = e.GetSelection();
    if(sel >= m_tags.size()) return;

    wxString pattern = m_tags[sel]->GetPattern();
    wxString name = m_tags[sel]->GetName();
    editor->FindAndSelect(pattern, name);
    editor->SetActive();
}