dabo Commit
Revision 2985
Date: 2007-03-26 11:19:37 -0700 (Mon, 26 Mar 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/2985

Changed:
U   trunk/dabo/ui/uiwx/dEditor.py

Log:
Fixed a couple of annoying behaviors that crop up especially often with the 
AutoAutoComplete feature. First, if an autocomplete popup is active and you 
type a string that doesn't match anything in the list, the popup closes. This 
eliminates the previous behavior where you could type something that didn't 
match, and the editor would replace it with something close.

Also, if you had an autocomplete popup active and typed a period, it would 
accept the current selection, but if that created a valid reference, the popup 
for the period never happened. This fixes that problem.


Diff:
Modified: trunk/dabo/ui/uiwx/dEditor.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditor.py       2007-03-26 13:01:45 UTC (rev 2984)
+++ trunk/dabo/ui/uiwx/dEditor.py       2007-03-26 18:19:37 UTC (rev 2985)
@@ -9,7 +9,6 @@
 import compiler
 import wx
 import wx.stc as stc
-import wx.gizmos as gizmos
 import dabo
 
 if __name__ == "__main__":
@@ -402,7 +401,7 @@
 
                ## Autocomplete settings:
                self.AutoCompSetIgnoreCase(True)
-               self.AutoCompSetAutoHide(False)  ## don't hide when the typed 
string no longer matches
+               self.AutoCompSetAutoHide(True)   ## don't hide when the typed 
string no longer matches
                self.AutoCompStops(" ")  ## characters that will stop the 
autocomplete
                self.AutoCompSetFillUps(".(")
                # This lets you go all the way back to the '.' without losing 
the AutoComplete
@@ -730,6 +729,7 @@
                                # so that onListSelection() knows to call 
                                # autocomplete on the new item:
                                self._insertChar = "."
+                               dabo.ui.callAfter(self._onPeriodActive)
                        else:
                                self._posBeforeCompList = self.GetCurrentPos() 
+ 1
                                dabo.ui.callAfter(self.codeComplete)
@@ -740,6 +740,11 @@
                        dabo.ui.callAfter(self.autoComplete, 
minWordLen=self.AutoAutoCompleteMinLen)
 
 
+       def _onPeriodActive(self):
+               self._posBeforeCompList = self.GetCurrentPos()
+               dabo.ui.callAfter(self.codeComplete)
+
+
        def onListSelection(self, evt):
                txt = evt.GetText()
                if len(txt) > 0:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to