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


C++ LEditor::ChangeCase方法代码示例

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


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

示例1: ProcessCommandEvent


//.........这里部分代码省略.........
        } else {
            // paste at caret position
            editor->Paste();
            
        }

    } else if (event.GetId() == wxID_UNDO) {
        if (editor->GetCommandsProcessor().CanUndo()) {
            editor->Undo();
            editor->GetCommandsProcessor().DecrementCurrentCommand();
        }

    } else if (event.GetId() == wxID_REDO) {
        if (editor->GetCommandsProcessor().CanRedo()) {
            editor->Redo();
            editor->GetCommandsProcessor().IncrementCurrentCommand();
        }

    } else if (event.GetId() == XRCID("label_current_state")) {
        wxString label = wxGetTextFromUser("What would you like to call the current state?", "Label current state", "", editor);
        if (!label.empty()) {
            editor->GetCommandsProcessor().SetUserLabel(label);
        }

    } else if (event.GetId() == wxID_SELECTALL) {
        editor->SelectAll();

    } else if (event.GetId() == wxID_DUPLICATE) {
        editor->SelectionDuplicate();
    } else if (event.GetId() == XRCID("delete_line_end")) {
        editor->DelLineRight();

    } else if (event.GetId() == XRCID("delete_line_start")) {
        editor->DelLineLeft();

    } else if (event.GetId() == XRCID("delete_line")) {
        editor->LineDelete();

    } else if (event.GetId() == XRCID("trim_trailing")) {
        editor->TrimText(true, false);

    } else if (event.GetId() == XRCID("to_lower")) {
        editor->ChangeCase(true);

    } else if (event.GetId() == XRCID("to_upper")) {
        editor->ChangeCase(false);

    } else if (event.GetId() == XRCID("transpose_lines")) {
        editor->LineTranspose();

    } else if (event.GetId() == wxID_DELETE) {
        editor->DeleteBack();

    } else if (event.GetId() == XRCID("move_line_down")) {

        int curline  = editor->GetCurrentLine();
        int lastline = editor->LineFromPosition(editor->GetLength()-1);

        if (editor->GetSelection().empty()
                ||  (editor->LineFromPos(editor->GetSelectionStart() == editor->LineFromPos(editor->GetSelectionEnd())))) {
            // No selection (or only a trivial 1-line one)
            if (curline != lastline) {
                editor->LineDown();              
                editor->LineTranspose();
            }

        } else {
            editor->MoveSelectedLinesDown();  // There is a selection, so we can move it direct
        }

    } else if (event.GetId() == XRCID("move_line_up")) {

        if (editor->GetSelection().empty()
                ||  (editor->LineFromPos(editor->GetSelectionStart() == editor->LineFromPos(editor->GetSelectionEnd())))) {
            // No selection (or only a trivial 1-line one)
            editor->LineTranspose();
            editor->LineUp();

        } else {
            editor->MoveSelectedLinesUp();  // There is a selection, so we can move it direct
        }

    } else if (event.GetId() == XRCID("center_line")) {
        //editor->VerticalCentreCaret();

    } else if (event.GetId() == XRCID("center_line_roll")) {
        int here    = editor->GetCurrentLine();
        int top     = editor->GetFirstVisibleLine();
        int count   = editor->LinesOnScreen();
        int center  = top + (count / 2);
        if (here < center) {
            for (int lnIterator = 0; lnIterator < center - here; lnIterator++)
                editor->LineScrollUp();   //roll up until we get to center
        } else if (here > center) {
            for (int lnIterator = 0; lnIterator < here - center; lnIterator++)
                editor->LineScrollDown(); //roll down until we get to center
        }

    }
}
开发者ID:fxj7158,项目名称:codelite,代码行数:101,代码来源:menu_event_handlers.cpp


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