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


C++ LEditor类代码示例

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


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

示例1: DoSelectPage

bool MainBook::DoSelectPage(wxWindow* win)
{
    LEditor* editor = dynamic_cast<LEditor*>(win);
    if(editor) {
        editor->SetActive();
        m_quickFindBar->SetEditor(editor);

    } else {
        m_quickFindBar->ShowForPlugins();
    }

    // Remove context menu if needed
    DoHandleFrameMenu(editor);

    if(!editor) {
        clMainFrame::Get()->SetFrameTitle(NULL);
        clMainFrame::Get()->GetStatusBar()->SetLinePosColumn(wxEmptyString);
        UpdateNavBar(NULL);
        SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win);

    } else {
        // if(editor->GetContext()->GetName() == wxT("C++")) {
        //     if(clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) {
        //         clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")),
        //                                                  wxT("C++"));
        //     }
        // }
        wxCommandEvent event(wxEVT_ACTIVE_EDITOR_CHANGED);
        EventNotifier::Get()->AddPendingEvent(event);
    }

    return true;
}
开发者ID:fmestrone,项目名称:codelite,代码行数:33,代码来源:mainbook.cpp

示例2: IsShown

bool FindInFilesDialog::Show()
{
    bool res = IsShown() || wxFrame::Show();
    if(res) {

        // update the combobox
        m_findString->Clear();
        m_findString->Append(m_data.GetFindStringArr());
        DoSetFileMask();
        m_findString->SetValue(m_data.GetFindString());

        LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
        if(editor) {
            // if we have an open editor, and a selected text, make this text the search string
            wxString selText = editor->GetSelectedText();
            if(!selText.IsEmpty()) {
                m_findString->SetValue(selText);
            }
        }

        m_findString->SetSelection(-1, -1); // select all
        m_findString->SetFocus();
    }
    return res;
}
开发者ID:bugparty,项目名称:codelite,代码行数:25,代码来源:findinfilesdlg.cpp

示例3: ProcessUpdateUIEvent

void EditHandler::ProcessUpdateUIEvent(wxWindow *owner, wxUpdateUIEvent &event)
{
    LEditor *editor = dynamic_cast<LEditor*>(owner);

    if (event.GetId() == wxID_COPY || event.GetId() == XRCID("trim_trailing") || event.GetId() == XRCID("to_lower") || event.GetId() == XRCID("to_upper")) {
        event.Enable(editor);

    } else if (event.GetId() == wxID_CUT) {
        event.Enable(editor);

    } else if (event.GetId() == wxID_PASTE) {
#ifdef __WXGTK__
        event.Enable(editor);
#else
        event.Enable(editor && editor->CanPaste());
#endif
    } else if (event.GetId() == wxID_UNDO) {
        event.Enable(editor && editor->CanUndo());
    } else if (event.GetId() == wxID_REDO) {
        event.Enable(editor && editor->CanRedo());
    } else if (event.GetId() == wxID_SELECTALL) {
        event.Enable(editor && editor->GetLength() > 0);
    } else if (event.GetId() == wxID_DUPLICATE || event.GetId() == wxID_DELETE) {
        event.Enable(true);
    } else {
        event.Enable(false);
    }
    event.Skip(false);
}
开发者ID:fxj7158,项目名称:codelite,代码行数:29,代码来源:menu_event_handlers.cpp

示例4: if

void QuickFindBar::OnHighlightMatchesUI(wxUpdateUIEvent& event)
{
    if(ManagerST::Get()->IsShutdownInProgress()) {
        event.Enable(false);

    } else if(!m_sci) {
        event.Enable(false);

    } else if(m_findWhat->GetValue().IsEmpty()) {
        event.Enable(false);

    } else {
        LEditor* editor = dynamic_cast<LEditor*>(m_sci);
        if(!editor) {
            event.Enable(false);

        } else {
            // Check to see if there are any markers
            int nLine = editor->LineFromPosition(0);
            int nFoundLine = editor->MarkerNext(nLine, mmt_find_bookmark);

            event.Enable(true);
            event.Check(nFoundLine != wxNOT_FOUND);
        }
    }
}
开发者ID:GaganJotSingh,项目名称:codelite,代码行数:26,代码来源:quickfindbar.cpp

示例5: fileNameStr

LEditor* MainBook::NewEditor()
{
    static int fileCounter = 0;

    wxString fileNameStr(_("Untitled"));
    fileNameStr << ++fileCounter;
    wxFileName fileName(fileNameStr);

    // A Nice trick: hide the notebook, open the editor
    // and then show it
    bool hidden(false);
    if(m_book->GetPageCount() == 0) hidden = GetSizer()->Hide(m_book);

    LEditor* editor = new LEditor(m_book);
    editor->SetFileName(fileName);
    AddPage(editor, fileName.GetFullName(), fileName.GetFullPath(), wxNullBitmap, true);

#ifdef __WXMAC__
    m_book->GetSizer()->Layout();
#endif

    // SHow the notebook
    if(hidden) GetSizer()->Show(m_book);

    editor->SetActive();
    return editor;
}
开发者ID:fmestrone,项目名称:codelite,代码行数:27,代码来源:mainbook.cpp

示例6: GetTagAtCaret

TagEntryPtr PluginManager::GetTagAtCaret(bool scoped, bool impl)
{
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(!editor)
        return NULL;
    return editor->GetContext()->GetTagAtCaret(scoped, impl);
}
开发者ID:aliasot,项目名称:codelite,代码行数:7,代码来源:pluginmanager.cpp

示例7: DoSelectPage

bool MainBook::DoSelectPage(wxWindow* win)
{
    LEditor *editor = dynamic_cast<LEditor*>(win);
    if ( editor ) {
        editor->SetActive();
        m_quickFindBar->SetEditor( editor );
        
    } else {
        m_quickFindBar->ShowForPlugins();
    }

    // Remove context menu if needed
    DoHandleFrameMenu(editor);

    if (!editor) {
        clMainFrame::Get()->SetFrameTitle(NULL);
        clMainFrame::Get()->SetStatusMessage(wxEmptyString, 1); // clear line & column indicator
        UpdateNavBar(NULL);
        SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win);

    } else {
        if (editor->GetContext()->GetName() == wxT("C++")) {
            if (clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) {
                clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")), wxT("C++"));
            }
        }
        SendCmdEvent(wxEVT_ACTIVE_EDITOR_CHANGED, (IEditor*)editor);
    }

    return true;
}
开发者ID:qioixiy,项目名称:codelite,代码行数:31,代码来源:mainbook.cpp

示例8: ProcessEditEvent

void PluginManager::ProcessEditEvent(wxCommandEvent& e, IEditor* editor)
{
    LEditor* lEditor = dynamic_cast<LEditor*>(editor);
    if(lEditor) {
        lEditor->OnMenuCommand(e);
    }
}
开发者ID:kaustubhcs,项目名称:codelite,代码行数:7,代码来源:pluginmanager.cpp

示例9: FindAndSelect

void PluginManager::FindAndSelect(const wxString& pattern, const wxString& name, int pos)
{
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(editor) {
        editor->FindAndSelectV(pattern, name, pos, NavMgr::Get());
        editor->SetActive();
    }
}
开发者ID:kaustubhcs,项目名称:codelite,代码行数:8,代码来源:pluginmanager.cpp

示例10: OnOpenInEditor

void NewBuildTab::OnOpenInEditor(wxCommandEvent& e)
{
    wxString content = this->GetBuildContent();
    LEditor *editor = clMainFrame::Get()->GetMainBook()->NewEditor();
    if ( editor ) {
        editor->SetText(content);
    }
}
开发者ID:Hmaal,项目名称:codelite,代码行数:8,代码来源:new_build_tab.cpp

示例11: OnPaste

void BuildTabTopPanel::OnPaste(wxCommandEvent& event)
{
    wxString content = m_buildTab->GetBuildContent();
    LEditor *editor = clMainFrame::Get()->GetMainBook()->NewEditor();
    if ( editor ) {
        editor->SetText(content);
    }
}
开发者ID:05storm26,项目名称:codelite,代码行数:8,代码来源:BuildTabTopPanel.cpp

示例12: DoGetCurFileName

wxFileName NavBar::DoGetCurFileName() const
{
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(!editor) return wxFileName();

    const wxFileName& fn = editor->GetFileName();
    return fn;
}
开发者ID:05storm26,项目名称:codelite,代码行数:8,代码来源:navbar.cpp

示例13: ProcessCommandEvent

void WordWrapHandler::ProcessCommandEvent(wxWindow *owner, wxCommandEvent &event)
{
    LEditor *editor = dynamic_cast<LEditor*>(owner);
    if ( !editor ) {
        return;
    }

    editor->SetWrapMode(event.IsChecked() ? wxSTC_WRAP_WORD : wxSTC_WRAP_NONE);
}
开发者ID:fxj7158,项目名称:codelite,代码行数:9,代码来源:menu_event_handlers.cpp

示例14: OnShowFile

void WorkspaceTab::OnShowFile(wxCommandEvent& e)
{
    LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    if(editor && !editor->GetProject().IsEmpty()) {
        m_fileView->ExpandToPath(editor->GetProject(), editor->GetFileName());
        ManagerST::Get()->ShowWorkspacePane(m_caption);
    }
    e.Skip();
}
开发者ID:05storm26,项目名称:codelite,代码行数:9,代码来源:workspacetab.cpp

示例15: CHECK_CLANG_ENABLED

void ClangDriver::DoGotoDefinition(ClangThreadReply* reply)
{
    CHECK_CLANG_ENABLED();
    LEditor* editor = clMainFrame::Get()->GetMainBook()->OpenFile(reply->filename, wxEmptyString, reply->line);
    if(editor) {
        int pos = editor->PositionFromLine(reply->line - 1);
        editor->FindAndSelectV(reply->filterWord, reply->filterWord, pos, NULL);
    }
}
开发者ID:Slasher006,项目名称:codelite,代码行数:9,代码来源:clang_driver.cpp


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