[GRASS-SVN] r66434 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 7 19:11:34 PDT 2015


Author: annakrat
Date: 2015-10-07 19:11:34 -0700 (Wed, 07 Oct 2015)
New Revision: 66434

Modified:
   grass/trunk/gui/wxpython/gui_core/mapdisp.py
   grass/trunk/gui/wxpython/gui_core/toolbars.py
Log:
wxGUI/vnet: fix adding points because of unregistered handler (author: turek)

Modified: grass/trunk/gui/wxpython/gui_core/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/mapdisp.py	2015-10-07 21:21:01 UTC (rev 66433)
+++ grass/trunk/gui/wxpython/gui_core/mapdisp.py	2015-10-08 02:11:34 UTC (rev 66434)
@@ -130,8 +130,9 @@
         dh = hf - hw
         self.SetSize((wf + dw, hf + dh))
 
-    def _onToggleTool(self):
-        self.GetWindow().UnregisterAllHandlers()
+    def _onToggleTool(self, id):
+        if self._toolSwitcher.IsToolInGroup(id, 'mouseUse'):
+            self.GetWindow().UnregisterAllHandlers()
 
     def OnSize(self, event):
         """Adjust statusbar on changing size"""
@@ -499,9 +500,10 @@
         self.GetFirstWindow().Bind(wx.EVT_ENTER_WINDOW, self.ActivateFirstMap)
         self.GetSecondWindow().Bind(wx.EVT_ENTER_WINDOW, self.ActivateSecondMap)
     
-    def _onToggleTool(self):
-        self.GetFirstWindow().UnregisterAllHandlers()
-        self.GetSecondWindow().UnregisterAllHandlers()
+    def _onToggleTool(self, id): 
+        if self._toolSwitcher.IsToolInGroup(id, 'mouseUse'):
+            self.GetFirstWindow().UnregisterAllHandlers()
+            self.GetSecondWindow().UnregisterAllHandlers()
 
     def GetFirstMap(self):
         """Returns first Map instance

Modified: grass/trunk/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/toolbars.py	2015-10-07 21:21:01 UTC (rev 66433)
+++ grass/trunk/gui/wxpython/gui_core/toolbars.py	2015-10-08 02:11:34 UTC (rev 66434)
@@ -332,7 +332,11 @@
         """
         for group in self._toolsGroups[tool]:
             for tb in self._groups[group]:
-                if tb.FindById(tool):
+                if tb == 'custom':
+                    for bid, handler in self._groups[group][tb]:
+                        if tool == bid:
+                            return True
+                elif tb.FindById(tool):
                     return True
         return False
 



More information about the grass-commit mailing list