[GRASS-SVN] r54896 - in grass/trunk/gui/wxpython: mapdisp wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 4 06:20:45 PST 2013
Author: wenzeslaus
Date: 2013-02-04 06:20:45 -0800 (Mon, 04 Feb 2013)
New Revision: 54896
Modified:
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/wxplot/dialogs.py
grass/trunk/gui/wxpython/wxplot/histogram.py
Log:
wxGUI/mapdisp: using giface to initialize wxplot histogram (histogram works for d.mon); small improvements in histogram multiple raster handling
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2013-02-04 13:47:38 UTC (rev 54895)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2013-02-04 14:20:45 UTC (rev 54896)
@@ -1078,10 +1078,9 @@
"""
raster = []
- for layer in self.tree.GetSelections():
- if self.tree.GetLayerInfo(layer, key = 'maplayer').GetType() != 'raster':
- continue
- raster.append(self.tree.GetLayerInfo(layer, key = 'maplayer').GetName())
+ for layer in self._giface.GetLayerList().GetSelectedLayers():
+ if layer.maplayer.GetType() == 'raster':
+ raster.append(layer.maplayer.GetName())
win = Histogram2Frame(parent = self, rasterList = raster)
win.CentreOnParent()
Modified: grass/trunk/gui/wxpython/wxplot/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/dialogs.py 2013-02-04 13:47:38 UTC (rev 54895)
+++ grass/trunk/gui/wxpython/wxplot/dialogs.py 2013-02-04 14:20:45 UTC (rev 54896)
@@ -360,7 +360,11 @@
if self.groupRadio.GetValue() == True:
self.rselection.Disable()
else:
- if len(self.rasterList) > 0: self.rselection.SetValue(self.rasterList[0])
+ rastText = ''
+ for r in self.rasterList:
+ rastText += '%s,' % r
+ rastText = rastText.rstrip(',')
+ self.rselection.SetValue(rastText)
box.Add(item = self.rselection, pos = (1, 1))
#
Modified: grass/trunk/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/histogram.py 2013-02-04 13:47:38 UTC (rev 54895)
+++ grass/trunk/gui/wxpython/wxplot/histogram.py 2013-02-04 14:20:45 UTC (rev 54896)
@@ -115,7 +115,12 @@
if self.maptype == 'group':
self.ptitle = _('Histogram of %s') % self.group.split('@')[0]
else:
- self.ptitle = _('Histogram of %s') % self.rasterList[0].split('@')[0]
+ rastText = ''
+ for r in self.rasterList:
+ rs = r.split('@')[0]
+ rastText += '%s, ' % rs
+ rastText = rastText.rstrip(', ')
+ self.ptitle = _('Histogram of %s') % rastText
#
More information about the grass-commit
mailing list