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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 8 05:55:42 EDT 2008


Author: martinl
Date: 2008-04-08 05:55:42 -0400 (Tue, 08 Apr 2008)
New Revision: 30903

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI (menuform): bugfix, cats value for spinctrl to int


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-04-08 09:36:51 UTC (rev 30902)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-04-08 09:55:42 UTC (rev 30903)
@@ -1036,7 +1036,10 @@
                 if p.get('multiple','yes') == 'yes' or \
                         p.get('type','string') == 'string':
                     txt3 = wx.TextCtrl(parent=which_panel, value = p.get('default',''),
-                                   size=globalvar.DIALOG_TEXTCTRL_SIZE)
+                                       size=globalvar.DIALOG_TEXTCTRL_SIZE)
+                    if p.get('value','') != '':
+                        txt3.SetValue(str(p['value'])) # parameter previously set
+
                     txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
                 else:
                     minValue = -1e9
@@ -1044,12 +1047,12 @@
                     txt3 = wx.SpinCtrl(parent=which_panel, value=p.get('default',''),
                                        size=globalvar.DIALOG_SPIN_SIZE,
                                        min=minValue, max=maxValue)
+                    if p.get('value','') != '':
+                        txt3.SetValue(int(p['value'])) # parameter previously set
+
                     txt3.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
                     txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
                     
-                if p.get('value','') != '':
-                    txt3.SetValue(p['value']) # parameter previously set
-
                 which_sizer.Add(item=txt3, proportion=0, flag=wx.BOTTOM | wx.LEFT, border=5)
                 p['wxId'] = txt3.GetId()
 



More information about the grass-commit mailing list