[GRASS-SVN] r53664 - in grass/branches/develbranch_6/gui/wxpython: gmodeler gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 2 06:05:25 PDT 2012
Author: martinl
Date: 2012-11-02 06:05:25 -0700 (Fri, 02 Nov 2012)
New Revision: 53664
Modified:
grass/branches/develbranch_6/gui/wxpython/gmodeler/dialogs.py
grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py
Log:
wxGUI/prompt: hide auto-complete when closing dialog
(merge r53663 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gmodeler/dialogs.py 2012-11-02 13:02:14 UTC (rev 53663)
+++ grass/branches/develbranch_6/gui/wxpython/gmodeler/dialogs.py 2012-11-02 13:05:25 UTC (rev 53664)
@@ -150,6 +150,7 @@
self.cmd_prompt.Bind(wx.EVT_KEY_UP, self.OnText)
self.search.searchChoice.Bind(wx.EVT_CHOICE, self.OnText)
self.Bind(wx.EVT_BUTTON, self.OnOk, self.btnOk)
+ self.Bind(wx.EVT_BUTTON, self.OnCancel, self.btnCancel)
self._layout()
@@ -197,6 +198,10 @@
def OnOk(self, event):
"""!Button 'OK' pressed"""
+ # hide autocomplete
+ if self.cmd_prompt.AutoCompActive():
+ self.cmd_prompt.AutoCompCancel()
+
self.btnOk.SetFocus()
cmd = self.GetCmd()
@@ -214,6 +219,14 @@
self.EndModal(wx.ID_OK)
+ def OnCancel(self, event):
+ """Cancel pressed, close window"""
+ # hide autocomplete
+ if self.cmd_prompt.AutoCompActive():
+ self.cmd_prompt.AutoCompCancel()
+
+ self.Hide()
+
def OnText(self, event):
"""!Text in prompt changed"""
if self.cmd_prompt.AutoCompActive():
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py 2012-11-02 13:02:14 UTC (rev 53663)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py 2012-11-02 13:05:25 UTC (rev 53664)
@@ -126,6 +126,10 @@
event.Skip()
return
+ # hide autocomplete
+ if self.cmdPrompt.AutoCompActive():
+ self.cmdPrompt.AutoCompCancel()
+
text = event.GetEventObject().GetValue()
if not text:
self.cmdPrompt.SetFilter(None)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py 2012-11-02 13:02:14 UTC (rev 53663)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/prompt.py 2012-11-02 13:05:25 UTC (rev 53664)
@@ -726,7 +726,7 @@
# create command and map lists for autocompletion
#
self.AutoCompSetIgnoreCase(False)
-
+
#
# line margins
#
More information about the grass-commit
mailing list