[GRASS-SVN] r40136 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 24 17:00:52 EST 2009


Author: martinl
Date: 2009-12-24 17:00:51 -0500 (Thu, 24 Dec 2009)
New Revision: 40136

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI/prompt: bug fix when command is not selected from the list
	      (merge r40135 from devbr6)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-12-24 21:57:46 UTC (rev 40135)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-12-24 22:00:51 UTC (rev 40136)
@@ -614,7 +614,7 @@
         self.Bind(wx.EVT_TEXT,       self.OnUpdateStatusBar)
         
     def __checkKey(self, text, keywords):
-        """!Check if text is in keywords"""
+        """!Check if text is in keywords (unused)"""
         found = 0
         keys = text.split(',')
         if len(keys) > 1: # -> multiple keys
@@ -646,7 +646,7 @@
 
 class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
     """!Styled wxGUI prompt with autocomplete and calltips"""    
-    def __init__(self, parent, id = wx.ID_ANY, margin = False, wrap = None):
+    def __init__(self, parent, id = wx.ID_ANY, margin = False):
         GPrompt.__init__(self, parent)
         wx.stc.StyledTextCtrl.__init__(self, self.panel, id)
         
@@ -869,7 +869,18 @@
             if len(self.cmdbuffer) > 200:
                 del self.cmdbuffer[0]
             self.cmdindex = len(self.cmdbuffer)
-            
+
+        elif event.GetKeyCode() == wx.WXK_SPACE:
+            items = self.GetTextLeft().split()
+            if len(items) == 1:
+                cmd = items[0].strip()
+                if not self.cmdDesc or cmd != self.cmdDesc.get_name():
+                    try:
+                        self.cmdDesc = menuform.GUI().ParseInterface(cmd = [cmd])
+                    except IOError:
+                        self.cmdDesc = None
+            event.Skip()
+        
         else:
             event.Skip()
         



More information about the grass-commit mailing list