[GRASS-SVN] r39179 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 13 13:46:13 EDT 2009
Author: martinl
Date: 2009-09-13 13:46:12 -0400 (Sun, 13 Sep 2009)
New Revision: 39179
Modified:
grass/trunk/gui/wxpython/gui_modules/gdialogs.py
grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
use MapsetSelect
Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2009-09-13 17:02:12 UTC (rev 39178)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2009-09-13 17:46:12 UTC (rev 39179)
@@ -779,10 +779,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/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2009-09-13 17:02:12 UTC (rev 39178)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2009-09-13 17:46:12 UTC (rev 39179)
@@ -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
@@ -690,7 +689,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)
@@ -706,4 +705,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