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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 4 18:20:28 EDT 2011


Author: martinl
Date: 2011-05-04 15:20:28 -0700 (Wed, 04 May 2011)
New Revision: 46194

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
Log:
wxGUI/vdigit: fix settings dialog


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py	2011-05-04 21:11:56 UTC (rev 46193)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py	2011-05-04 22:20:28 UTC (rev 46194)
@@ -65,12 +65,13 @@
         """
         wx.Dialog.__init__(self, parent = parent, id = wx.ID_ANY, title = title, style = style)
         
-        self.parent = parent # mapdisplay.BufferedWindow class instance
-
+        self.parent = parent # mapdisplay.MapFrame class instance
+        self.digit = self.parent.MapWindow.digit
+        
         # notebook
         notebook = wx.Notebook(parent = self, id = wx.ID_ANY, style = wx.BK_DEFAULT)
         self._createSymbologyPage(notebook)
-        self.parent.digit.SetCategory()
+        self.digit.SetCategory()
         self._createGeneralPage(notebook)
         self._createAttributesPage(notebook)
         self._createQueryPage(notebook)
@@ -205,7 +206,7 @@
         self.mapUnits = self.parent.MapWindow.Map.GetProjInfo()['units']
         self.snappingInfo = wx.StaticText(parent = panel, id = wx.ID_ANY,
                                           label = _("Snapping threshold is %(value).1f %(units)s") % \
-                                              {'value' : self.parent.digit.GetDisplay().GetThreshold(),
+                                              {'value' : self.digit.GetDisplay().GetThreshold(),
                                                'units' : self.mapUnits})
         vertexSizer.Add(item = self.snappingInfo, proportion = 0,
                         flag = wx.ALL | wx.EXPAND, border = 1)
@@ -588,7 +589,7 @@
         if mode == 2 and self.addRecord.IsChecked(): # no category
             self.addRecord.SetValue(False)
         
-        self.parent.digit.SetCategory()
+        self.digit.SetCategory()
         self.category.SetValue(UserSettings.Get(group = 'vdigit', key = 'category', subkey = 'value'))
 
     def OnChangeLayer(self, event):
@@ -597,7 +598,7 @@
         layer = event.GetInt()
         if layer > 0:
             UserSettings.Set(group = 'vdigit', key = 'layer', subkey = 'value', value = layer)
-            self.parent.digit.SetCategory()
+            self.digit.SetCategory()
             self.category.SetValue(UserSettings.Get(group = 'vdigit', key = 'category', subkey = 'value'))
             
         event.Skip()
@@ -605,7 +606,7 @@
     def OnChangeAddRecord(self, event):
         """!Checkbox 'Add new record' status changed
         """
-        self.category.SetValue(self.parent.digit.SetCategory())
+        self.category.SetValue(self.digit.SetCategory())
             
     def OnChangeSnappingValue(self, event):
         """!Change snapping value - update static text
@@ -615,12 +616,12 @@
         if value < 0:
             region = self.parent.MapWindow.Map.GetRegion()
             res = (region['nsres'] + region['ewres']) / 2.
-            threshold = self.parent.digit.GetDisplay().GetThreshold(value = res)
+            threshold = self.digit.GetDisplay().GetThreshold(value = res)
         else:
             if self.snappingUnit.GetStringSelection() == "map units":
                 threshold = value
             else:
-                threshold = self.parent.digit.GetDisplay().GetThreshold(value = value)
+                threshold = self.digit.GetDisplay().GetThreshold(value = value)
             
         if value == 0:
             self.snappingInfo.SetLabel(_("Snapping disabled"))
@@ -641,7 +642,7 @@
         """
         value = self.snappingValue.GetValue()
         units = self.snappingUnit.GetStringSelection()
-        threshold = self.parent.digit.GetDisplay().GetThreshold(value = value, units = units)
+        threshold = self.digit.GetDisplay().GetThreshold(value = value, units = units)
 
         if units == "map units":
             self.snappingInfo.SetLabel(_("Snapping threshold is %(value).1f %(units)s") % 
@@ -807,7 +808,7 @@
         UserSettings.Set(group = 'vdigit', key = "breakLines", subkey = 'enabled',
                          value = self.intersect.IsChecked())
         
-        self.parent.digit.UpdateSettings()
+        self.digit.UpdateSettings()
         
         # redraw map if auto-rendering is enabled
         if self.parent.statusbarWin['render'].GetValue(): 



More information about the grass-commit mailing list