Forráskód Böngészése

wxGUI/wxpsmap: fixed bug https://trac.osgeo.org/grass/ticket/1545

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50452 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 éve
szülő
commit
df8be4d644
2 módosított fájl, 7 hozzáadás és 7 törlés
  1. 3 3
      gui/wxpython/psmap/dialogs.py
  2. 4 4
      gui/wxpython/psmap/frame.py

+ 3 - 3
gui/wxpython/psmap/dialogs.py

@@ -89,7 +89,7 @@ class UnitConversion:
     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 @@ class MapFramePanel(wx.Panel):
         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 @@ class LegendDialog(PsmapDialog):
                 # 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))

+ 4 - 4
gui/wxpython/psmap/frame.py

@@ -723,7 +723,7 @@ class PsMapFrame(wx.Frame):
     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 @@ class PsMapBufferedWindow(wx.Window):
         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 @@ class PsMapBufferedWindow(wx.Window):
             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 @@ class PsMapBufferedWindow(wx.Window):
             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)