[GRASS-SVN] r48028 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 1 09:00:26 EDT 2011


Author: martinl
Date: 2011-09-01 06:00:26 -0700 (Thu, 01 Sep 2011)
New Revision: 48028

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_vdigit.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxvdriver.py
Log:
wxGUI: fix opacity level for vdigit
       (merge r48027 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-09-01 12:53:54 UTC (rev 48027)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-09-01 13:00:26 UTC (rev 48028)
@@ -224,13 +224,17 @@
         return self.mapdisplay
     
     def OnIdle(self, event):
-        """
-        Only re-order and re-render a composite map image from GRASS during
+        """!Only re-order and re-render a composite map image from GRASS during
         idle time instead of multiple times during layer changing.
         """
         if self.rerender:
+            if self.mapdisplay.toolbars['vdigit']:
+                vector = True
+            else:
+                vector = False
             if self.mapdisplay.statusbarWin['render'].GetValue():
-                self.mapdisplay.MapWindow.UpdateMap(render = True)
+                self.mapdisplay.MapWindow.UpdateMap(render = True, renderVector = vector)
+            
             self.rerender = False
         
         event.Skip()
@@ -588,16 +592,17 @@
         
     def OnSetBgMap(self, event):
         """!Set background vector map for editing sesstion"""
+        digit = self.mapdisplay.GetWindow().digit
         if event.IsChecked():
             mapName = self.GetPyData(self.layer_selected)[0]['maplayer'].GetName()
             UserSettings.Set(group = 'vdigit', key = 'bgmap', subkey = 'value',
                              value = str(mapName), internal = True)
-            self.mapdisplay.digit.OpenBackgroundMap(mapName)
+            digit.OpenBackgroundMap(mapName)
             self._setGradient('bgmap')
         else:
             UserSettings.Set(group = 'vdigit', key = 'bgmap', subkey = 'value',
                              value = '', internal = True)
-            self.mapdisplay.digit.CloseBackgroundMap()
+            digit.CloseBackgroundMap()
             self._setGradient()
         
         self.RefreshLine(self.layer_selected)
@@ -629,7 +634,7 @@
             if self.mapdisplay.toolbars['vdigit'] and \
                     self.mapdisplay.toolbars['vdigit'].GetLayer() == maplayer:   
                 alpha = int(new_opacity * 255)
-                self.mapdisplay.digit.driver.UpdateSettings(alpha)
+                self.mapdisplay.GetWindow().digit.GetDisplay().UpdateSettings(alpha = alpha)
                 
             # redraw map if auto-rendering is enabled
             self.rerender = True

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_vdigit.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_vdigit.py	2011-09-01 12:53:54 UTC (rev 48027)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_vdigit.py	2011-09-01 13:00:26 UTC (rev 48028)
@@ -39,7 +39,7 @@
         
         self.pdcVector = wx.PseudoDC()
         self.toolbar   = self.parent.toolbars['vdigit']
-        self.digit     = None
+        self.digit     = None # wxvdigit.IVDigit
         
         self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-09-01 12:53:54 UTC (rev 48027)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-09-01 13:00:26 UTC (rev 48028)
@@ -1067,10 +1067,11 @@
         if not self.parent.MapWindow.resize:
             self.parent.MapWindow.UpdateMap(render = True)
         
+        # respect opacity
         opacity = mapLayer.GetOpacity(float = True)
         if opacity < 1.0:
             alpha = int(opacity * 255)
-            self.digit.UpdateSettings(alpha)
+            self.digit.GetDisplay().UpdateSettings(alpha = alpha)
         
         return True
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxvdriver.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxvdriver.py	2011-09-01 12:53:54 UTC (rev 48027)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxvdriver.py	2011-09-01 13:00:26 UTC (rev 48028)
@@ -882,7 +882,8 @@
                              UserSettings.Get(group = 'vdigit', key = 'symbol',
                                               subkey = [key, 'color'])[1],
                              UserSettings.Get(group = 'vdigit', key = 'symbol',
-                                              subkey = [key, 'color'])[2])
+                                              subkey = [key, 'color'])[2],
+                             alpha)
             
             if key == 'highlight':
                 self.settings[key] = color



More information about the grass-commit mailing list