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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 6 07:38:31 EDT 2008


Author: martinl
Date: 2008-09-06 07:38:31 -0400 (Sat, 06 Sep 2008)
New Revision: 33293

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: bugfix - trac #294 - computational region extent frame should be semi-transparent


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 11:29:10 UTC (rev 33292)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 11:38:31 UTC (rev 33293)
@@ -294,6 +294,8 @@
         self.pdc = wx.PseudoDC()
         # used for digitization tool
         self.pdcVector = None
+        # decorations (region box, etc.)
+        self.pdcDec = wx.PseudoDC()
         # pseudoDC for temporal objects (select box, measurement tool, etc.)
         self.pdcTmp = wx.PseudoDC()
         # redraw all pdc's, pdcTmp layer is redrawn always (speed issue)
@@ -517,8 +519,12 @@
             pdcLast.DrawBitmap(bmp=self.bufferLast, x=0, y=0)
             pdcLast.DrawToDC(dc)
 
+        # draw decorations (e.g. region box)
+        gcdc = wx.GCDC(dc)
+        self.pdcDec.DrawToDC(gcdc)
+
         # draw temporary object on the foreground
-        # self.pdcTmp.DrawToDCClipped(dc, rgn)
+        ### self.pdcTmp.DrawToDCClipped(dc, rgn)
         self.pdcTmp.DrawToDC(dc)
         
     def OnSize(self, event):
@@ -670,11 +676,12 @@
         #
         # clear pseudoDcs
         #
-        self.pdc.Clear()
-        self.pdc.RemoveAll()
-        self.pdcTmp.Clear()
-        self.pdcTmp.RemoveAll()
-
+        for pdc in (self.pdc,
+                    self.pdcDec,
+                    self.pdcTmp):
+            pdc.Clear()
+            pdc.RemoveAll()
+        
         #
         # draw background map image to PseudoDC
         #
@@ -768,10 +775,11 @@
             dispReg = self.Map.GetCurrentRegion()
             reg = None
             if self.IsInRegion(dispReg, compReg):
-                self.polypen = wx.Pen(colour='blue', width=3, style=wx.SOLID)
+                self.polypen = wx.Pen(colour=wx.Colour(0, 0, 255, 128), width=3, style=wx.SOLID)
                 reg = dispReg
             else:
-                self.polypen = wx.Pen(colour='red', width=3, style=wx.SOLID)
+                self.polypen = wx.Pen(colour=wx.Colour(255, 0, 0, 128),
+                                      width=3, style=wx.SOLID)
                 reg = compReg
             
             self.regionCoords = []
@@ -781,7 +789,7 @@
             self.regionCoords.append((reg['w'], reg['s']))
             self.regionCoords.append((reg['w'], reg['n']))
             # draw region extent
-            self.DrawLines(pdc=self.pdcTmp, polycoords=self.regionCoords)
+            self.DrawLines(pdc=self.pdcDec, polycoords=self.regionCoords)
 
     def IsInRegion(self, region, refRegion):
         """Test if 'region' is inside of 'refRegion'



More information about the grass-commit mailing list