瀏覽代碼

wxGUI/mapdisp: improving handling of zoom history

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57079 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 年之前
父節點
當前提交
e88c2efdf9
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      gui/wxpython/mapdisp/mapwindow.py

+ 22 - 0
gui/wxpython/mapdisp/mapwindow.py

@@ -1524,6 +1524,8 @@ class BufferedWindow(MapWindow, wx.Window):
         Emits zoomChanged signal.
         Emits zoomHistoryUnavailable signal when stack is empty.
         """
+        Debug.msg(4, "BufferedWindow.ZoomBack(): hist)=%s" % self.zoomhistory)
+
         zoom = list()
         
         if len(self.zoomhistory) > 1:
@@ -1579,6 +1581,26 @@ class BufferedWindow(MapWindow, wx.Window):
         
         return removed
 
+    def InitZoomHistory(self):
+        """Initializes zoom history.
+
+        @todo First item is handled in some special way. Improve the
+        documentation or fix the code.
+
+        It does not emits any signals.
+
+        This method can be possibly removed when the history will solve the
+        fist item in different way or when GCP manager (and possibly others)
+        will handle Map variable in the way that it will be prepared for
+        MapWindow/BufferedWindow and thus usable to initialize history.
+        """
+        self.zoomhistory.append((self.Map.region['n'],
+                                 self.Map.region['s'],
+                                 self.Map.region['e'],
+                                 self.Map.region['w']))
+        Debug.msg(4, "BufferedWindow.InitZoomHistory(): hist=%s" %
+                  (self.zoomhistory))
+
     def ResetZoomHistory(self):
         """!Reset zoom history"""
         self.zoomhistory = list()