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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 3 05:00:26 EDT 2010


Author: mmetz
Date: 2010-08-03 09:00:26 +0000 (Tue, 03 Aug 2010)
New Revision: 42976

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
Log:
preselect a source map for display; some help for wingrass

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-03 08:57:54 UTC (rev 42975)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-03 09:00:26 UTC (rev 42976)
@@ -679,11 +679,6 @@
 
         tgt_map = event.GetString()
 
-        if src_map == '':
-            wx.FindWindowById(wx.ID_FORWARD).Enable(False)
-        else:
-            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
-
     def OnPageChanging(self, event=None):
         global src_map
         global tgt_map
@@ -720,13 +715,15 @@
 
         # filter out all maps not in group
         self.srcselection.tcp.GetElementList(elements = self.parent.src_maps)
+        src_map = self.parent.src_maps[0]
+        self.srcselection.SetValue(src_map)
 
         self.parent.SwitchEnv('target')
         self.tgtselection.SetElementList(maptype)
         self.tgtselection.GetElementList()
         self.parent.SwitchEnv('source')
 
-        if src_map == '' or tgt_map == '':
+        if src_map == '':
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
         else:
             wx.FindWindowById(wx.ID_FORWARD).Enable(True)
@@ -1133,6 +1130,9 @@
                                     'North: %s') % (currloc, str(key), str(coord0), str(coord1)),
                           style=wx.ICON_QUESTION | wx.YES_NO | wx.CENTRE)
 
+            # for wingrass
+            if os.name == 'nt':
+                self.MapWindow.SetFocus()
             if ret == wx.NO:
                 return
             
@@ -1768,13 +1768,17 @@
             self.Map = self.TgtMap
 
         self.UpdateActive(self.MapWindow)
+        # for wingrass
+        if os.name == 'nt':
+            self.MapWindow.SetFocus()
 
     def UpdateActive(self, win):
 
         # optionally disable tool zoomback tool
         self.toolbars['gcpdisp'].Enable('zoomback', enable = (len(self.MapWindow.zoomhistory) > 1))
 
-        self.activemap.SetSelection(win == self.TgtMapWindow)
+        if self.activemap.GetSelection() != (win == self.TgtMapWindow):
+            self.activemap.SetSelection(win == self.TgtMapWindow)
         self.StatusbarUpdate()
 
     def AdjustMap(self, newreg):



More information about the grass-commit mailing list