[GRASS-SVN] r31689 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 12 17:08:07 EDT 2008
Author: martinl
Date: 2008-06-12 17:08:07 -0400 (Thu, 12 Jun 2008)
New Revision: 31689
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/vdigit.py
Log:
wxGUI/vdigit: currently edited vector map cannot be used as background map
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2008-06-12 11:31:29 UTC (rev 31688)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2008-06-12 21:08:07 UTC (rev 31689)
@@ -27,7 +27,7 @@
class Select(wx.combo.ComboCtrl):
def __init__(self, parent, id, size,
- type, multiple=False, mapsets=None):
+ type, multiple=False, mapsets=None, exceptOf=[]):
"""
Custom control to create a ComboBox with a tree control
to display and select GIS elements within acessible mapsets.
@@ -39,7 +39,7 @@
self.tcp = TreeCtrlComboPopup()
self.SetPopupControl(self.tcp)
self.SetPopupExtents(0,100)
- self.tcp.GetElementList(type, mapsets)
+ self.tcp.GetElementList(type, mapsets, exceptOf)
self.tcp.SetMultiple(multiple)
def SetElementList(self, type):
@@ -116,7 +116,7 @@
def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
return wx.Size(minWidth, min(200, maxHeight))
- def GetElementList(self, element, mapsets=None):
+ def GetElementList(self, element, mapsets=None, exceptOf=[]):
"""
Get list of GIS elements in accessible mapsets and display as tree
with all relevant elements displayed beneath each mapset branch
@@ -195,7 +195,10 @@
elem_list.sort()
for elem in elem_list:
if elem != '':
- self.AddItem(elem+'@'+dir, parent=dir_node)
+ fullqElem = elem + '@' + dir
+ if len(exceptOf) > 0 and fullqElem in exceptOf:
+ continue
+ self.AddItem(fullqElem, parent=dir_node)
except:
continue
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/vdigit.py 2008-06-12 11:31:29 UTC (rev 31688)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/vdigit.py 2008-06-12 21:08:07 UTC (rev 31689)
@@ -159,6 +159,10 @@
except:
pass
+ # avoid using current vector map as background map
+ if self.map == UserSettings.Get(group='vdigit', key='backgroundMap', subkey='value'):
+ UserSettings.Set(group='vdigit', key='backgroundMap', subkey='value', value='')
+
def SelectLinesByQueryThresh(self):
"""Generic method used for SelectLinesByQuery()
-- to get threshold value"""
@@ -1687,7 +1691,7 @@
# background map
text = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Background vector map"))
self.backgroundMap = gselect.Select(parent=panel, id=wx.ID_ANY, size=(200,-1),
- type="vector")
+ type="vector", exceptOf=[self.parent.digit.map])
self.backgroundMap.SetValue(UserSettings.Get(group='vdigit', key="backgroundMap", subkey='value'))
self.backgroundMap.Bind(wx.EVT_TEXT, self.OnChangeBackgroundMap)
flexSizer2.Add(text, proportion=1, flag=wx.ALIGN_CENTER_VERTICAL)
More information about the grass-commit
mailing list