瀏覽代碼

wxGUI: save showing/hiding toolbar or statusbar of map displays in workspace

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70545 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 年之前
父節點
當前提交
04280ddd61
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 6 0
      gui/wxpython/core/workspace.py
  2. 5 0
      gui/wxpython/lmgr/frame.py

+ 6 - 0
gui/wxpython/core/workspace.py

@@ -160,6 +160,8 @@ class ProcessWorkspaceFile:
                 "render": bool(int(display.get('render', "0"))),
                 "render": bool(int(display.get('render', "0"))),
                 "mode": int(display.get('mode', 0)),
                 "mode": int(display.get('mode', 0)),
                 "showCompExtent": bool(int(display.get('showCompExtent', "0"))),
                 "showCompExtent": bool(int(display.get('showCompExtent', "0"))),
+                "showStatusbar": bool(int(display.get('showStatusbar', "0"))),
+                "showToolbars": bool(int(display.get('showToolbars', "0"))),
                 "pos": pos,
                 "pos": pos,
                 "size": size,
                 "size": size,
                 "extent": extent,
                 "extent": extent,
@@ -848,6 +850,8 @@ class WriteWorkspaceFile(object):
                        'mode="%d" showCompExtent="%d" '
                        'mode="%d" showCompExtent="%d" '
                        'alignExtent="%d" '
                        'alignExtent="%d" '
                        'constrainRes="%d" '
                        'constrainRes="%d" '
+                       'showStatusbar="%d" '
+                       'showToolbars="%d" '
                        'dim="%d,%d,%d,%d" '
                        'dim="%d,%d,%d,%d" '
                        'extent="%f,%f,%f,%f,%f,%f" '
                        'extent="%f,%f,%f,%f,%f,%f" '
                        'tbres="%f" '  # needed only for animation tool
                        'tbres="%f" '  # needed only for animation tool
@@ -858,6 +862,8 @@ class WriteWorkspaceFile(object):
                                               int(mapdisp.mapWindowProperties.showRegion),
                                               int(mapdisp.mapWindowProperties.showRegion),
                                               int(mapdisp.mapWindowProperties.alignExtent),
                                               int(mapdisp.mapWindowProperties.alignExtent),
                                               int(mapdisp.mapWindowProperties.resolution),
                                               int(mapdisp.mapWindowProperties.resolution),
+                                              int(mapdisp.statusbarManager.IsShown()),
+                                              int(mapdisp.GetMapToolbar().IsShown()),
                                               displayPos[0],
                                               displayPos[0],
                                               displayPos[1],
                                               displayPos[1],
                                               displaySize[0],
                                               displaySize[0],

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

@@ -1454,6 +1454,11 @@ class GMFrame(wx.Frame):
                                                 region['s'],
                                                 region['s'],
                                                 region['e'],
                                                 region['e'],
                                                 region['w'])
                                                 region['w'])
+            if 'showStatusbar' in display and not display['showStatusbar']:
+                mapdisp.statusbarManager.Show(False)
+            if 'showToolbars' in display and not display['showToolbars']:
+                for toolbar in mapdisp.GetToolbarNames():
+                    mapdisp.RemoveToolbar(toolbar)
 
 
             displayId += 1
             displayId += 1
             mapdisp.Show()  # show mapdisplay
             mapdisp.Show()  # show mapdisplay