Просмотр исходного кода

wxGUI: remove frame parameter from BufferedWindow

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57424 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 лет назад
Родитель
Сommit
37bded6609

+ 2 - 2
gui/wxpython/gcp/mapdisplay.py

@@ -116,12 +116,12 @@ class MapFrame(SingleMapFrame):
         self.grwiz.SwitchEnv('source')
         self.SrcMapWindow = BufferedWindow(parent=self, giface=self._giface, id=wx.ID_ANY,
                                            properties=self.mapWindowProperties,
-                                           Map=self.SrcMap, frame=self)
+                                           Map=self.SrcMap)
 
         self.grwiz.SwitchEnv('target')
         self.TgtMapWindow = BufferedWindow(parent=self, giface=self._giface, id=wx.ID_ANY,
                                            properties=self.mapWindowProperties,
-                                          Map=self.TgtMap, frame=self)
+                                          Map=self.TgtMap)
         self.MapWindow = self.SrcMapWindow
         self.Map = self.SrcMap
         self._setUpMapWindow(self.SrcMapWindow)

+ 2 - 2
gui/wxpython/iclass/digit.py

@@ -34,7 +34,7 @@ import grass.script as grass
 
 class IClassVDigitWindow(VDigitWindow):
     """! Class similar to VDigitWindow but specialized for wxIClass."""
-    def __init__(self, parent, giface, map, frame, properties):
+    def __init__(self, parent, giface, map, properties):
         """!
         
         @a parent should has toolbar providing current class (category).
@@ -43,7 +43,7 @@ class IClassVDigitWindow(VDigitWindow):
         @param map map renderer instance
         """
         VDigitWindow.__init__(self, parent=parent, giface=giface,
-                              Map=map, frame=frame, properties=properties)
+                              Map=map, properties=properties)
 
     def _onLeftDown(self, event):
         action = self.toolbar.GetAction()

+ 2 - 2
gui/wxpython/iclass/frame.py

@@ -95,10 +95,10 @@ class IClassMapFrame(DoubleMapFrame):
 
         self.firstMapWindow = IClassVDigitWindow(parent = self, giface = self._giface,
                                                  properties=self.mapWindowProperties,
-                                                 map = self.firstMap, frame = self)
+                                                 map = self.firstMap)
         self.secondMapWindow = BufferedWindow(parent = self, giface = self._giface,
                                               properties=self.mapWindowProperties,
-                                              Map = self.secondMap, frame = self)
+                                              Map = self.secondMap)
         self.MapWindow = self.firstMapWindow # current by default
         
         self._bindWindowsActivation()

+ 5 - 6
gui/wxpython/mapdisp/frame.py

@@ -154,8 +154,8 @@ class MapFrame(SingleMapFrame):
         #
         # Init map display (buffered DC & set default cursor)
         #
-        self.MapWindow2D = BufferedWindow(self, giface = self._giface, id = wx.ID_ANY,
-                                          Map=self.Map, frame=self,
+        self.MapWindow2D = BufferedWindow(self, giface = self._giface,
+                                          Map=self.Map,
                                           properties=self.mapWindowProperties,
                                           overlays=self.decorations)
         self.MapWindow2D.mapQueried.connect(self.Query)
@@ -244,11 +244,10 @@ class MapFrame(SingleMapFrame):
         
         if not self.MapWindowVDigit:
             from vdigit.mapwindow import VDigitWindow
-            self.MapWindowVDigit = VDigitWindow(parent = self, giface = self._giface,
-                                                id = wx.ID_ANY, frame = self,
-                                                Map = self.Map, tree = self.tree,
+            self.MapWindowVDigit = VDigitWindow(parent=self, giface=self._giface,
                                                 properties=self.mapWindowProperties,
-                                                lmgr = self._layerManager,
+                                                Map=self.Map, tree=self.tree,
+                                                lmgr=self._layerManager,
                                                 overlays=self.decorations)
             self._setUpMapWindow(self.MapWindowVDigit)
             self.MapWindowVDigit.digitizingInfo.connect(

+ 3 - 4
gui/wxpython/mapdisp/mapwindow.py

@@ -57,23 +57,22 @@ class BufferedWindow(MapWindow, wx.Window):
     can also save the drawing to file by calling the
     SaveToFile() method.
     """
-    def __init__(self, parent, giface, Map, frame, properties,
+    def __init__(self, parent, giface, Map, properties,
                  id=wx.ID_ANY, overlays=None,
                  style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
         """!
         @param parent parent window
         @param giface grass interface instance
         @param Map map instance
-        @param frame map frame instance (to be removed)
+        @param properties instance of MapWindowProperties
         @param id wx window id
         @param style wx window style
         @param kwargs keyword arguments passed to MapWindow and wx.Window
         """
         MapWindow.__init__(self, parent=parent, giface=giface, Map=Map)
-        wx.Window.__init__(self, parent = parent, id = id, style = style, **kwargs)
+        wx.Window.__init__(self, parent=parent, id=id, style=style, **kwargs)
 
         self._properties = properties
-        self.frame = frame  # remove including a frame parameter
 
         # flags
         self.resize = False # indicates whether or not a resize event has taken place

+ 4 - 4
gui/wxpython/mapdisp/test_mapdisp.py

@@ -175,7 +175,7 @@ class Tester(object):
         width, height = self.frame.GetClientSize()
         copyOfInitMap(map_, width, height)
         window = BufferedWindow(parent=panel, giface=giface, Map=map_,
-                                properties=mapWindowProperties, frame=self.frame)
+                                properties=mapWindowProperties)
         sizer.Add(item=window, proportion=1, flag=wx.EXPAND | wx.ALL, border=5)
         panel.SetSizer(sizer)
         panel.Layout()
@@ -205,7 +205,7 @@ class Tester(object):
         width, height = self.frame.GetClientSize()
         copyOfInitMap(map_, width, height)
         window = BufferedWindow(parent=panel, giface=giface, Map=map_,
-                                properties=mapWindowProperties, frame=self.frame)
+                                properties=mapWindowProperties)
 
         giface.mapWindow = window
 
@@ -235,7 +235,7 @@ class Tester(object):
         width, height = self.frame.GetClientSize()
         copyOfInitMap(map_, width, height)
         window = BufferedWindow(parent=panel, giface=giface, Map=map_,
-                                properties=mapWindowProperties, frame=self.frame)
+                                properties=mapWindowProperties)
 
         giface.mapWindow = window
 
@@ -266,7 +266,7 @@ class Tester(object):
         width, height = self.frame.GetClientSize()
         copyOfInitMap(map_, width, height)
         window = BufferedWindow(parent=panel, giface=giface, Map=map_,
-                                properties=mapWindowProperties, frame=self.frame)
+                                properties=mapWindowProperties)
 
         giface.mapWindow = window
 

+ 2 - 2
gui/wxpython/mapswipe/frame.py

@@ -66,10 +66,10 @@ class SwipeMapFrame(DoubleMapFrame):
         self.mapWindowProperties.autoRenderChanged.connect(self.OnAutoRenderChanged)
         self.firstMapWindow = SwipeBufferedWindow(parent = self.splitter, giface = self._giface,
                                                   properties=self.mapWindowProperties,
-                                                  Map = self.firstMap, frame = self)
+                                                  Map = self.firstMap)
         self.secondMapWindow = SwipeBufferedWindow(parent = self.splitter, giface = self._giface,
                                                    properties=self.mapWindowProperties,
-                                                   Map = self.secondMap, frame = self)
+                                                   Map = self.secondMap)
         self.MapWindow = self.firstMapWindow # current by default
         self.firstMapWindow.zoomhistory = self.secondMapWindow.zoomhistory
         self.SetBindRegions(True)

+ 2 - 3
gui/wxpython/mapswipe/mapwindow.py

@@ -36,9 +36,8 @@ class SwipeBufferedWindow(BufferedWindow):
     Enables to draw the image translated.
     Special mouse events with changed coordinates are used.
     """
-    def __init__(self, parent, giface, Map, properties, frame, **kwargs):
-        BufferedWindow.__init__(self, parent = parent, giface = giface,
-                                Map=Map, frame=frame,
+    def __init__(self, parent, giface, Map, properties, **kwargs):
+        BufferedWindow.__init__(self, parent=parent, giface=giface, Map=Map, 
                                 properties=properties, **kwargs)
         Debug.msg(2, "SwipeBufferedWindow.__init__()")
 

+ 3 - 3
gui/wxpython/vdigit/mapwindow.py

@@ -32,12 +32,12 @@ from gui_core       import gselect
 class VDigitWindow(BufferedWindow):
     """!A Buffered window extended for vector digitizer.
     """
-    def __init__(self, parent, giface, Map, frame, properties, tree=None,
+    def __init__(self, parent, giface, Map, properties, tree=None,
                  id=wx.ID_ANY, lmgr=None,
                  style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
-        BufferedWindow.__init__(self, parent = parent, giface = giface, id = id, Map = Map,
+        BufferedWindow.__init__(self, parent=parent, giface=giface, Map=Map,
                                 properties=properties,
-                                frame=frame, style=style, **kwargs)
+                                style=style, **kwargs)
         self.lmgr = lmgr
         self.tree = tree
         self.pdcVector = wx.PseudoDC()