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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 9 16:15:34 EDT 2008


Author: martinl
Date: 2008-04-09 16:15:34 -0400 (Wed, 09 Apr 2008)
New Revision: 30919

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI (menuform): bugfix do not use default value for multiple checkboxes if 'value' is given


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-04-09 20:01:18 UTC (rev 30918)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-04-09 20:15:34 UTC (rev 30919)
@@ -962,18 +962,20 @@
                         hSizer=wx.StaticBoxSizer ( box=txt, orient=wx.VERTICAL )
                     else:
                         hSizer=wx.StaticBoxSizer ( box=txt, orient=wx.HORIZONTAL )
-                    isDefault = {}
+                    isEnabled = {}
                     # copy default values
-                    p['value'] = p.get('default', '')
-                    for defval in p.get('default', '').split(','):
-                        isDefault[ defval ] = 'yes'
+                    if p['value'] == '':
+                        p['value'] = p.get('default', '')
+                        
+                    for defval in p.get('value', '').split(','):
+                        isEnabled[ defval ] = 'yes'
                         # for multi checkboxes, this is an array of all wx IDs
                         # for each individual checkbox
                         p[ 'wxId' ] = []
                     for val in valuelist:
                         chkbox = wx.CheckBox( parent=which_panel, label = text_beautify(val) )
                         p[ 'wxId' ].append( chkbox.GetId() )
-                        if isDefault.has_key(val):
+                        if isEnabled.has_key(val):
                             chkbox.SetValue( True )
                         hSizer.Add( item=chkbox, proportion=0,
                                     flag=wx.ADJUST_MINSIZE | wx.ALL, border=1 )



More information about the grass-commit mailing list