[GRASS-SVN] r33214 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 2 05:43:47 EDT 2008


Author: martinl
Date: 2008-09-02 05:43:44 -0400 (Tue, 02 Sep 2008)
New Revision: 33214

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: set focus to the first parameter


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-09-02 09:32:33 UTC (rev 33213)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-09-02 09:43:44 UTC (rev 33214)
@@ -969,6 +969,12 @@
         # parameters
         #
         visible_params = [ p for p in self.task.params if not p.get( 'hidden', 'no' ) == 'yes' ]
+        
+        try:
+            first_param = visible_params[0]
+        except IndexError:
+            first_param = None
+        
         for p in visible_params:
             which_sizer = tabsizer[ p['guisection'] ]
             which_panel = tab[ p['guisection'] ]
@@ -1229,6 +1235,9 @@
                 if tooltip:
                     txt.SetToolTipString(tooltip)
 
+            if p == first_param:
+                self.FindWindowById(p['wxId']).SetFocus()
+        
 	#
 	# determine panel size
 	#



More information about the grass-commit mailing list