[GRASS-SVN] r33610 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 30 05:19:53 EDT 2008


Author: martinl
Date: 2008-09-30 05:19:53 -0400 (Tue, 30 Sep 2008)
New Revision: 33610

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: check if wx.GCDC is available
(merge from devbr6, r33609)


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-09-30 09:15:06 UTC (rev 33609)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-09-30 09:19:53 UTC (rev 33610)
@@ -503,8 +503,12 @@
             # draw vector map layer
             if self.pdcVector:
                 # decorate with GDDC (transparency)
-                gcdc = wx.GCDC(dc)
-                self.pdcVector.DrawToDCClipped(gcdc, rgn)
+                try:
+                    gcdc = wx.GCDC(dc)
+                    self.pdcVector.DrawToDCClipped(gcdc, rgn)
+                except NotImplementedError, e:
+                    print >> sys.stderr, e
+                    self.pdcVector.DrawToDCClipped(dc, rgn)
 
             self.bufferLast = None
         else: # do not redraw pdc and pdcVector
@@ -514,9 +518,13 @@
 
                 if self.pdcVector:
                     # decorate with GDDC (transparency)
-                    gcdc = wx.GCDC(dc)
-                    self.pdcVector.DrawToDC(gcdc)
-                    
+                    try:
+                        gcdc = wx.GCDC(dc)
+                        self.pdcVector.DrawToDC(gcdc)
+                    except NotImplementedError, e:
+                        print >> sys.stderr, e
+                        self.pdcVector.DrawToDC(dc)
+                        
                 # store buffered image
                 # self.bufferLast = wx.BitmapFromImage(self.buffer.ConvertToImage())
                 self.bufferLast = dc.GetAsBitmap(wx.Rect(0, 0, self.Map.width, self.Map.height))
@@ -526,8 +534,12 @@
             pdcLast.DrawToDC(dc)
 
         # draw decorations (e.g. region box)
-        gcdc = wx.GCDC(dc)
-        self.pdcDec.DrawToDC(gcdc)
+        try:
+            gcdc = wx.GCDC(dc)
+            self.pdcDec.DrawToDC(gcdc)
+        except NotImplementedError, e:
+            print >> sys.stderr, e
+            self.pdcDec.DrawToDC(dc)
 
         # draw temporary object on the foreground
         ### self.pdcTmp.DrawToDCClipped(dc, rgn)



More information about the grass-commit mailing list