Ver código fonte

wxGUI/mcalc: fix insert position for '()'

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42252 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 anos atrás
pai
commit
6405c51c70
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      gui/wxpython/gui_modules/mcalc_builder.py

+ 3 - 1
gui/wxpython/gui_modules/mcalc_builder.py

@@ -374,7 +374,7 @@ class MapCalcFrame(wx.Frame):
         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 @@ class MapCalcFrame(wx.Frame):
         newmcalcstr += ' ' + mcalcstr[position:]
         
         self.text_mcalc.SetValue(newmcalcstr)
+        if what == '()':
+            position_offset -= 1
         self.text_mcalc.SetInsertionPoint(position + position_offset)
         self.text_mcalc.Update()