浏览代码

wxNviz: fix minor issues with legend overlay

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57422 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 年之前
父节点
当前提交
179bdc54cc
共有 2 个文件被更改,包括 11 次插入4 次删除
  1. 6 4
      gui/wxpython/gui_core/dialogs.py
  2. 5 0
      gui/wxpython/mapdisp/frame.py

+ 6 - 4
gui/wxpython/gui_core/dialogs.py

@@ -614,9 +614,7 @@ class DecorationDialog(wx.Dialog):
         if found:
             # enable 'OK' and 'Resize' button
             self.btnOK.Enable()
-            if not self.parent.IsPaneShown('3d'):
-                self.resizeBtn.Enable()
-            
+
             # set title
             self.SetTitle(_('Legend of raster map <%s>') % \
                               mapName)
@@ -705,7 +703,11 @@ class DecorationDialog(wx.Dialog):
             if self._ddstyle == DECOR_DIALOG_LEGEND and not self.parent.IsPaneShown('3d'):
                 self.resizeBtn.Enable()
 
-
+    def Show(self, show=True):
+        if show:
+            self.resizeBtn.Enable(not self.parent.IsPaneShown('3d'))
+        wx.Dialog.Show(self, show)
+        
 class TextLayerDialog(wx.Dialog):
     """
     Controls setting options and displaying/hiding map overlay decorations

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

@@ -365,6 +365,8 @@ class MapFrame(SingleMapFrame):
             for page in ('view', 'light', 'fringe', 'constant', 'cplane', 'animation'):
                 self._layerManager.nviz.UpdatePage(page)
                 
+        self._giface.updateMap.disconnect(self.MapWindow2D.UpdateMap)
+        self._giface.updateMap.connect(self.MapWindow3D.UpdateMap)
         self.MapWindow3D.overlays = self.MapWindow2D.overlays
         self.MapWindow3D.textdict = self.MapWindow2D.textdict
         # update overlays needs to be called after because getClientSize
@@ -403,6 +405,9 @@ class MapFrame(SingleMapFrame):
             self.MapWindow2D.textdict = self.MapWindow3D.textdict
         except AttributeError:
             pass
+        self._giface.updateMap.disconnect(self.MapWindow3D.UpdateMap)
+        self._giface.updateMap.connect(self.MapWindow2D.UpdateMap)
+
         self.MapWindow.UpdateMap()
         self._mgr.Update()