[GRASS-SVN] r61469 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 31 03:57:27 PDT 2014


Author: martinl
Date: 2014-07-31 03:57:27 -0700 (Thu, 31 Jul 2014)
New Revision: 61469

Modified:
   grass/trunk/gui/wxpython/lmgr/datacatalog.py
Log:
wxGUI/LocationMapTree: allow multiple selection

Modified: grass/trunk/gui/wxpython/lmgr/datacatalog.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/datacatalog.py	2014-07-31 10:52:34 UTC (rev 61468)
+++ grass/trunk/gui/wxpython/lmgr/datacatalog.py	2014-07-31 10:57:27 UTC (rev 61469)
@@ -82,11 +82,15 @@
         self.tree.ExpandCurrentLocation()
 
 class LocationMapTree(wx.TreeCtrl):
-    def __init__(self, parent):
+    def __init__(self, parent, multiple=False):
         """Location Map Tree constructor."""
-        super(LocationMapTree, self).__init__(parent, id=wx.ID_ANY, style = wx.TR_HIDE_ROOT | wx.TR_EDIT_LABELS |
-                                              wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_COLUMN_LINES | 
-                                              wx.TR_SINGLE)
+        style = wx.TR_HIDE_ROOT | wx.TR_EDIT_LABELS | \
+            wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_COLUMN_LINES
+        if multiple:
+            style |= wx.TR_MULTIPLE
+        else:
+            style |= wx.TR_SINGLE
+        super(LocationMapTree, self).__init__(parent, id=wx.ID_ANY, style=style)
         self.showNotification = Signal('Tree.showNotification')
         self.parent = parent
         self.root = self.AddRoot('Catalog') # will not be displayed when we use TR_HIDE_ROOT flag
@@ -533,7 +537,7 @@
     class TestTree(LocationMapTree):
         def __init__(self, parent):
             """Test Tree constructor."""
-            super(TestTree, self).__init__(parent)
+            super(TestTree, self).__init__(parent, multiple=True)
             
         def InitTreeItems(self):
             """Add locations, mapsets and layers to the tree."""



More information about the grass-commit mailing list