[GRASS-SVN] r40135 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Dec 24 16:57:48 EST 2009
Author: martinl
Date: 2009-12-24 16:57:46 -0500 (Thu, 24 Dec 2009)
New Revision: 40135
Modified:
grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI/prompt: bug fix when command is not selected from the list
Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py 2009-12-24 21:31:32 UTC (rev 40134)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py 2009-12-24 21:57:46 UTC (rev 40135)
@@ -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