[GRASS-SVN] r54530 - grass/trunk/gui/wxpython/iclass
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 5 01:25:09 PST 2013
Author: annakrat
Date: 2013-01-05 01:25:09 -0800 (Sat, 05 Jan 2013)
New Revision: 54530
Modified:
grass/trunk/gui/wxpython/iclass/frame.py
Log:
wxGUI/iclass: temporary fix for switching tools (needs refactoring)
Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py 2013-01-04 16:14:34 UTC (rev 54529)
+++ grass/trunk/gui/wxpython/iclass/frame.py 2013-01-05 09:25:09 UTC (rev 54530)
@@ -1081,10 +1081,28 @@
@fixme: needs refactoring
"""
toolbar = self.GetMapToolbar()
- self.SwitchTool(toolbar, event)
self.GetFirstWindow().mouse['use'] = 'pointer'
+ def SwitchTool(self, toolbar, event):
+ """!Calls UpdateTools to manage connected toolbars"""
+ self.UpdateTools(event)
+ super(IClassMapFrame, self).SwitchTool(toolbar, event)
+
+ def UpdateTools(self, event):
+ """!Method deals with relations of toolbars and other
+ elements"""
+ # untoggles button in other toolbars
+ for toolbar in self.toolbars.itervalues():
+ if hasattr(event, 'GetEventObject') == True:
+ if event.GetEventObject() == toolbar:
+ continue
+ if toolbar.action:
+ toolbar.ToggleTool(toolbar.action['id'], False)
+ toolbar.action['id'] = -1
+ toolbar.OnTool(None)
+
+
class MapManager:
"""! Class for managing map renderer.
More information about the grass-commit
mailing list