[GRASS-SVN] r32130 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 16 08:35:42 EDT 2008
Author: martinl
Date: 2008-07-16 08:35:42 -0400 (Wed, 16 Jul 2008)
New Revision: 32130
Modified:
grass/trunk/gui/wxpython/gui_modules/vdigit.py
Log:
wxGUI/vdigit: disable snapping fn fixed (threshold == 0)
Modified: grass/trunk/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/vdigit.py 2008-07-16 08:44:28 UTC (rev 32129)
+++ grass/trunk/gui/wxpython/gui_modules/vdigit.py 2008-07-16 12:35:42 UTC (rev 32130)
@@ -1201,7 +1201,7 @@
else:
snap = wxvdigit.SNAP
else:
- snap = v.digit.NO_SNAP
+ snap = wxvdigit.NO_SNAP
return (snap, thresh)
@@ -1241,10 +1241,10 @@
@param value threshold to be set up
@param units units (map, screen)
"""
- if not value:
+ if value is None:
value = UserSettings.Get(group='vdigit', key=type, subkey='value')
- if not units:
+ if units is None:
units = UserSettings.Get(group='vdigit', key=type, subkey='units')
if units == "screen pixels":
@@ -1254,7 +1254,7 @@
res = reg['nsres']
else:
res = reg['ewres']
-
+
threshold = value * res
else:
threshold = value
@@ -1696,7 +1696,7 @@
text = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Snapping threshold"))
self.snappingValue = wx.SpinCtrl(parent=panel, id=wx.ID_ANY, size=(75, -1),
initial=UserSettings.Get(group='vdigit', key="snapping", subkey='value'),
- min=1, max=1e6)
+ min=0, max=1e6)
self.snappingValue.Bind(wx.EVT_SPINCTRL, self.OnChangeSnappingValue)
self.snappingUnit = wx.Choice(parent=panel, id=wx.ID_ANY, size=(125, -1),
choices=["screen pixels", "map units"])
@@ -2010,6 +2010,7 @@
def OnChangeSnappingValue(self, event):
"""Change snapping value - update static text"""
value = self.snappingValue.GetValue()
+
if self.snappingUnit.GetStringSelection() == "map units":
threshold = value
else:
More information about the grass-commit
mailing list