Patch #1714 2006-12-11 22:29

ramazank

Autofillup characters for Code Completion
Download
1714-Autofillup_cha.patch (7.0 KB)
Category
Plugin::FeatureAdd
Status
Accepted
Close date
2007-04-12 12:11
Assigned to
mandrav
Index: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp    (revision 3363)
+++ src/plugins/codecompletion/codecompletion.cpp    (working copy)
@@ -552,7 +552,7 @@
 #endif
             ed->GetControl()->AutoCompSetIgnoreCase(!caseSens);
             ed->GetControl()->AutoCompSetCancelAtStart(true);
-            ed->GetControl()->AutoCompSetFillUps(wxEmptyString);
+            ed->GetControl()->AutoCompSetFillUps(cfg->Read(_T("/fillup_chars"), wxEmptyString));
             ed->GetControl()->AutoCompSetChooseSingle(m_IsAutoPopup ? false : cfg->ReadBool(_T("/auto_select_one"), false));
             ed->GetControl()->AutoCompSetAutoHide(true);
             ed->GetControl()->AutoCompSetDropRestOfWord(m_IsAutoPopup ? false : true);
Index: src/plugins/codecompletion/ccoptionsdlg.cpp
===================================================================
--- src/plugins/codecompletion/ccoptionsdlg.cpp    (revision 3363)
+++ src/plugins/codecompletion/ccoptionsdlg.cpp    (working copy)
@@ -113,6 +113,7 @@
     XRCCTRL(*this, "spnThreadsNum", wxSpinCtrl)->Enable(false);
     XRCCTRL(*this, "chkFloatCB", wxCheckBox)->SetValue(cfg->ReadBool(_T("/as_floating_window"), false));
     XRCCTRL(*this, "chkNoSB", wxCheckBox)->SetValue(!cfg->ReadBool(_T("/use_symbols_browser"), true));
+    XRCCTRL(*this, "txtFillupChars", wxTextCtrl)->SetValue(cfg->Read(_T("/fillup_chars"), wxEmptyString));
 
     int timerDelay = cfg->ReadInt(_T("/cc_delay"), 500);
     XRCCTRL(*this, "sliderDelay", wxSlider)->SetValue(timerDelay / 100);
@@ -250,6 +251,8 @@
     XRCCTRL(*this, "spnMaxMatches", wxSpinCtrl)->Enable(en);
     XRCCTRL(*this, "sliderDelay", wxSlider)->Enable(en);
     XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->Enable(en);
+    XRCCTRL(*this, "lblFillupChars", wxStaticText)->Enable(en);
+    XRCCTRL(*this, "txtFillupChars", wxTextCtrl)->Enable(en);
 
     en = !XRCCTRL(*this, "chkNoSB", wxCheckBox)->GetValue();
     XRCCTRL(*this, "chkInheritance", wxCheckBox)->Enable(en);
@@ -284,6 +287,7 @@
     m_Parser.Options().useSmartSense = !XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->GetValue();
 
     cfg->Write(_T("/use_symbols_browser"), (bool)!XRCCTRL(*this, "chkNoSB", wxCheckBox)->GetValue());
+    cfg->Write(_T("/fillup_chars"), XRCCTRL(*this, "txtFillupChars", wxTextCtrl)->GetValue());
     m_Parser.ClassBrowserOptions().showInheritance = XRCCTRL(*this, "chkInheritance", wxCheckBox)->GetValue();
     cfg->Write(_T("/as_floating_window"), (bool)XRCCTRL(*this, "chkFloatCB", wxCheckBox)->GetValue());
     m_Parser.WriteOptions();
Index: src/plugins/codecompletion/resources/settings.xrc
===================================================================
--- src/plugins/codecompletion/resources/settings.xrc    (revision 3363)
+++ src/plugins/codecompletion/resources/settings.xrc    (working copy)
@@ -135,6 +135,31 @@
                                                 </object>
                                             </object>
                                         </object>
+                                        <object class="sizeritem">
+                                            <option>1</option>
+                                            <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND</flag>
+                                            <object class="wxFlexGridSizer">
+                                                <rows>1</rows>
+                                                <cols>2</cols>
+                                                <vgap>0</vgap>
+                                                <hgap>0</hgap>
+                                                <growablecols>2</growablecols>
+                                                <growablerows>1</growablerows>
+                                                <object class="sizeritem">
+                                                    <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
+                                                    <object class="wxStaticText" name="lblFillupChars">
+                                                        <label>Fillup Characters</label>
+                                                        <size>83,13</size>
+                                                    </object>
+                                                </object>
+                                                <object class="sizeritem">
+                                                    <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
+                                                    <object class="wxTextCtrl" name="txtFillupChars">
+                                                        <value>Text</value>
+                                                    </object>
+                                                </object>
+                                            </object>
+                                        </object>
download for full patch...
ramazank 2006-12-11 22:36

Default key for closing the code completion list and entering the selected item into editor is ENTER key. This is called auto filling up. This patch adds an option to code completion config dialog to specify additional characters for auto fill up. For example define '(' for auto fill up and when you press the '(' key while code completion list is visible, it will close the list and selected item will be entered into the editor.

mandrav 2007-04-12 12:11

Patch applied, thank you.