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


C++ OptionsConfigPtr::HasOption方法代码示例

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


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

示例1: EditorSettingsTerminalBase

EditorSettingsTerminal::EditorSettingsTerminal( wxWindow* parent )
    : EditorSettingsTerminalBase( parent )
    , TreeBookNode<EditorSettingsTerminal>()

{
    OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
    m_textCtrlProgramConsoleCmd->SetValue(options->GetProgramConsoleCommand());
    m_checkBoxUseCodeLiteTerminal->SetValue( options->HasOption( OptionsConfig::Opt_Use_CodeLite_Terminal) );
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:9,代码来源:editorsettingsterminal.cpp

示例2: EditorOptionsGeneralGuidesPanelBase

EditorOptionsGeneralGuidesPanel::EditorOptionsGeneralGuidesPanel(wxWindow* parent)
    : EditorOptionsGeneralGuidesPanelBase(parent)
    , TreeBookNode<EditorOptionsGeneralGuidesPanel>()
{
    OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();

    m_displayLineNumbers->SetValue(options->GetDisplayLineNumbers());
    m_checkBoxMatchBraces->SetValue(options->GetHighlightMatchedBraces());
    m_showIndentationGuideLines->SetValue(options->GetShowIndentationGuidelines());
    m_highlightCaretLine->SetValue(options->GetHighlightCaretLine());
    m_caretLineColourPicker->SetColour(options->GetCaretLineColour());
    const wxString EOLChoices[] = { wxTRANSLATE("Default"), wxT("Mac (CR)"), wxT("Windows (CRLF)"), wxT("Unix (LF)") };
    m_EOLstringManager.AddStrings(
        sizeof(EOLChoices) / sizeof(wxString), EOLChoices, options->GetEolMode(), m_choiceEOL);
    m_checkBoxHideChangeMarkerMargin->SetValue(options->GetHideChangeMarkerMargin());
    m_checkBoxDisableSemicolonShift->SetValue(options->GetDisableSemicolonShift());

    m_checkBoxMarkdebuggerLine->SetValue(options->HasOption(OptionsConfig::Opt_Mark_Debugger_Line));
    m_colourPickerDbgLine->SetColour(options->GetDebuggerMarkerLine());

    const wxString WhitespaceStyle[] = { wxTRANSLATE("Invisible"),
                                         wxTRANSLATE("Visible always"),
                                         wxTRANSLATE("Visible after indentation") };
    wxString currentWhitespace;
    switch(options->GetShowWhitspaces()) {
    case wxSTC_WS_VISIBLEALWAYS:
        currentWhitespace = wxT("Visible always");
        break;
    case wxSTC_WS_VISIBLEAFTERINDENT:
        currentWhitespace = wxT("Visible after indentation");
        break;
    default:
        currentWhitespace = wxT("Invisible");
        break;
    }
    m_WSstringManager.AddStrings(
        sizeof(WhitespaceStyle) / sizeof(wxString), WhitespaceStyle, currentWhitespace, m_whitespaceStyle);
}
开发者ID:LoviPanda,项目名称:codelite,代码行数:38,代码来源:editor_options_general_guides_panel.cpp

示例3: ProcessCommandEvent

//------------------------------------
// Handle copy events
//------------------------------------
void EditHandler::ProcessCommandEvent(wxWindow *owner, wxCommandEvent &event)
{
    wxUnusedVar(event);
    LEditor *editor = (LEditor*)owner;
    
    OptionsConfigPtr options = editor->GetOptions();
    // hide completion box
    editor->HideCompletionBox();
    bool isSelectionEmpty = editor->GetSelectedText().IsEmpty();
    
    if (event.GetId() == wxID_COPY) {
        
        // reset the 'full line' copy/cut flag
        editor->SetFullLineCopyCut(false);
        
        if ( isSelectionEmpty && options->HasOption( OptionsConfig::Opt_CopyNothing) ) {
            // do nothing
            
        } else if ( isSelectionEmpty && options->HasOption( OptionsConfig::Opt_CopyLineIfLineNotEmpty ) ) {
            // Copy the line content only when the caret line is not empty
            int lineNumber = editor->GetCurrentLine();
            wxString lineContent = editor->GetLine(lineNumber);
            if ( !lineContent.Trim().Trim(false).IsEmpty() ) {
                editor->CopyAllowLine();
                editor->SetFullLineCopyCut(true);
            }
        } else if ( isSelectionEmpty ) {
            // default behavior
            editor->CopyAllowLine();
            editor->SetFullLineCopyCut(true);

        } else {
            editor->Copy();
        }

    } else if (event.GetId() == wxID_CUT) {
        
        // reset the 'full line' copy/cut flag
        editor->SetFullLineCopyCut(false);
        
        if ( isSelectionEmpty && options->HasOption( OptionsConfig::Opt_CopyNothing) ) {
            // do nothing
            
        } else if ( isSelectionEmpty && options->HasOption( OptionsConfig::Opt_CopyLineIfLineNotEmpty ) ) {
            // Copy the line content only when the caret line is not empty
            int lineNumber = editor->GetCurrentLine();
            wxString lineContent = editor->GetLine(lineNumber);
            if ( !lineContent.Trim().Trim(false).IsEmpty() ) {
                editor->CopyAllowLine();
                editor->LineDelete();
                editor->SetFullLineCopyCut(true);
            }
        } else if ( isSelectionEmpty ) {
            
            // default behavior
            editor->CopyAllowLine();
            editor->LineDelete();
            editor->SetFullLineCopyCut(true);
        
        } else {
            editor->Cut();
        }

    } else if (event.GetId() == wxID_PASTE) {
        if ( editor->IsFullLineCopyCut() ) {
            // paste one line above the caret
            editor->PasteLineAbove();
            
        } 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();
//.........这里部分代码省略.........
开发者ID:fxj7158,项目名称:codelite,代码行数:101,代码来源:menu_event_handlers.cpp


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