[GRASS-SVN] r52581 - in grass/trunk/gui/wxpython: gcp gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 7 08:10:31 PDT 2012


Author: mmetz
Date: 2012-08-07 08:10:30 -0700 (Tue, 07 Aug 2012)
New Revision: 52581

Modified:
   grass/trunk/gui/wxpython/gcp/mapdisplay.py
   grass/trunk/gui/wxpython/gcp/toolbars.py
   grass/trunk/gui/wxpython/gui_core/toolbars.py
Log:
wx GCP manager: toggle tools

Modified: grass/trunk/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/mapdisplay.py	2012-08-07 14:56:53 UTC (rev 52580)
+++ grass/trunk/gui/wxpython/gcp/mapdisplay.py	2012-08-07 15:10:30 UTC (rev 52581)
@@ -315,9 +315,8 @@
         Zoom in the map.
         Set mouse cursor, zoombox attributes, and zoom direction
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+        self.toolbars['gcpdisp'].OnTool(event)
+        self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
@@ -345,9 +344,8 @@
         Zoom out the map.
         Set mouse cursor, zoombox attributes, and zoom direction
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+	self.toolbars['gcpdisp'].OnTool(event)
+	self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
@@ -374,9 +372,8 @@
         """
         Panning, set mouse to drag
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+	self.toolbars['gcpdisp'].OnTool(event)
+	self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "pan"
         self.MapWindow.mouse['box'] = "pan"

Modified: grass/trunk/gui/wxpython/gcp/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/toolbars.py	2012-08-07 14:56:53 UTC (rev 52580)
+++ grass/trunk/gui/wxpython/gcp/toolbars.py	2012-08-07 15:10:30 UTC (rev 52581)
@@ -39,12 +39,8 @@
 
     def _toolbarData(self):
         icons = {
-            'gcpSave'    : MetaIcon(img = 'gcp-save',
-                                    label = _('Save GCPs to POINTS file')),
-            'gcpReload'  : MetaIcon(img = 'reload',
-                                    label = _('Reload GCPs from POINTS file')),
             'gcpAdd'     : MetaIcon(img = 'gcp-add',
-                                    label = _('Add new GCP')),
+                                    label = _('Add new GCP to the list')),
             'gcpDelete'  : MetaIcon(img = 'gcp-delete',
                                     label = _('Delete selected GCP')),
             'gcpClear'   : MetaIcon(img = 'gcp-remove',
@@ -53,14 +49,13 @@
                                     label = _('Recalculate RMS error')),
             'georectify' : MetaIcon(img = 'georectify',
                                     label = _('Georectify')),
+            'gcpSave'    : MetaIcon(img = 'gcp-save',
+                                    label = _('Save GCPs to POINTS file')),
+            'gcpReload'  : MetaIcon(img = 'reload',
+                                    label = _('Reload GCPs from POINTS file')),
             }
         
-        return self._getToolbarData((('gcpSave', icons["gcpSave"],
-                                      self.parent.SaveGCPs),
-                                     ('gcpReload', icons["gcpReload"],
-                                      self.parent.ReloadGCPs),
-                                     (None, ),
-                                     ('gcpAdd', icons["gcpAdd"],
+        return self._getToolbarData((('gcpAdd', icons["gcpAdd"],
                                       self.parent.AddGCP),
                                      ('gcpDelete', icons["gcpDelete"],
                                       self.parent.DeleteGCP),
@@ -70,7 +65,12 @@
                                      ('rms', icons["gcpRms"],
                                       self.parent.OnRMS),
                                      ('georect', icons["georectify"],
-                                      self.parent.OnGeorect))
+                                      self.parent.OnGeorect),
+                                     (None, ),
+				     ('gcpSave', icons["gcpSave"],
+                                      self.parent.SaveGCPs),
+                                     ('gcpReload', icons["gcpReload"],
+                                      self.parent.ReloadGCPs))
                                     )
     
 class GCPDisplayToolbar(BaseToolbar):
@@ -109,8 +109,8 @@
         """!Toolbar data"""
         icons = {
             'gcpSet'    : MetaIcon(img = 'gcp-create',
-                                   label = _('Set GCP'),
-                                   desc = _('Define GCP (Ground Control Points)')),
+                                   label = _('Update GCP coordinates'),
+                                   desc = _('Update GCP coordinates)')),
             'quit'      : BaseIcons['quit'].SetLabel(_('Quit georectification tool')),
             'settings'  : BaseIcons['settings'].SetLabel( _('Georectifier settings')),
             'help'      : BaseIcons['help'].SetLabel(_('Georectifier manual')),
@@ -124,13 +124,17 @@
                                       self.parent.OnErase),
                                      (None, ),
                                      ("gcpset", icons["gcpSet"],
-                                      self.parent.OnPointer),
+                                      self.parent.OnPointer,
+				      wx.ITEM_CHECK),
                                      ("pan", BaseIcons["pan"],
-                                      self.parent.OnPan),
+                                      self.parent.OnPan,
+				      wx.ITEM_CHECK),
                                      ("zoomin", BaseIcons["zoomIn"],
-                                      self.parent.OnZoomIn),
+                                      self.parent.OnZoomIn,
+				      wx.ITEM_CHECK),
                                      ("zoomout", BaseIcons["zoomOut"],
-                                      self.parent.OnZoomOut),
+                                      self.parent.OnZoomOut,
+				      wx.ITEM_CHECK),
                                      ("zoommenu", BaseIcons["zoomMenu"],
                                       self.parent.OnZoomMenuGCP),
                                      (None, ),
@@ -147,3 +151,4 @@
                                      ('quit', icons["quit"],
                                       self.parent.OnQuit))
                                     )
+

Modified: grass/trunk/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/toolbars.py	2012-08-07 14:56:53 UTC (rev 52580)
+++ grass/trunk/gui/wxpython/gui_core/toolbars.py	2012-08-07 15:10:30 UTC (rev 52581)
@@ -161,8 +161,6 @@
     def OnTool(self, event):
         """!Tool selected
         """
-        if self.parent.GetName() == "GCPFrame":
-            return
         
         id = self.action.get('id', -1)
         



More information about the grass-commit mailing list