[GRASS-SVN] r35584 - in grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 24 16:41:22 EST 2009


Author: martinl
Date: 2009-01-24 16:41:22 -0500 (Sat, 24 Jan 2009)
New Revision: 35584

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
Log:
minor MS Windows wxGUI fixes

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2009-01-24 20:58:16 UTC (rev 35583)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2009-01-24 21:41:22 UTC (rev 35584)
@@ -201,7 +201,8 @@
             # list of locations
             self.UpdateLocations(self.gisdbase)
             try:
-                self.lblocations.SetSelection(self.listOfLocations.index(location))
+                self.lblocations.SetSelection(self.listOfLocations.index(location),
+                                              force=True)
                 self.lblocations.EnsureVisible(self.listOfLocations.index(location))
             except ValueError:
                 print >> sys.stderr, _("ERROR: Location <%s> not found") % \
@@ -212,7 +213,8 @@
             mapset = self._getRCValue("MAPSET")
             if mapset:
                 try:
-                    self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset))
+                    self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset),
+                                                force=True)
                     self.lbmapsets.EnsureVisible(self.listOfMapsets.index(mapset))
                 except ValueError:
                     self.lbmapsets.Clear()
@@ -778,8 +780,9 @@
     def InsertItems(self, choices, pos, disabled=[]):
         self.__LoadData(choices, disabled)
 
-    def SetSelection(self, item):
-        if item != wx.NOT_FOUND and platform.system() != 'Windows':
+    def SetSelection(self, item, force = False):
+        if item != wx.NOT_FOUND and \
+                (platform.system() != 'Windows' or force):
             ### Windows -> FIXME
             self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
 	

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py	2009-01-24 20:58:16 UTC (rev 35583)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py	2009-01-24 21:41:22 UTC (rev 35584)
@@ -37,7 +37,10 @@
 from goutput import wxCmdOutput as wxCmdOutput
 
 sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-import grass6_wxnviz as wxnviz
+try:
+    import grass6_wxnviz as wxnviz
+except ImportError:
+    pass
 
 wxUpdateProperties, EVT_UPDATE_PROP = NewEvent()
 wxUpdateView,       EVT_UPDATE_VIEW = NewEvent()

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py	2009-01-24 20:58:16 UTC (rev 35583)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py	2009-01-24 21:41:22 UTC (rev 35584)
@@ -30,7 +30,10 @@
 from nviz_mapdisp import wxUpdateProperties as wxUpdateProperties
 
 sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-import grass6_wxnviz as wxnviz
+try:
+   import grass6_wxnviz as wxnviz
+except ImportError:
+   pass
 
 class NvizToolWindow(wx.Frame):
     """Experimental window for Nviz tools



More information about the grass-commit mailing list