[GRASS-SVN] r50452 - grass/trunk/gui/wxpython/psmap

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 25 12:36:11 EST 2012


Author: annakrat
Date: 2012-01-25 09:36:11 -0800 (Wed, 25 Jan 2012)
New Revision: 50452

Modified:
   grass/trunk/gui/wxpython/psmap/dialogs.py
   grass/trunk/gui/wxpython/psmap/frame.py
Log:
wxGUI/wxpsmap: fixed bug #1545

Modified: grass/trunk/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/dialogs.py	2012-01-25 17:27:09 UTC (rev 50451)
+++ grass/trunk/gui/wxpython/psmap/dialogs.py	2012-01-25 17:36:11 UTC (rev 50452)
@@ -89,7 +89,7 @@
     def __init__(self, parent = None):
         self.parent = parent
         if self.parent:
-            ppi = wx.PaintDC(self.parent).GetPPI()
+            ppi = wx.ClientDC(self.parent).GetPPI()
         else: 
             ppi = (72, 72)
         self._unitsPage = { 'inch'          : {'val': 1.0, 'tr' : _("inch")},
@@ -2339,7 +2339,7 @@
         self.drawMap = wx.CheckBox(self, id = wx.ID_ANY, label = "add selected map")
         
         self.mapOrRegionText = [_("Map:"), _("Region:")] 
-        dc = wx.PaintDC(self)# determine size of labels
+        dc = wx.ClientDC(self)# determine size of labels
         width = max(dc.GetTextExtent(self.mapOrRegionText[0])[0], dc.GetTextExtent(self.mapOrRegionText[1])[0])
         self.mapText = wx.StaticText(self, id = wx.ID_ANY, label = self.mapOrRegionText[0], size = (width, -1))
         self.select = Select(self, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE,
@@ -4757,7 +4757,7 @@
                 # font 
                 self.vLegendDict['font'] = self.panelVector.font['fontCtrl'].GetStringSelection()
                 self.vLegendDict['fontsize'] = self.panelVector.font['fontSizeCtrl'].GetValue()
-                dc = wx.PaintDC(self)
+                dc = wx.ClientDC(self)
                 font = dc.GetFont()
                 dc.SetFont(wx.Font(pointSize = self.vLegendDict['fontsize'], family = font.GetFamily(),
                                    style = font.GetStyle(), weight = wx.FONTWEIGHT_NORMAL))

Modified: grass/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py	2012-01-25 17:27:09 UTC (rev 50451)
+++ grass/trunk/gui/wxpython/psmap/frame.py	2012-01-25 17:36:11 UTC (rev 50452)
@@ -723,7 +723,7 @@
     def getTextExtent(self, textDict):
         """!Estimates bounding rectangle of text"""
         #fontsize = str(fontsize if fontsize >= 4 else 4)
-        dc = wx.PaintDC(self) # dc created because of method GetTextExtent, which pseudoDC lacks
+        dc = wx.ClientDC(self) # dc created because of method GetTextExtent, which pseudoDC lacks
        
         fn = self.makePSFont(textDict)
 
@@ -984,7 +984,7 @@
         self.pdcPaper = wx.PseudoDC()
         self.pdcTmp = wx.PseudoDC()
         self.pdcImage = wx.PseudoDC()
-        dc = wx.PaintDC(self)
+        dc = wx.ClientDC(self)
         self.font = dc.GetFont()
         
         self.SetClientSize((700,510))#?
@@ -1068,7 +1068,7 @@
             page = PageSetup(id = self.pageId)
             self.instruction.AddInstruction(page)
         
-        ppi = wx.PaintDC(self).GetPPI()
+        ppi = wx.ClientDC(self).GetPPI()
         cW, cH = self.GetClientSize()
         pW, pH = page['Width']*ppi[0], page['Height']*ppi[1]
 
@@ -1551,7 +1551,7 @@
             pdc.DrawRectangle(*bb)
             
         if pdctype == 'rectText':
-            dc = wx.PaintDC(self) # dc created because of method GetTextExtent, which pseudoDC lacks
+            dc = wx.ClientDC(self) # dc created because of method GetTextExtent, which pseudoDC lacks
             font = self.font
             size = 10
             font.SetPointSize(size)



More information about the grass-commit mailing list