浏览代码

wxGUI/ModifyTableRecord: set focus on first widget

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48084 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 年之前
父节点
当前提交
a12c258b16
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      gui/wxpython/gui_modules/dbm_dialogs.py

+ 4 - 0
gui/wxpython/gui_modules/dbm_dialogs.py

@@ -562,6 +562,7 @@ class ModifyTableRecord(wx.Dialog):
         cId = 0
         self.usebox = False
         self.cat = None
+        winFocus = False
         for column, value in data:
             if self.keyId == cId:
                 self.cat = int(value)
@@ -578,6 +579,9 @@ class ModifyTableRecord(wx.Dialog):
             else:
                 valueWin = wx.TextCtrl(parent = self.dataPanel, id = wx.ID_ANY,
                                        value = value, size = (250, -1))
+                if not winFocus:
+                    wx.CallAfter(valueWin.SetFocus)
+                    winFocus = True
             
             label = wx.StaticText(parent = self.dataPanel, id = wx.ID_ANY,
                                   label = column + ":")