1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include "EditorOptionsGeneralGuidesPanel.h"
#include "cl_config.h"
#include "editor_config.h"
EditorOptionsGeneralGuidesPanel::EditorOptionsGeneralGuidesPanel(wxWindow* parent, OptionsConfigPtr options)
: OptionsConfigPage(parent, options)
{
AddHeader("Line numbers");
AddProperty("Display line numbers", m_options->GetDisplayLineNumbers(), UPDATE_BOOL_CB(SetDisplayLineNumbers));
AddProperty("Highlight current line number", m_options->IsLineNumberHighlightCurrent(),
UPDATE_BOOL_CB(SetLineNumberHighlightCurrent));
AddProperty("Use relative line numbers", m_options->GetRelativeLineNumbers(),
UPDATE_BOOL_CB(SetRelativeLineNumbers));
AddHeader("What to highlight?");
AddProperty("Indentation lines", m_options->GetShowIndentationGuidelines(),
UPDATE_BOOL_CB(SetShowIndentationGuidelines));
AddProperty("Matching braces", m_options->GetHighlightMatchedBraces(), UPDATE_BOOL_CB(SetHighlightMatchedBraces));
AddProperty("Modified lines", m_options->IsTrackChanges(), UPDATE_BOOL_CB(SetTrackChanges));
AddHeader("Caret line");
AddProperty("Enable background colour", m_options->GetHighlightCaretLine(), UPDATE_BOOL_CB(SetHighlightCaretLine));
AddProperty("Background colour", m_options->GetCaretLineColour(), UPDATE_COLOUR_CB(SetCaretLineColour));
AddHeader(_("Right margin indicator"));
AddProperty(_("Show right margin indicator"), m_options->IsShowRightMarginIndicator(),
UPDATE_BOOL_CB(SetShowRightMarginIndicator));
AddProperty(_("Indicator column"), m_options->GetRightMarginColumn(), UPDATE_INT_CB(SetRightMarginColumn));
AddHeader("Debugger line");
AddProperty("Enable background colour", m_options->HasOption(OptionsConfig::Opt_Mark_Debugger_Line),
UPDATE_OPTION_CB(Opt_Mark_Debugger_Line));
AddProperty("Background colour", m_options->GetDebuggerMarkerLine(), UPDATE_COLOUR_CB(SetDebuggerMarkerLine));
AddHeader("Whitespace");
{
wxArrayString options;
options.Add("Invisible");
options.Add("Visible always");
options.Add("Visible after indentation");
AddProperty("Indentation visibility", options, m_options->GetShowWhitspaces(),
[this, options](const wxString& label, const wxAny& value) {
wxString value_str;
if(value.GetAs(&value_str)) {
size_t where = options.Index(value_str);
if(where != wxString::npos) {
m_options->SetShowWhitspaces(static_cast<int>(where));
}
}
});
}
{
wxArrayString options;
options.Add("Default");
options.Add("Mac (CR)");
options.Add("Unix (LF)");
AddProperty("EOL Style", options, m_options->GetEolMode(), UPDATE_TEXT_CB(SetEolMode));
}
long line_spacing = clConfig::Get().Read("extra_line_spacing", (int)0);
AddProperty("Line spacing", line_spacing, [&](const wxString& label, const wxAny& value) {
wxUnusedVar(label);
long spacing;
if(value.GetAs(&spacing)) {
clConfig::Get().Write("extra_line_spacing", static_cast<int>(spacing));
}
});
}
EditorOptionsGeneralGuidesPanel::~EditorOptionsGeneralGuidesPanel() {}
|