[GRASS-SVN] r53027 - grass/trunk/gui/wxpython/wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 31 10:24:43 PDT 2012
Author: cmbarton
Date: 2012-08-31 10:24:43 -0700 (Fri, 31 Aug 2012)
New Revision: 53027
Modified:
grass/trunk/gui/wxpython/wxplot/base.py
grass/trunk/gui/wxpython/wxplot/dialogs.py
Log:
Fixes for plotting modules
Modified: grass/trunk/gui/wxpython/wxplot/base.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/base.py 2012-08-31 17:14:22 UTC (rev 53026)
+++ grass/trunk/gui/wxpython/wxplot/base.py 2012-08-31 17:24:43 UTC (rev 53027)
@@ -123,10 +123,7 @@
def InitPlotOpts(self, plottype):
"""!Initialize options for entire plot
- """
-
- ## change get more saved values for initialization
-
+ """
self.plottype = plottype # histogram, profile, or scatter
self.properties = {} # plot properties
@@ -183,8 +180,6 @@
"""
rdict = {} # initialize a dictionary
-
-# self.properties['raster'] = {}
self.properties['raster'] = UserSettings.Get(group = self.plottype, key = 'raster')
for r in rasterList:
@@ -208,8 +203,6 @@
rdict[r]['pline'] = None
rdict[r]['datatype'] = ret['datatype']
-## change init with saved values
-
#
#initialize with saved values
#
@@ -248,8 +241,6 @@
if len(rasterList) == 0: return
-## change to init with saved values
-
rdict = {} # initialize a dictionary
for rpair in rasterList:
idx = rasterList.index(rpair)
@@ -317,8 +308,6 @@
self.client.SetEnableZoom(self.zoom)
self.client.SetEnableDrag(self.drag)
-## change - changed order so that grid settings go last and axis go first
-
#
# axis settings
#
@@ -510,8 +499,6 @@
self.ptitle = dlg.ptitle
self.xlabel = dlg.xlabel
self.ylabel = dlg.ylabel
-## change these are redundant and can cause problems
-# dlg.UpdateSettings()
self.client.SetFont(self.properties['font']['wxfont'])
self.client.SetFontSizeTitle(self.properties['font']['prop']['titleSize'])
@@ -522,7 +509,6 @@
self.plot.setXLabel(dlg.xlabel)
self.plot.setYLabel(dlg.ylabel)
-# dlg.OnSave()
self.OnRedraw(event = None)
def PlotText(self, event):
@@ -532,11 +518,8 @@
plottype = self.plottype,
title = _('Histogram text settings'))
-## change to work correctly
-
btnval = dlg.ShowModal()
if btnval == wx.ID_SAVE or btnval == wx.ID_OK or btnval == wx.ID_CANCEL:
-# self.OnPlotText(dlg)
dlg.Destroy()
@@ -551,14 +534,7 @@
title = _('Plot settings'))
btnval = dlg.ShowModal()
-## change buttons to be like text options
-
if btnval == wx.ID_SAVE or btnval == wx.ID_OK or btnval == wx.ID_CANCEL:
-
-## change these are redundant and can cause problems
-
-# dlg.UpdateSettings()
-# self.SetGraphStyle()
dlg.Destroy()
def PrintMenu(self, event):
Modified: grass/trunk/gui/wxpython/wxplot/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/dialogs.py 2012-08-31 17:14:22 UTC (rev 53026)
+++ grass/trunk/gui/wxpython/wxplot/dialogs.py 2012-08-31 17:24:43 UTC (rev 53027)
@@ -381,7 +381,6 @@
#
# Nsteps for FP maps and histogram type selection
#
-
label = wx.StaticText(parent = self, id = wx.ID_ANY,
label = _("Number of bins (for FP maps)"))
box.Add(item = label,
@@ -1112,24 +1111,12 @@
btnCancel = wx.Button(self, wx.ID_CANCEL)
btnOk.SetDefault()
-# btnSave = wx.Button(self, wx.ID_SAVE)
-# btnApply = wx.Button(self, wx.ID_APPLY)
-# btnCancel = wx.Button(self, wx.ID_CANCEL)
-# btnSave.SetDefault()
-
# tooltips for buttons
btnApply.SetToolTipString(_("Apply changes for the current session"))
btnOk.SetToolTipString(_("Apply changes for the current session and close dialog"))
btnSave.SetToolTipString(_("Apply and save changes to user settings file (default for next sessions)"))
btnCancel.SetToolTipString(_("Close dialog and ignore changes"))
-
-# btnApply.SetToolTipString(_("Apply changes for the current session"))
-# btnSave.SetToolTipString(_("Apply and save changes to user settings file (default for next sessions)"))
-# btnSave.SetDefault()
-# btnCancel.SetToolTipString(_("Close dialog and ignore changes"))
-
-
# sizers
btnStdSizer = wx.StdDialogButtonSizer()
btnStdSizer.AddButton(btnOk)
@@ -1142,41 +1129,10 @@
btnSizer.Add(item = btnStdSizer, proportion = 0, flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
sizer.Add(item = btnSizer, proportion = 0, flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
-
-# # sizers
-# btnStdSizer = wx.StdDialogButtonSizer()
-# btnStdSizer.AddButton(btnCancel)
-# btnStdSizer.AddButton(btnSave)
-# btnStdSizer.AddButton(btnApply)
-# btnStdSizer.Realize()
-
-# sizer.Add(item = btnStdSizer, proportion = 0, flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
-
#
# bindings for buttons and map plot settings controls
#
self.mapchoice.Bind(wx.EVT_CHOICE, self.OnSetMap)
-
-## change
- # Bindings not needed. Will update with OnApply
-# if self.plottype != 'scatter':
-# color.Bind(csel.EVT_COLOURSELECT, self.OnSetOpt)
-# width.Bind(wx.EVT_SPINCTRL, self.OnSetOpt)
-# style.Bind(wx.EVT_CHOICE, self.OnSetOpt)
-# legend.Bind(wx.EVT_TEXT, self.OnSetOpt)
-
-# if self.plottype != 'histogram':
-# ptcolor.Bind(csel.EVT_COLOURSELECT, self.OnSetOpt)
-# ptsize.Bind(wx.EVT_SPINCTRL, self.OnSetOpt)
-# ptfill.Bind(wx.EVT_CHOICE, self.OnSetOpt)
-# ptlegend.Bind(wx.EVT_TEXT, self.OnSetOpt)
-# pttype.Bind(wx.EVT_CHOICE, self.OnSetOpt)
-
-# btnApply.Bind(wx.EVT_BUTTON, self.OnApply)
-# btnSave.Bind(wx.EVT_BUTTON, self.OnSave)
-# btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel)
-
- # bindings
btnApply.Bind(wx.EVT_BUTTON, self.OnApply)
btnOk.Bind(wx.EVT_BUTTON, self.OnOk)
btnOk.SetDefault()
@@ -1216,15 +1172,8 @@
p = self.parent.CreatePlotList()
self.parent.DrawPlot(p)
-## change if clause not relevant
-# if self.parent.plot:
-# p = self.parent.CreatePlotList()
-# self.parent.DrawPlot(p)
-
def UpdateSettings(self):
"""!Apply settings to each map and to entire plot"""
-## change updating properties for pcolor, pwidth, pstyle, psize, ptype, pfill
- # update plot settings for selected map
self.raster[self.map]['pcolor'] = self.FindWindowById(self.wxId['pcolor']).GetColour()
self.properties['raster']['pcolor'] = self.raster[self.map]['pcolor']
@@ -1282,12 +1231,7 @@
self.parent.SetGraphStyle()
p = self.parent.CreatePlotList()
self.parent.DrawPlot(p)
-##change
-# if self.parent.plot:
-# p = self.parent.CreatePlotList()
-# self.parent.DrawPlot(p)
-
def OnOk(self, event):
"""!Button 'OK' pressed"""
self.OnApply(None)
More information about the grass-commit
mailing list