Patch #995 2006-04-12 19:59

sethjackson

First part of [ Feature Request #1962 ]
Download
995-First_part_of_F.patch (10.5 KB)
Category
Application::FeatureAdd
Status
Rejected
Close date
2006-05-09 10:25
Assigned to
 
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp    (revision 2339)
+++ src/sdk/cbeditor.cpp    (working copy)
@@ -553,6 +553,15 @@
     m_pControl->SetCaretLineVisible(mgr->ReadBool(_T("/highlight_caret_line"), false));
     m_pControl->SetCaretLineBackground(GetOptionColour(_T("/highlight_caret_line_color"), wxColour(0xFF, 0xFF, 0x00)));
 
+    wxColour selForegroundColor = GetOptionColour(_T("/selection_foreground_color"), wxNullColour);
+
+    if (selForegroundColor != wxNullColour)
+        m_pControl->SetSelForeground(true, selForegroundColor);
+    else
+        m_pControl->SetSelForeground(false, wxNullColour);
+
+    m_pControl->SetSelBackground(true, GetOptionColour(_T("/selection_background_color"), *wxLIGHT_GREY));
+
     m_pControl->SetUseTabs(mgr->ReadBool(_T("/use_tab"), false));
     m_pControl->SetIndentationGuides(mgr->ReadBool(_T("/show_indent_guides"), false));
     m_pControl->SetTabIndents(mgr->ReadBool(_T("/tab_indents"), true));
Index: src/sdk/editorcolorset.cpp
===================================================================
--- src/sdk/editorcolorset.cpp    (revision 2339)
+++ src/sdk/editorcolorset.cpp    (working copy)
@@ -41,7 +41,6 @@
 #include "filefilters.h"
 
 const int cbHIGHLIGHT_LINE = -98; // highlight line under caret virtual style
-const int cbSELECTION      = -99; // selection virtual style
 
 EditorColorSet::EditorColorSet(const wxString& setName)
     : m_Name(setName)
@@ -134,7 +133,6 @@
             OptionColor* opt = it->second.m_Colors.Item(i);
             // valid values are:
             if (opt->value < 0 &&               // styles >= 0
-                opt->value != cbSELECTION &&    // cbSELECTION
                 opt->value != cbHIGHLIGHT_LINE) // cbHIGHLIGHT_LINE
             {
                 it->second.m_Colors.Remove(opt);
@@ -437,16 +435,6 @@
                 control->SetCaretLineBackground(opt->back);
                 Manager::Get()->GetConfigManager(_T("editor"))->Write(_T("/highlight_caret_line_color"), opt->back);
             }
-            else if (opt->value == cbSELECTION)
-            {
-                if (opt->back != wxNullColour)
-                {
-                    control->SetSelBackground(true, opt->back);
-                    Manager::Get()->GetConfigManager(_T("editor"))->Write(_T("/selection_color"), opt->back);
-                }
-                else
-                    control->SetSelBackground(false, wxColour(0xC0, 0xC0, 0xC0));
-            }
 //            else
 //            {
 //                control->MarkerDefine(-opt->value, 1);
Index: src/sdk/editorconfigurationdlg.cpp
===================================================================
--- src/sdk/editorconfigurationdlg.cpp    (revision 2339)
+++ src/sdk/editorconfigurationdlg.cpp    (working copy)
@@ -71,6 +71,8 @@
 const FileType IdxToFileType[] = { ftSource, ftHeader };
 
 BEGIN_EVENT_TABLE(EditorConfigurationDlg, wxDialog)
+    EVT_BUTTON(XRCID("btnSelForeColor"),        EditorConfigurationDlg::OnChooseColor)
+    EVT_BUTTON(XRCID("btnSelBackColor"),        EditorConfigurationDlg::OnChooseColor)
     EVT_BUTTON(XRCID("btnChooseEditorFont"),     EditorConfigurationDlg::OnChooseFont)
     EVT_BUTTON(XRCID("btnKeywords"),             EditorConfigurationDlg::OnEditKeywords)
     EVT_BUTTON(XRCID("btnFilemasks"),             EditorConfigurationDlg::OnEditFilemasks)
@@ -112,6 +114,8 @@
 
     ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("editor"));
 
+    XRCCTRL(*this, "btnSelForeColor", wxButton)->SetBackgroundColour(cfg->ReadColour(_T("selection_foreground_color"), wxNullColour));
+    XRCCTRL(*this, "btnSelBackColor", wxButton)->SetBackgroundColour(cfg->ReadColour(_T("selection_background_color"), *wxLIGHT_GREY));
        XRCCTRL(*this, "chkAutoIndent", wxCheckBox)->SetValue(cfg->ReadBool(_T("/auto_indent"), true));
        XRCCTRL(*this, "chkSmartIndent", wxCheckBox)->SetValue(cfg->ReadBool(_T("/smart_indent"), true));
        XRCCTRL(*this, "chkUseTab", wxCheckBox)->SetValue(cfg->ReadBool(_T("/use_tab"), false));
@@ -801,19 +805,21 @@
 
         cfg->Write(_T("/font"), XRCCTRL(*this, "lblEditorFont", wxStaticText)->GetFont().GetNativeFontInfoDesc());
 
-        cfg->Write(_T("/auto_indent"),            XRCCTRL(*this, "chkAutoIndent", wxCheckBox)->GetValue());
-        cfg->Write(_T("/smart_indent"),            XRCCTRL(*this, "chkSmartIndent", wxCheckBox)->GetValue());
-        cfg->Write(_T("/use_tab"),                 XRCCTRL(*this, "chkUseTab", wxCheckBox)->GetValue());
-        cfg->Write(_T("/show_indent_guides"),     XRCCTRL(*this, "chkShowIndentGuides", wxCheckBox)->GetValue());
-        cfg->Write(_T("/tab_indents"),             XRCCTRL(*this, "chkTabIndents", wxCheckBox)->GetValue());
-        cfg->Write(_T("/backspace_unindents"),     XRCCTRL(*this, "chkBackspaceUnindents", wxCheckBox)->GetValue());
-        cfg->Write(_T("/word_wrap"),             XRCCTRL(*this, "c
download for full patch...
sethjackson 2006-04-12 20:01

This patch implements the rest of Feature Request #1962.

http://developer.berlios.de/feature/index.php?func=detailfeature&feature_id=1962&group_id=5358

Umm one thing with this patch. I can't quite get the spacing in the XRC file quite right. :P You XRC gurus can probably figure it out......

mandrav 2006-05-09 10:25

Patch not applied because it configured the selection colors globally. They should at least apply per-theme.

Anyway, I added support for it on a per-lexer basis (as was currently).