Author Topic: Weird problem  (Read 3686 times)

sethjackson

  • Guest
Weird problem
« on: March 28, 2006, 08:08:16 pm »
I'm trying to add a page to the editor settings dialog (I'm trying to implement a ftr request). It won't show up in the list......

Code: diff
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 2272)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -547,6 +547,8 @@
 
  m_pControl->SetMouseDwellTime(1000);
 
+    m_pControl->SetCaretWidth(mgr->ReadInt(_T("/caret/width"), 1));
+    m_pControl->SetCaretForeground(GetOptionColour(_T("/caret/color"), *wxBLACK));
  m_pControl->SetCaretLineVisible(mgr->ReadBool(_T("/highlight_caret_line"), false));
  m_pControl->SetCaretLineBackground(GetOptionColour(_T("/highlight_caret_line_color"), wxColour(0xFF, 0xFF, 0x00)));
 
Index: src/sdk/editorconfigurationdlg.cpp
===================================================================
--- src/sdk/editorconfigurationdlg.cpp (revision 2272)
+++ src/sdk/editorconfigurationdlg.cpp (working copy)
@@ -58,6 +58,7 @@
 const wxString base_imgs[] =
 {
     _T("editor"),
+    _T("generic-plugin"),
     _T("folding"),
     _T("gutter-margin"),
     _T("syntax-highlight"),
@@ -75,6 +76,7 @@
  EVT_BUTTON(XRCID("btnKeywords"), EditorConfigurationDlg::OnEditKeywords)
  EVT_BUTTON(XRCID("btnFilemasks"), EditorConfigurationDlg::OnEditFilemasks)
  EVT_BUTTON(XRCID("btnColorsReset"), EditorConfigurationDlg::OnColorsReset)
+ EVT_BUTTON(XRCID("btnCaretColor"),     EditorConfigurationDlg::OnChooseColor)
  EVT_BUTTON(XRCID("btnGutterColor"), EditorConfigurationDlg::OnChooseColor)
  EVT_BUTTON(XRCID("btnColorsFore"), EditorConfigurationDlg::OnChooseColor)
  EVT_BUTTON(XRCID("btnColorsBack"), EditorConfigurationDlg::OnChooseColor)
@@ -140,6 +142,11 @@
    XRCCTRL(*this, "chkEnsureConsistentEOL", wxCheckBox)->SetValue(cfg->ReadBool(_T("/eol/ensure_consistent_line_ends"), false));
     XRCCTRL(*this, "cmbEOLMode", wxComboBox)->SetSelection(cfg->ReadInt(_T("/eol/eolmode"), default_eol));
 
+    //caret
+    wxColour caretColor = cfg->ReadColour(_T("/caret/color"), *wxBLACK);
+    XRCCTRL(*this, "spnCaretWidth", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/caret/width"), 1));
+    XRCCTRL(*this, "btnCaretColor", wxButton)->SetBackgroundColour(caretColor);
+
  //folding
    XRCCTRL(*this, "chkEnableFolding", wxCheckBox)->SetValue(cfg->ReadBool(_T("/folding/show_folds"), true));
    XRCCTRL(*this, "chkFoldOnOpen", wxCheckBox)->SetValue(cfg->ReadBool(_T("/folding/fold_all_on_open"), false));
@@ -148,9 +155,9 @@
    XRCCTRL(*this, "chkFoldXml", wxCheckBox)->SetValue(cfg->ReadBool(_T("/folding/fold_xml"), true));
 
  //gutter
-    wxColour color = cfg->ReadColour(_T("/gutter/color"), *wxLIGHT_GREY);
+    wxColour gutterColor = cfg->ReadColour(_T("/gutter/color"), *wxLIGHT_GREY);
     XRCCTRL(*this, "lstGutterMode", wxChoice)->SetSelection(cfg->ReadInt(_T("/gutter/mode"), 0));
-    XRCCTRL(*this, "btnGutterColor", wxButton)->SetBackgroundColour(color);
+    XRCCTRL(*this, "btnGutterColor", wxButton)->SetBackgroundColour(gutterColor);
     XRCCTRL(*this, "spnGutterColumn", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/gutter/column"), 80));
 
  // color set
@@ -800,6 +807,11 @@
         cfg->Write(_T("/view_whitespace"),      XRCCTRL(*this, "cmbViewWS", wxComboBox)->GetSelection());
         cfg->Write(_T("/tab_text_relative"),    XRCCTRL(*this, "rbTabText", wxRadioBox)->GetSelection() ? true : false);
         cfg->Write(_T("/auto_wrap_search"),     XRCCTRL(*this, "chkAutoWrapSearch", wxCheckBox)->GetValue());
+
+        //caret
+        cfg->Write(_T("/caret/width"), XRCCTRL(*this, "spnCaretWidth", wxSpinCtrl)->GetValue());
+        cfg->Write(_T("/caret/color"), XRCCTRL(*this, "btnCaretColor", wxButton)->GetBackgroundColour());
+
         //folding
         cfg->Write(_T("/folding/show_folds"), XRCCTRL(*this, "chkEnableFolding", wxCheckBox)->GetValue());
         cfg->Write(_T("/folding/fold_all_on_open"), XRCCTRL(*this, "chkFoldOnOpen", wxCheckBox)->GetValue());
Index: src/sdk/resources/editor_configuration.xrc
===================================================================
--- src/sdk/resources/editor_configuration.xrc (revision 2272)
+++ src/sdk/resources/editor_configuration.xrc (working copy)
@@ -363,7 +363,17 @@
               </object>
             </object>
           </object>
+
           <object class="listbookpage">
+            <label>Caret settings</label>
+            <object class="wxPanel" name="tabCaret">
+              <object class="wxBoxSizer">
+                <orient>wxVERTICAL</orient>
+              </object>
+            </object>
+          </object>
+
+          <object class="listbookpage">
             <label>Folding</label>
             <object class="wxPanel" name="tabFolding">
               <object class="wxBoxSizer">
@@ -887,4 +897,4 @@
       </object>
     </object>
   </object>
-</resource>
\ No newline at end of file
+</resource>


sethjackson

  • Guest
Re: Weird problem
« Reply #1 on: March 28, 2006, 10:45:08 pm »
 :oops: Forgot to run update.bat.  :P