[GRASS-SVN] r50414 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 24 10:42:26 EST 2012


Author: annakrat
Date: 2012-01-24 07:42:26 -0800 (Tue, 24 Jan 2012)
New Revision: 50414

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap_dialogs.py
Log:
wxGUI/wxpsmap: attempt to fix #1545

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-24 14:41:08 UTC (rev 50413)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-24 15:42:26 UTC (rev 50414)
@@ -725,7 +725,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)
 
@@ -976,7 +976,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))#?
@@ -1060,7 +1060,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]
 
@@ -1505,7 +1505,7 @@
         if pdctype in ('rect', 'rectText'):
             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)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap_dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap_dialogs.py	2012-01-24 14:41:08 UTC (rev 50413)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap_dialogs.py	2012-01-24 15:42:26 UTC (rev 50414)
@@ -83,7 +83,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")},
@@ -2094,7 +2094,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,
@@ -4480,7 +4480,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))



More information about the grass-commit mailing list