Browse Source

wxGUI: show computation region extent in mapdisp from lmgr menu

It is now next to the textual g.region outputs in the menu
and it is easier to describe where to find it.
It behaves like the checkbox in Map Display and
it changes the checkbox (the properties object takes care of it).


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71305 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 7 năm trước cách đây
mục cha
commit
88f30b984c

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

@@ -2384,6 +2384,23 @@ class GMFrame(wx.Frame):
         # show map display
         self.GetMapDisplay().Show()
 
+    def OnShowRegionExtent(self, event):
+        """Add vector labels map layer to the current layer tree"""
+        # start new map display if no display is available
+        if not self.currentPage:
+            self.NewDisplay(show=True)
+        # get current map display
+        mapdisp = self.GetMapDisplay()
+        # change the property
+        mapdisp.mapWindowProperties.showRegion = True
+        # show map display (user said show so make sure it is visible)
+        mapdisp.Show()
+        # redraw map if auto-rendering is enabled
+        # seems little too low level for this place
+        # no redraw when Render is unchecked
+        if mapdisp.IsAutoRendered():
+            mapdisp.GetMapWindow().UpdateMap(render=False)
+
     def OnDeleteLayer(self, event):
         """Remove selected map layer from the current layer Tree
         """

+ 1 - 0
gui/wxpython/xml/toolboxes.xml

@@ -537,6 +537,7 @@
     <items>
       <wxgui-item name="ShowRegion"/>
       <wxgui-item name="ShowRegionLL"/>
+      <wxgui-item name="ShowRegionExtent"/>
       <module-item name="g.region">
         <label>Set region</label>
       </module-item>

+ 6 - 0
gui/wxpython/xml/wxgui_items.xml

@@ -270,6 +270,12 @@
     <description>Shows the extent and resolution of the computational region.</description>
     <keywords>general,settings</keywords>
   </wxgui-item>
+  <wxgui-item name="ShowRegionExtent">
+    <label>Show current region extent in Map Display</label>
+    <handler>OnShowRegionExtent</handler>
+    <description>Shows the extent of the computational region in Map Display.</description>
+    <keywords>general,settings</keywords>
+  </wxgui-item>
   <wxgui-item name="MapsetAccess">
     <label>Mapset access</label>
     <handler>OnMapsets</handler>