[GRASS-SVN] r71305 - in grass/trunk/gui/wxpython: lmgr xml

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 22 09:56:24 PDT 2017


Author: wenzeslaus
Date: 2017-07-22 09:56:24 -0700 (Sat, 22 Jul 2017)
New Revision: 71305

Modified:
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/xml/toolboxes.xml
   grass/trunk/gui/wxpython/xml/wxgui_items.xml
Log:
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).


Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2017-07-22 16:25:37 UTC (rev 71304)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2017-07-22 16:56:24 UTC (rev 71305)
@@ -2384,6 +2384,23 @@
         # 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
         """

Modified: grass/trunk/gui/wxpython/xml/toolboxes.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/toolboxes.xml	2017-07-22 16:25:37 UTC (rev 71304)
+++ grass/trunk/gui/wxpython/xml/toolboxes.xml	2017-07-22 16:56:24 UTC (rev 71305)
@@ -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>

Modified: grass/trunk/gui/wxpython/xml/wxgui_items.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/wxgui_items.xml	2017-07-22 16:25:37 UTC (rev 71304)
+++ grass/trunk/gui/wxpython/xml/wxgui_items.xml	2017-07-22 16:56:24 UTC (rev 71305)
@@ -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>



More information about the grass-commit mailing list