[GRASS-SVN] r48404 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 22 02:11:56 EDT 2011
Author: cmbarton
Date: 2011-09-21 23:11:56 -0700 (Wed, 21 Sep 2011)
New Revision: 48404
Modified:
grass/trunk/gui/wxpython/gui_modules/histogram2.py
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/gui_modules/preferences.py
Log:
wxGUI: enabling automatic selection of map from layer tree for histogramming
Modified: grass/trunk/gui/wxpython/gui_modules/histogram2.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/histogram2.py 2011-09-22 05:19:24 UTC (rev 48403)
+++ grass/trunk/gui/wxpython/gui_modules/histogram2.py 2011-09-22 06:11:56 UTC (rev 48404)
@@ -617,17 +617,10 @@
def OnCloseWindow(self, event):
"""
- Close profile window and clean up
+ Close histogram window and clean up
"""
- self.mapwin.ClearLines()
- self.mapwin.mouse['begin'] = self.mapwin.mouse['end'] = (0.0, 0.0)
- self.mapwin.mouse['use'] = 'pointer'
- self.mapwin.mouse['box'] = 'point'
- self.mapwin.polycoords = []
- self.mapwin.SetCursor(self.Parent.cursors["default"])
- self.mapwin.UpdateMap(render=False, renderVector=False)
-
+ self.mapwin.SetCursor(self.Parent.cursors["default"])
self.Destroy()
class SetRasterDialog(wx.Dialog):
@@ -1385,4 +1378,4 @@
def OnCancel(self, event):
"""!Button 'Cancel' pressed"""
self.Close()
-
+
\ No newline at end of file
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2011-09-22 05:19:24 UTC (rev 48403)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2011-09-22 06:11:56 UTC (rev 48404)
@@ -1705,16 +1705,20 @@
return (outdist, outunits)
def Histogram(self, event):
- """!Init histogram display canvas and tools
+ """!Init PyPlot histogram display canvas and tools
"""
- self.histogram = histogram.HistFrame(self,
- id = wx.ID_ANY, size = globalvar.HIST_WINDOW_SIZE,
- style = wx.DEFAULT_FRAME_STYLE)
+ raster = []
+ if self.tree.layer_selected and \
+ self.tree.GetPyData(self.tree.layer_selected)[0]['type'] == 'raster':
+ raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
- #show new display
- self.histogram.Show()
- self.histogram.Refresh()
- self.histogram.Update()
+ self.histogram2 = histogram2.HistFrame(self,
+ id = wx.ID_ANY, pos = wx.DefaultPosition, size = (700,300),
+ style = wx.DEFAULT_FRAME_STYLE, rasterList = raster)
+ self.histogram2.Show()
+ # Open raster select dialog to make sure that a raster (and the desired raster)
+ # is selected to be histogrammed
+ self.histogram2.OnSelectRaster(None)
def Histogram2(self, event):
"""!Init histogram display canvas and tools
Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py 2011-09-22 05:19:24 UTC (rev 48403)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py 2011-09-22 06:11:56 UTC (rev 48404)
@@ -447,7 +447,7 @@
},
'histogram': {
'raster' : {
- 'pcolor' : (0, 0, 0, 255), # line color
+ 'pcolor' : (0, 0, 255, 255), # line color
'pwidth' : 1, # line width
'pstyle' : 'solid', # line pen style
'datatype' : 'cell', # raster type
More information about the grass-commit
mailing list