[GRASS-SVN] r42600 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jun 20 10:59:00 EDT 2010
Author: martinl
Date: 2010-06-20 14:59:00 +0000 (Sun, 20 Jun 2010)
New Revision: 42600
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/menuform: don't ignore default value for SpinCtrl
(merge r42599 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2010-06-20 14:56:21 UTC (rev 42599)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2010-06-20 14:59:00 UTC (rev 42600)
@@ -1183,8 +1183,8 @@
flag=wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, border=5 )
elif p.get('gisprompt', False) == False:
if len(valuelist) == 1: # -> textctrl
- title_txt.SetLabel("%s. %s %s" % (title, _('Valid range'),
- str(valuelist[0]) + ':'))
+ title_txt.SetLabel("%s (%s %s):" % (title, _('valid range'),
+ str(valuelist[0])))
if p.get('type', '') == 'integer' and \
p.get('multiple','no') == 'no':
@@ -1210,6 +1210,11 @@
txt2.SetValue(int(p['value']))
else:
txt2.SetValue(p['value'])
+ elif p.get('default', '') != '':
+ if txt2.GetName() == "SpinCtrl":
+ txt2.SetValue(int(p['default']))
+ else:
+ txt2.SetValue(p['default'])
which_sizer.Add(item=txt2, proportion=0,
flag=style, border=5)
@@ -1258,6 +1263,8 @@
if p.get('value', '') != '':
txt3.SetValue(int(p['value'])) # parameter previously set
+ elif p.get('default', '') != '':
+ txt3.SetValue(int(p['default']))
txt3.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
else:
More information about the grass-commit
mailing list