Przeglądaj źródła

wxGUI/wxplot: fix a few issues related to wxPython 3 (merged from trunk, https://trac.osgeo.org/grass/changeset/59783)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@59784 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 lat temu
rodzic
commit
0efc88e8e9

+ 1 - 3
gui/wxpython/wxplot/base.py

@@ -443,12 +443,10 @@ class BasePlotFrame(wx.Frame):
     def OnMotion(self, event):
         """!Indicate when mouse is outside the plot area
         """
-        if self.client.OnLeave(event): print 'out of area'
-        #show closest point (when enbled)
         if self.client.GetEnablePointLabel() == True:
             #make up dict with info for the pointLabel
             #I've decided to mark the closest point on the closest curve
-            dlst =  self.client.GetClosetPoint( self.client._getXY(event), pointScaled =  True)
+            dlst = self.client.GetClosestPoint(self.client._getXY(event), pointScaled=True)
             if dlst != []:      #returns [] if none
                 curveNum, legend, pIndex, pointXY, scaledXY, distance = dlst
                 #make up dictionary to pass to my user function (see DrawPointLabel)

+ 2 - 3
gui/wxpython/wxplot/dialogs.py

@@ -99,8 +99,7 @@ class ProfileRasterDialog(wx.Dialog):
     def OnSelection(self, event):
         """!Choose maps to profile. Convert these into a list
         """
-        self.rasterList = []
-        self.rasterList = event.GetString().split(',')
+        self.rasterList = self.FindWindowById(event.GetId()).GetValue().split(',')
 
 class ScatterRasterDialog(wx.Dialog):
     def __init__(self, parent, id = wx.ID_ANY, 
@@ -207,7 +206,7 @@ class ScatterRasterDialog(wx.Dialog):
     def OnSelection(self, event):
         """!Select raster maps for scatterplot. Must select maps in pairs.
         """
-        self.rasterList = event.GetString().split(',', 1)
+        self.rasterList = self.FindWindowById(event.GetId()).GetValue().split(',', 1)
         
     def OnSetBins(self, event):
         """!Bins for histogramming FP maps (=nsteps in r.stats)

+ 1 - 1
gui/wxpython/wxplot/profile.py

@@ -120,7 +120,7 @@ class ProfileFrame(BasePlotFrame):
         """!Select raster map(s) to profile
         """
         dlg = ProfileRasterDialog(parent = self)
-
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_OK:
             self.rasterList = dlg.rasterList
             self.raster = self.InitRasterOpts(self.rasterList, self.plottype)

+ 1 - 1
gui/wxpython/wxplot/scatter.py

@@ -88,7 +88,7 @@ class ScatterFrame(BasePlotFrame):
         """!Select raster map(s) to profile
         """
         dlg = ScatterRasterDialog(parent = self)
-
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_OK:
             self.rasterList = dlg.GetRasterPairs()
             if not self.rasterList: