[GRASS-SVN] r33320 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 7 15:59:15 EDT 2008
Author: martinl
Date: 2008-09-07 15:59:15 -0400 (Sun, 07 Sep 2008)
New Revision: 33320
Modified:
grass/trunk/gui/wxpython/gui_modules/dbm.py
grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: minor fixes in nviz and atm
(merge from devbr6, r33319)
Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py 2008-09-07 19:55:52 UTC (rev 33319)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py 2008-09-07 19:59:15 UTC (rev 33320)
@@ -1838,8 +1838,10 @@
Return True if map has been redrawn, False if no map is given
"""
list = self.FindWindowById(self.layerPage[self.layer]['data'])
- cats = list.GetSelectedItems() # FIXME: category can be hiden in list
-
+ cats = {
+ self.layer : list.GetSelectedItems()
+ }
+
if self.mapdisplay.Map.GetLayerIndex(self.qlayer) < 0:
self.qlayer = None
Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2008-09-07 19:55:52 UTC (rev 33319)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2008-09-07 19:59:15 UTC (rev 33320)
@@ -315,25 +315,34 @@
return 1
- def LoadDataLayers(self):
- """Load raster/vector from current layer tree
-
- @todo volumes
- """
- listOfItems = []
+ def _GetDataLayers(self, item, litems):
+ """Return get list of enabled map layers"""
# load raster & vector maps
- item = self.tree.GetFirstChild(self.tree.root)[0]
while item and item.IsOk():
type = self.tree.GetPyData(item)[0]['type']
+ if type == 'group':
+ subItem = self.tree.GetFirstChild(item)[0]
+ self._GetDataLayers(subItem, litems)
+ item = self.tree.GetNextSibling(item)
+
if not item.IsChecked() or \
type not in ('raster', 'vector', '3d-raster'):
item = self.tree.GetNextSibling(item)
continue
- listOfItems.append(item)
+ litems.append(item)
item = self.tree.GetNextSibling(item)
+
+ def LoadDataLayers(self):
+ """Load raster/vector from current layer tree
+ @todo volumes
+ """
+ listOfItems = []
+ item = self.tree.GetFirstChild(self.tree.root)[0]
+ self._GetDataLayers(item, listOfItems)
+
start = time.time()
while(len(listOfItems) > 0):
Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py 2008-09-07 19:55:52 UTC (rev 33319)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py 2008-09-07 19:59:15 UTC (rev 33320)
@@ -1895,9 +1895,9 @@
data = self.mapWindow.GetSelectedLayer(type='nviz')
for attrb in ('width', 'color', 'mode'):
data['vector']['lines'][attrb]['update'] = None
- data['vector']['lines']['width'] = width
- data['vector']['lines']['color'] = color
- data['vector']['lines']['mode'] = mode
+ data['vector']['lines']['width']['value'] = width
+ data['vector']['lines']['color']['value'] = color
+ data['vector']['lines']['mode']['value'] = mode
# update properties
event = wxUpdateProperties(data=data)
@@ -2313,7 +2313,7 @@
page=panel,
text=" %s " % _("Layer properties"),
select=True)
-
+
self.UpdateVectorPage(layer, data['vector'])
elif pageId == 'volume':
Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-09-07 19:55:52 UTC (rev 33319)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-09-07 19:59:15 UTC (rev 33320)
@@ -1326,9 +1326,10 @@
"""Enable/disable items in layer tree"""
item = self.GetFirstChild(self.root)[0]
while item and item.IsOk():
- ltype = self.GetPyData(item)[0]['maplayer'].type
- if type == ltype:
+ mapLayer = self.GetPyData(item)[0]['maplayer']
+ if mapLayer and type == mapLayer.type:
self.EnableItem(item, enable)
+
item = self.GetNextSibling(item)
def __FindSubItemByData(self, item, key, value):
More information about the grass-commit
mailing list