[GRASS-SVN] r41198 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 27 08:12:08 EST 2010
Author: martinl
Date: 2010-02-27 08:12:07 -0500 (Sat, 27 Feb 2010)
New Revision: 41198
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
Log:
wxGUI: fix georect (#728)
(merge r41197 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py 2010-02-27 12:54:23 UTC (rev 41197)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py 2010-02-27 13:12:07 UTC (rev 41198)
@@ -194,6 +194,7 @@
self.xy_mapdisp.SetTitle(_("GRASS GIS Map Display: 1" +
" - Location: " + self.newlocation +
" (source location)"))
+ self.xy_mapdisp.SetName("GRMapWindow")
self.gcpmgr.SetMapDisplay(self.xy_mapdisp)
@@ -209,6 +210,7 @@
#
# show new display & draw map
#
+ self.xy_mapdisp.toolbars['georect'].OnZoomMap(None)
self.xy_mapdisp.CenterOnScreen()
self.xy_mapdisp.Show()
self.gcpmgr.Centre()
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2010-02-27 12:54:23 UTC (rev 41197)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2010-02-27 13:12:07 UTC (rev 41198)
@@ -2561,7 +2561,10 @@
(self.zoomhistory))
if len(self.zoomhistory) > 1:
- self.parent.toolbars['map'].Enable('zoomback')
+ if self.parent.GetName() == 'MapWindow':
+ self.parent.toolbars['map'].Enable('zoomback')
+ else:
+ self.parent.toolbars['georect'].Enable('zoomback')
return removed
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py 2010-02-27 12:54:23 UTC (rev 41197)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py 2010-02-27 13:12:07 UTC (rev 41198)
@@ -46,6 +46,8 @@
def __init__(self, parent):
self.parent = parent
wx.ToolBar.__init__(self, parent = self.parent, id = wx.ID_ANY)
+
+ self.action = dict()
self.Bind(wx.EVT_TOOL, self.OnTool)
@@ -138,7 +140,20 @@
if platform.system() == 'Windows':
size = self.GetBestSize()
self.SetSize((size[0] + width, size[1]))
+
+ def Enable(self, tool, enable = True):
+ """!Enable defined tool
+ @param tool name
+ @param enable True to enable otherwise disable tool
+ """
+ try:
+ id = getattr(self, tool)
+ except AttributeError:
+ return
+
+ self.EnableTool(id, enable)
+
class MapToolbar(AbstractToolbar):
"""!Map Display toolbar
"""
@@ -168,10 +183,10 @@
self.combo.Hide()
self.combo.Show()
- # default action
self.action = { 'id' : self.pointer }
self.defaultAction = { 'id' : self.pointer,
'bind' : self.parent.OnPointer }
+
self.OnTool(None)
self.EnableTool(self.zoomback, False)
@@ -286,19 +301,6 @@
self.printmap):
self.EnableTool(tool, enabled)
- def Enable(self, tool, enable = True):
- """!Enable defined tool
-
- @param tool name
- @param enable True to enable otherwise disable tool
- """
- try:
- id = getattr(self, tool)
- except AttributeError:
- return
-
- self.EnableTool(self.zoomback, enable)
-
class GRToolbar(AbstractToolbar):
"""
Georectification toolbar
@@ -310,7 +312,7 @@
@param parent reference to MapFrame
@param mapcontent reference to render.Map (registred by MapFrame)
"""
- self.mapcontent = map
+ self.mapcontent = mapcontent
AbstractToolbar.__init__(self, parent)
self.InitToolbar(self.ToolbarData())
@@ -318,6 +320,14 @@
# realize the toolbar
self.Realize()
+ self.action = { 'id' : self.gcpset }
+ self.defaultAction = { 'id' : self.gcpset,
+ 'bind' : self.parent.OnPointer }
+
+ self.OnTool(None)
+
+ self.EnableTool(self.zoomback, False)
+
def ToolbarData(self):
"""!Toolbar data"""
self.displaymap = wx.NewId()
@@ -365,9 +375,9 @@
def OnZoomMap(self, event):
"""!Zoom to selected map"""
self.parent.MapWindow.ZoomToMap(layers = self.mapcontent.GetListOfLayers())
+ if event:
+ event.Skip()
- event.Skip()
-
class GCPToolbar(AbstractToolbar):
"""!
Toolbar for managing ground control points during georectification
More information about the grass-commit
mailing list