[GRASS-SVN] r42194 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 9 13:13:11 EDT 2010
Author: martinl
Date: 2010-05-09 13:13:11 -0400 (Sun, 09 May 2010)
New Revision: 42194
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mcalc_builder.py
Log:
wxGUI/mapcalc: fix inserting operands
(merge r42192 from trunk)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mcalc_builder.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mcalc_builder.py 2010-05-09 17:11:24 UTC (rev 42193)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mcalc_builder.py 2010-05-09 17:13:11 UTC (rev 42194)
@@ -339,31 +339,30 @@
"""
item = event.GetString()
self._addSomething(item)
- self.text_mcalc.SetFocus()
def _addSomething(self,what):
"""!Inserts operators, map names, and functions into text area
"""
self.text_mcalc.SetFocus()
- mcalcstr = self.text_mcalc.GetValue()
- newmcalcstr = ''
- position = self.text_mcalc.GetInsertionPoint()
+ mcalcstr = self.text_mcalc.GetValue()
+ position = self.text_mcalc.GetInsertionPoint()
- selection = self.text_mcalc.GetSelection()
-
newmcalcstr = mcalcstr[:position]
+ position_offset = 0
try:
if newmcalcstr[-1] != ' ':
- newmcalcstr += " "
+ newmcalcstr += ' '
+ position_offset += 1
except:
pass
+
newmcalcstr += what
- position_offset = len(what)
- newmcalcstr += " " + mcalcstr[position:]
+ position_offset += len(what)
+ newmcalcstr += ' ' + mcalcstr[position:]
self.text_mcalc.SetValue(newmcalcstr)
- self.text_mcalc.SetInsertionPoint(position+position_offset)
+ self.text_mcalc.SetInsertionPoint(position + position_offset)
self.text_mcalc.Update()
def OnMCalcRun(self,event):
More information about the grass-commit
mailing list