Browse Source

wxGUI:dbmgr: select item automatically when WHERE statement is given
(merge https://trac.osgeo.org/grass/changeset/62331 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62332 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 10 years ago
parent
commit
393dbe6d5f
1 changed files with 9 additions and 1 deletions
  1. 9 1
      gui/wxpython/dbmgr/base.py

+ 9 - 1
gui/wxpython/dbmgr/base.py

@@ -252,7 +252,7 @@ class VirtualAttributeList(wx.ListCtrl,
                 return
 
             self.AddDataRow(i, record, columns, keyId)
-
+            
             i += 1
             if i >= 100000:
                 self.log.write(_("Viewing limit: 100000 records."))
@@ -260,6 +260,14 @@ class VirtualAttributeList(wx.ListCtrl,
         
         self.SetItemCount(i)
         
+        if where:
+            item = -1
+            while True:
+                item = self.GetNextItem(item)
+                if item == -1:
+                    break
+                self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
+        
         i = 0
         for col in columns:
             width = self.columns[col]['length'] * 6 # FIXME