[GRASS-SVN] r40528 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 18 09:17:04 EST 2010


Author: martinl
Date: 2010-01-18 09:17:03 -0500 (Mon, 18 Jan 2010)
New Revision: 40528

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI/location_wizard: fix utm


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-01-18 13:46:36 UTC (rev 40527)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-01-18 14:17:03 UTC (rev 40528)
@@ -719,22 +719,23 @@
         if not self.pparam.has_key(id):
             event.Skip()
             return
-        
+
         param = self.pparam[id]
         win = self.FindWindowById(id)
         if param['type'] == 'zone':
-            if val.isdigit():
-                if int(val) < 1:
-                    win.SetValue(1)
-                if int(val) > 60:
+            val = event.GetInt()
+            if val < 1:
+                win.SetValue(1)
+            elif val > 60:
                     win.SetValue(60)
-            else: 
-                win.SetValue(1)
         
-        param['value'] = val
+        if param['type'] == 'bool':
+            param['value'] = event.GetSelection()
+        else:
+            param['value'] = val
         
         event.Skip()
-
+        
     def OnPageChange(self,event=None):
         """!Go to next page"""
         if event.GetDirection():
@@ -752,7 +753,7 @@
                                       caption = _('Error'), style = wx.ICON_ERROR | wx.CENTRE)
                         event.Veto()
                     else:
-                        self.p4projparams += (' +' + param['proj4'] + '=' + param['value'])
+                        self.p4projparams += (' +' + param['proj4'] + '=' + str(param['value']))
 
     def OnEnterPage(self,event):
         """!Page entered"""
@@ -783,7 +784,7 @@
             row = 0
             for paramgrp in self.parent.projections[self.parent.projpage.proj][1]:
                 # get parameters
-                id = wx.ID_ANY
+                id = wx.NewId()
                 param = self.pparam[id] = { 'type' : self.parent.paramdesc[paramgrp[0]][0],
                                             'proj4': self.parent.paramdesc[paramgrp[0]][1],
                                             'desc' : self.parent.paramdesc[paramgrp[0]][2] }
@@ -808,8 +809,9 @@
                     win = wx.SpinCtrl(parent = self.panel, id = id,
                                       size = (100, -1), 
                                       style = wx.SP_ARROW_KEYS | wx.SP_WRAP,
-                                      min = 1, max = 60, initial = 30)  
+                                      min = 1, max = 60)
                     win.SetValue(param['value'])
+                    win.Bind(wx.EVT_SPINCTRL, self.OnParamEntry)
                     win.Bind(wx.EVT_TEXT, self.OnParamEntry)
                 else:
                     win = wx.TextCtrl(parent = self.panel, id = id,



More information about the grass-commit mailing list