[GRASS-SVN] r48592 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 1 17:48:11 EDT 2011
Author: martinl
Date: 2011-10-01 14:48:11 -0700 (Sat, 01 Oct 2011)
New Revision: 48592
Modified:
grass/trunk/gui/wxpython/gui_modules/layertree.py
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/gui_modules/wxplot.py
Log:
wxGUI: clean up ProfileFrame and HistFrame constructors
Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-10-01 21:37:09 UTC (rev 48591)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-10-01 21:48:11 UTC (rev 48592)
@@ -46,12 +46,12 @@
import render
import histogram
import utils
-import profile
-from debug import Debug as Debug
-from icon import Icons as Icons
+from wxplot import ProfileFrame
+from debug import Debug
+from icon import Icons
from preferences import globalSettings as UserSettings
-from vdigit import haveVDigit
-from gcmd import GWarning
+from vdigit import haveVDigit
+from gcmd import GWarning
TREE_ITEM_HEIGHT = 25
@@ -521,9 +521,8 @@
self.profileFrame = self.mapdisplay.profile
if not self.profileFrame:
- self.profileFrame = profile.ProfileFrame(self.mapdisplay,
- id = wx.ID_ANY, pos = wx.DefaultPosition, size = (700,300),
- style = wx.DEFAULT_FRAME_STYLE, rasterList = [mapLayer.GetName()])
+ self.profileFrame = ProfileFrame(parent = self.mapdisplay,
+ rasterList = [mapLayer.GetName()])
# show new display
self.profileFrame.Show()
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2011-10-01 21:37:09 UTC (rev 48591)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2011-10-01 21:48:11 UTC (rev 48592)
@@ -1645,10 +1645,8 @@
self.tree.GetPyData(self.tree.layer_selected)[0]['type'] == 'raster':
raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
- self.profile = ProfileFrame(self,
- id = wx.ID_ANY, pos = wx.DefaultPosition, size = (700,300),
- style = wx.DEFAULT_FRAME_STYLE,
- rasterList = raster)
+ self.profile = ProfileFrame(parent = self,
+ rasterList = raster)
self.profile.Show()
# Open raster select dialog to make sure that a raster (and the desired raster)
# is selected to be profiled
@@ -1715,10 +1713,8 @@
continue
raster.append(self.tree.GetPyData(layer)[0]['maplayer'].GetName())
- self.histogramPyPlot = HistFramePyPlot(self, id = wx.ID_ANY,
- pos = wx.DefaultPosition, size = (700,300),
- style = wx.DEFAULT_FRAME_STYLE,
- rasterList = raster)
+ self.histogramPyPlot = HistFramePyPlot(parent = self,
+ rasterList = raster)
self.histogramPyPlot.Show()
# Open raster select dialog to make sure that a raster (and the desired raster)
# is selected to be histogrammed
Modified: grass/trunk/gui/wxpython/gui_modules/wxplot.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxplot.py 2011-10-01 21:37:09 UTC (rev 48591)
+++ grass/trunk/gui/wxpython/gui_modules/wxplot.py 2011-10-01 21:48:11 UTC (rev 48592)
@@ -48,7 +48,7 @@
class AbstractPlotFrame(wx.Frame):
"""!Abstract PyPlot display frame class"""
- def __init__(self, parent = None, id = wx.ID_ANY, title='', size = (700, 300),
+ def __init__(self, parent, id = wx.ID_ANY, title = '', size = (700, 400),
style = wx.DEFAULT_FRAME_STYLE, rasterList = [], **kwargs):
wx.Frame.__init__(self, parent, id, title, size = size, style = style, **kwargs)
@@ -497,11 +497,12 @@
self.Destroy()
class HistFrame(AbstractPlotFrame):
- def __init__(self, parent, id, pos, style, size,
- title = _("GRASS Histogramming Tool"), rasterList = []):
+ def __init__(self, parent, title = _("GRASS Histogramming Tool"),
+ rasterList = [], **kwargs):
"""!Mainframe for displaying histogram of raster map. Uses wx.lib.plot.
"""
- AbstractPlotFrame.__init__(self, parent)
+ AbstractPlotFrame.__init__(self, parent, title = title,
+ rasterList = rasterList, **kwargs)
self.toolbar = Histogram2Toolbar(parent = self)
self.SetToolBar(self.toolbar)
@@ -678,10 +679,11 @@
class ProfileFrame(AbstractPlotFrame):
"""!Mainframe for displaying profile of one or more raster maps. Uses wx.lib.plot.
"""
- def __init__(self, parent, id, pos, style, size,
- title = _("GRASS Profile Analysis Tool"), rasterList = []):
+ def __init__(self, parent, title = _("GRASS Profile Analysis Tool"),
+ rasterList = [], **kwargs):
- AbstractPlotFrame.__init__(self, parent)
+ AbstractPlotFrame.__init__(self, parent, title = title,
+ rasterList = rasterList, **kwargs)
self.toolbar = ProfileToolbar(parent = self)
self.SetToolBar(self.toolbar)
More information about the grass-commit
mailing list