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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 13 13:59:21 EDT 2009


Author: martinl
Date: 2009-09-13 13:59:21 -0400 (Sun, 13 Sep 2009)
New Revision: 39180

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
use MapsetSelect
    (merge r39179 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2009-09-13 17:46:12 UTC (rev 39179)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2009-09-13 17:59:21 UTC (rev 39180)
@@ -778,10 +778,7 @@
                       flag=wx.ALIGN_CENTER_VERTICAL,
                       pos=(1,0))
 
-        self.mapset = wx.ComboBox(parent=self, id=wx.ID_ANY,
-                                  style=wx.CB_SIMPLE | wx.CB_READONLY,
-                                  choices=utils.ListOfMapsets(),
-                                  size=(250,-1))
+        self.mapset = gselect.MapsetSelect(parent = self)
         self.mapset.SetStringSelection(grass.gisenv()['MAPSET'])
         bodySizer.Add(item=self.mapset,
                       pos=(1,1), span=(1, 2))

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-09-13 17:46:12 UTC (rev 39179)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-09-13 17:59:21 UTC (rev 39180)
@@ -50,14 +50,13 @@
         self.GetChildren()[0].type = type
         
         self.tcp = TreeCtrlComboPopup()
-
         self.SetPopupControl(self.tcp)
         self.SetPopupExtents(0,100)
         if type:
             self.tcp.SetData(type = type, mapsets = mapsets,
                              exclude = exclude, multiple = multiple,
                              updateOnPopup = updateOnPopup)
-
+        
     def SetElementList(self, type, mapsets = None, exclude = []):
         """!Set element list
 
@@ -701,7 +700,7 @@
 class MapsetSelect(wx.ComboBox):
     """!Widget for selecting GRASS mapset"""
     def __init__(self, parent, id = wx.ID_ANY, size = globalvar.DIALOG_COMBOBOX_SIZE, 
-                 gisdbase = None, location = None, **kwargs):
+                 gisdbase = None, location = None, setItems = True, **kwargs):
         super(MapsetSelect, self).__init__(parent, id, size = size, 
                                            style = wx.CB_READONLY, **kwargs)
         
@@ -717,4 +716,5 @@
         else:
             self.location = location
         
-        self.SetItems(utils.GetListOfMapsets(self.gisdbase, self.location, selectable = True)) # selectable
+        if setItems:
+            self.SetItems(utils.GetListOfMapsets(self.gisdbase, self.location, selectable = True)) # selectable



More information about the grass-commit mailing list