[GRASS-SVN] r47037 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 7 04:04:17 EDT 2011


Author: annakrat
Date: 2011-07-07 01:04:17 -0700 (Thu, 07 Jul 2011)
New Revision: 47037

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
Log:
wxNviz:clear isosurf listbox when changing 3D rater

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2011-07-07 07:45:52 UTC (rev 47036)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2011-07-07 08:04:17 UTC (rev 47037)
@@ -1444,6 +1444,7 @@
                                           colour = (0,0,0),
                                           size = globalvar.DIALOG_COLOR_SIZE)
                 value.Bind(csel.EVT_COLOURSELECT, self.OnVolumeIsosurfMap)
+                value.SetName('color')
             elif code == 'mask':
                 value = None
             else:
@@ -2935,7 +2936,9 @@
         winUp = self.FindWindowById(self.win['volume']['btnIsosurfMoveUp'])
         winDown = self.FindWindowById(self.win['volume']['btnIsosurfMoveDown'])
         selection = event.GetSelection()
-        if selection == 0:
+        if selection == -1:
+            return
+        elif selection == 0:
             winUp.Enable(False)
             if not winDown.IsEnabled():
                 winDown.Enable()
@@ -3578,7 +3581,6 @@
         """!Update volume page"""
         if updateName:
             self.FindWindowById(self.win['volume']['map']).SetValue(layer.name)
-        list = self.FindWindowById(self.win['volume']['isosurfs'])
         
         # draw
         for control, idata in data['draw'].iteritems():
@@ -3602,9 +3604,20 @@
         
         self.SetIsosurfaceMode(data['draw']['shading']['value'])
         self.SetIsosurfaceResolution(data['draw']['resolution']['value'])
+        isobox = self.FindWindowById(self.win['volume']['isosurfs'])
+        isosurfaces = []
+        for iso in data['isosurface']:
+            level = iso['topo']['value']
+            isosurfaces.append("%s %s" % (_("Level"), level))
+        isobox.Set(isosurfaces)
+        isobox.SetChecked(range(len(isosurfaces)))
+        if data['isosurface']:
+            isobox.SetSelection(0)
+            self.UpdateVolumeIsosurfPage(layer, data['isosurface'][0])
+        else:
+            self.UpdateVolumeIsosurfPage(layer, data['attribute'])
+            
         
-        self.UpdateVolumeIsosurfPage(layer, data['attribute'])
-        
     def UpdateVolumeIsosurfPage(self, layer, data):
         """!Update dialog -- isosurface attributes"""
         #



More information about the grass-commit mailing list