Bladeren bron

wxGUI/mapwindow: unused parameters removed, depreciation warnings added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57385 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 jaren geleden
bovenliggende
commit
865fd8fc3c
3 gewijzigde bestanden met toevoegingen van 16 en 11 verwijderingen
  1. 13 5
      gui/wxpython/gui_core/mapwindow.py
  2. 1 2
      gui/wxpython/mapdisp/mapwindow.py
  3. 2 4
      gui/wxpython/nviz/mapwindow.py

+ 13 - 5
gui/wxpython/gui_core/mapwindow.py

@@ -103,10 +103,9 @@ class MapWindow(object):
      - Pixel2Cell
      - Cell2Pixel (if it is possible)
     """
-    def __init__(self, parent, giface, Map, frame, **kwargs):
+    def __init__(self, parent, giface, Map):
         self.parent = parent
         self.Map = Map
-        self.frame = frame
         self._giface = giface
         
         # mouse attributes -- position on the screen, begin and end of
@@ -174,7 +173,12 @@ class MapWindow(object):
 
     def RegisterMouseEventHandler(self, event, handler, cursor = None):
         """!Binds event handler
-        
+
+        @depreciated This method is depreciated. Use Signals or drawing API instead.
+        Signals do not cover all events but new Signals can be added when needed
+        consider also adding generic signal. However, more interesing and useful
+        is higher level API to create objects, graphics etc.
+
         Call event.Skip() in handler to allow default processing in MapWindow.
 
         If any error occures inside of handler, the handler is removed.
@@ -226,6 +230,8 @@ class MapWindow(object):
     def UnregisterAllHandlers(self):
         """!Unregisters all registered handlers 
 
+        @depreciated This method is depreciated. Use Signals or drawing API instead.
+
         Before each handler is unregistered it is called with string
         value "unregistered" of event parameter.
         """
@@ -242,7 +248,9 @@ class MapWindow(object):
         
     def UnregisterMouseEventHandler(self, event, handler):
         """!Unbinds event handler for event
-        
+
+        @depreciated This method is depreciated. Use Signals or drawing API instead.
+
         Before handler is unregistered it is called with string value
         "unregistered" of event parameter.
 
@@ -301,7 +309,7 @@ class MapWindow(object):
     def GetLastEN(self):
         """!Returns last coordinates of mouse cursor.
 
-        This method is depreciated.
+        @depreciated This method is depreciated. Use Signal with coordinates as parameters.
 
         @see OnMotion
         """

+ 1 - 2
gui/wxpython/mapdisp/mapwindow.py

@@ -67,8 +67,7 @@ class BufferedWindow(MapWindow, wx.Window):
         @param style wx window style
         @param kwargs keyword arguments passed to MapWindow and wx.Window
         """
-        MapWindow.__init__(self, parent = parent, giface = giface, Map = Map,
-                           frame = frame, **kwargs)
+        MapWindow.__init__(self, parent=parent, giface=giface, Map=Map)
         wx.Window.__init__(self, parent = parent, id = id, style = style, **kwargs)
 
         self._properties = properties

+ 2 - 4
gui/wxpython/nviz/mapwindow.py

@@ -86,10 +86,8 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
             glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
         else:
             glcanvas.GLCanvas.__init__(self, parent, id)
-        
-            
-        MapWindow.__init__(self, parent = parent, giface = giface, frame = frame,
-                           Map = Map)
+
+        MapWindow.__init__(self, parent=parent, giface=giface, Map=Map)
         self.Hide()
         
         self.init = False