Pārlūkot izejas kodu

wxGUI: set focus to the first parameter
(merge from devbr6, https://trac.osgeo.org/grass/changeset/33214)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33215 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 gadi atpakaļ
vecāks
revīzija
3b2e745093
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9 0
      gui/wxpython/gui_modules/menuform.py

+ 9 - 0
gui/wxpython/gui_modules/menuform.py

@@ -969,6 +969,12 @@ class cmdPanel(wx.Panel):
         # 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 @@ class cmdPanel(wx.Panel):
                 if tooltip:
                     txt.SetToolTipString(tooltip)
 
+            if p == first_param:
+                self.FindWindowById(p['wxId']).SetFocus()
+        
 	#
 	# determine panel size
 	#