コード例 #1
0
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);
}