[GRASS-SVN] r42335 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 24 05:23:13 EDT 2010
Author: martinl
Date: 2010-05-24 05:23:11 -0400 (Mon, 24 May 2010)
New Revision: 42335
Modified:
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: FloatValidator - skip empty strings
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-05-24 09:02:23 UTC (rev 42334)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-05-24 09:23:11 UTC (rev 42335)
@@ -2095,16 +2095,19 @@
"""Validate input"""
textCtrl = self.GetWindow()
text = textCtrl.GetValue()
- try:
- float(text)
- except ValueError:
- textCtrl.SetBackgroundColour("grey")
- textCtrl.SetFocus()
- textCtrl.Refresh()
- return False
+
+ if text:
+ try:
+ float(text)
+ except ValueError:
+ textCtrl.SetBackgroundColour("grey")
+ textCtrl.SetFocus()
+ textCtrl.Refresh()
+ return False
- textCtrl.SetBackgroundColour(
- wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ sysColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ textCtrl.SetBackgroundColour(sysColor)
+
textCtrl.Refresh()
return True
More information about the grass-commit
mailing list