[GRASS-SVN] r42252 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 13 18:30:11 EDT 2010


Author: martinl
Date: 2010-05-13 18:30:11 -0400 (Thu, 13 May 2010)
New Revision: 42252

Modified:
   grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
Log:
wxGUI/mcalc: fix insert position for '()'


Modified: grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py	2010-05-13 22:24:06 UTC (rev 42251)
+++ grass/trunk/gui/wxpython/gui_modules/mcalc_builder.py	2010-05-13 22:30:11 UTC (rev 42252)
@@ -374,7 +374,7 @@
         item = event.GetString()
         self._addSomething(item)
         
-    def _addSomething(self,what):
+    def _addSomething(self, what):
         """!Inserts operators, map names, and functions into text area
         """
         self.text_mcalc.SetFocus()
@@ -396,6 +396,8 @@
         newmcalcstr += ' ' + mcalcstr[position:]
         
         self.text_mcalc.SetValue(newmcalcstr)
+        if what == '()':
+            position_offset -= 1
         self.text_mcalc.SetInsertionPoint(position + position_offset)
         self.text_mcalc.Update()
         



More information about the grass-commit mailing list